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
                                              *[_]---[_]*
-----------------------------------------------------------------------------  


  • 1995 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: