Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

What happened to the NcFile destructor?

In netcdf 2.3.2 patch 4 (C++ interface), the destructor for NcFile has been
made protected: (code from netcdf.hh)

(parts of NcFile class deleted for brevity)

protected:

    // Protected destructor used to make this an abstract base class.
    virtual ~NcFile( void );

    int the_id;
    int in_define_mode;
    NcDim** dimensions;
    NcVar** variables;
    NcVar* globalv;             // "variable" for global attributes


This makes deleting an NcFile object impossible from any outside application.
I have never seen a protected destructor before. Why was this done? It is
quite possible that I'm missing something, so if I am, please tell me.

Also, the comment just above the destructor definition does not seem to make
sense. Unless I'm wrong, if you want to make an abstract base class, wouldn't
it need to be  virtual ~NcFile( void )=0 ?

If I'm wrong about all of this, please tell me how I can delete a NcOld/NewFile.
I'm at a loss.

thanks,
-----------------------------------------------------------------------------  
                                                |     |
                                                |  _  |
    Tom Glaess                    ______________|_( )_|______________
    tgl@xxxxxxxxxxxx                 o   +|+   [ ( o ) ]   +|+   o
                                              *[_]---[_]*
-----------------------------------------------------------------------------  


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690