diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2000-12-23 13:17:32 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2000-12-23 13:17:32 (GMT) |
commit | d24bacb8a47f945e6919f067e8057ad30012bd5a (patch) | |
tree | 2844b08018435b9d33f68ef4b787d5434db66d5a /c++/src/H5CompType.h | |
parent | 45c5dd949f7dd4549dc5996ff8395652ef3d9dda (diff) | |
download | hdf5-d24bacb8a47f945e6919f067e8057ad30012bd5a.zip hdf5-d24bacb8a47f945e6919f067e8057ad30012bd5a.tar.gz hdf5-d24bacb8a47f945e6919f067e8057ad30012bd5a.tar.bz2 |
[svn-r3199]
Purpose: bug fix
Description:
I found a couple of places where virtual destructors were missing
and could cause small memory leaks. Also, some destructors were
not virtual when they should be.
Solution:
- added virtual destructors, which also free dynamically allocated
memory
- added virtual to several destructors
- also, fixed several typos
Platforms tested:
Solaris 2.7 (arabica)
Diffstat (limited to 'c++/src/H5CompType.h')
-rw-r--r-- | c++/src/H5CompType.h | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 976cb17..4b1c28e 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -1,3 +1,6 @@ +// Class CompType inherits from DataType and provides accesses to a compound +// datatype. + #ifndef _H5CompType_H #define _H5CompType_H @@ -7,35 +10,27 @@ namespace H5 { class CompType : public DataType { public: - // Creates a new datatype + // Creates a new compound datatype, given the type's size CompType( size_t size ); // H5Tcreate - // Default constructor - CompType(); - - // Creates a compound datatype using an existing id - CompType( const hid_t existing_id ); - - // Copy constructor - makes a copy of original object - CompType( const CompType& original ); - // Gets the compound datatype of the specified dataset CompType( const DataSet& dataset ); // H5Dget_type - // Retrieves the number of members in this compound datatype. + // Returns the number of members in this compound datatype. int getNmembers() const; - // Retrieves the name of a member of this compound datatype. + // Returns the name of a member of this compound datatype. string getMemberName( int member_num ) const; - // Retrieves the offset of a member of this compound datatype. + // Returns the offset of a member of this compound datatype. size_t getMemberOffset( int memb_no ) const; // Returns the dimensionality of the specified member. int getMemberDims( int member_num, size_t* dims, int* perm ) const; - // Gets the type class of the specified member. It provides to - // the user a way of knowing what type to declare. + // Returns the type class of the specified member of this compound + // datatype. It provides to the user a way of knowing what type + // to create another datatype of the same class H5T_class_t getMemberClass( int member_num ) const; // Returns the generic datatype of the specified member in @@ -65,12 +60,18 @@ class CompType : public DataType { // Adds a new member to this compound datatype. void insertMember( const string name, size_t offset, const DataType& new_member ) const; - // Adds an array datatype member to this compound datatype. - void insertMember( const string name, size_t offset, int ndims, const size_t* dim, const int* perm, const DataType& new_member ) const; - // Recursively removes padding from within this compound datatype. void pack() const; + // Default constructor + CompType(); + + // Creates a compound datatype using an existing id + CompType( const hid_t existing_id ); + + // Copy constructor - makes a copy of original object + CompType( const CompType& original ); + virtual ~CompType(); private: |