diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2004-08-07 05:46:10 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2004-08-07 05:46:10 (GMT) |
commit | 47dd278b15375b71ff8663ce51778f590f69541a (patch) | |
tree | 2e5813bf7f87e10726605d96be13f1606e693de9 /c++/src | |
parent | 4b3ebf1646df8a613d53dad96f82eb0bb68f0aa2 (diff) | |
download | hdf5-47dd278b15375b71ff8663ce51778f590f69541a.zip hdf5-47dd278b15375b71ff8663ce51778f590f69541a.tar.gz hdf5-47dd278b15375b71ff8663ce51778f590f69541a.tar.bz2 |
[svn-r9046] Purpose:
Code cleanup
Description:
DataType::commit had incorrect parameter, H5Object. Changed
it to CommonFG, for H5File and Group.
The change caused additional header files needed for several
other cpp files.
Moved some functions from Group into the base class CommonFG for
H5File too.
Platforms tested:
SunOS 5.7 (arabica)
Linux 2.4 (eirene)
Misc. update:
Diffstat (limited to 'c++/src')
-rw-r--r-- | c++/src/H5AbstractDs.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5ArrayType.cpp | 3 | ||||
-rw-r--r-- | c++/src/H5AtomType.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5Attribute.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5CommonFG.cpp | 18 | ||||
-rw-r--r-- | c++/src/H5CommonFG.h | 141 | ||||
-rw-r--r-- | c++/src/H5CompType.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5Cpp.h | 6 | ||||
-rw-r--r-- | c++/src/H5DataSet.cpp | 4 | ||||
-rw-r--r-- | c++/src/H5DataType.cpp | 10 | ||||
-rw-r--r-- | c++/src/H5DataType.h | 4 | ||||
-rw-r--r-- | c++/src/H5DcreatProp.cpp | 3 | ||||
-rw-r--r-- | c++/src/H5EnumType.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5FloatType.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5Group.cpp | 92 | ||||
-rw-r--r-- | c++/src/H5Group.h | 50 | ||||
-rw-r--r-- | c++/src/H5IntType.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5Library.cpp | 1 | ||||
-rw-r--r-- | c++/src/H5Object.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5Object.h | 6 | ||||
-rw-r--r-- | c++/src/H5PredType.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5StrType.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5VarLenType.cpp | 3 |
23 files changed, 150 insertions, 211 deletions
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index a0ec0e8..79aaadf 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -20,6 +20,8 @@ #include "H5PropList.h" #include "H5Object.h" #include "H5AbstractDs.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5Alltypes.h" #ifndef H5_NO_NAMESPACE diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 041108c..ed69a8c 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -15,11 +15,12 @@ #include <string> #include "H5Include.h" -#include "H5RefCounter.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5ArrayType.h" diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index bb4c45a..b041d53 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -19,6 +19,8 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AtomType.h" diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index c1ddeea..bd77f22 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -26,6 +26,8 @@ #include "H5Object.h" #include "H5AbstractDs.h" #include "H5Attribute.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5DataSpace.h" diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 246becb..e3e7616 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -514,7 +514,7 @@ void CommonFG::unmount( const string& name ) const } //-------------------------------------------------------------------------- -// Function: CommonFG::p_openDataType (private) +// Function: CommonFG::p_open_data_type (private) // Purpose Opens the named datatype and returns the datatype's identifier. // Return Id of the datatype // Exception H5::FileIException or H5::GroupIException @@ -524,7 +524,7 @@ void CommonFG::unmount( const string& name ) const // datatypes. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -hid_t CommonFG::p_openDataType( const char* name ) const +hid_t CommonFG::p_open_data_type( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, // giving either the file or group id @@ -542,7 +542,7 @@ hid_t CommonFG::p_openDataType( const char* name ) const // // The following member functions use the private function -// p_openDataType to open a named datatype in this location +// p_open_data_type to open a named datatype in this location // //-------------------------------------------------------------------------- @@ -555,7 +555,7 @@ hid_t CommonFG::p_openDataType( const char* name ) const //-------------------------------------------------------------------------- DataType CommonFG::openDataType( const char* name ) const { - DataType data_type( p_openDataType( name )); + DataType data_type( p_open_data_type( name )); return( data_type ); } @@ -581,7 +581,7 @@ DataType CommonFG::openDataType( const string& name ) const //-------------------------------------------------------------------------- EnumType CommonFG::openEnumType( const char* name ) const { - EnumType enum_type( p_openDataType( name )); + EnumType enum_type( p_open_data_type( name )); return( enum_type ); } @@ -607,7 +607,7 @@ EnumType CommonFG::openEnumType( const string& name ) const //-------------------------------------------------------------------------- CompType CommonFG::openCompType( const char* name ) const { - CompType comp_type( p_openDataType( name )); + CompType comp_type( p_open_data_type( name )); return( comp_type ); } @@ -633,7 +633,7 @@ CompType CommonFG::openCompType( const string& name ) const //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const char* name ) const { - IntType int_type( p_openDataType( name )); + IntType int_type( p_open_data_type( name )); return( int_type ); } @@ -659,7 +659,7 @@ IntType CommonFG::openIntType( const string& name ) const //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const char* name ) const { - FloatType float_type( p_openDataType( name )); + FloatType float_type( p_open_data_type( name )); return( float_type ); } @@ -685,7 +685,7 @@ FloatType CommonFG::openFloatType( const string& name ) const //-------------------------------------------------------------------------- StrType CommonFG::openStrType( const char* name ) const { - StrType str_type( p_openDataType( name )); + StrType str_type( p_open_data_type( name )); return( str_type ); } diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index a4ab762..99ff874 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -29,101 +29,116 @@ class H5File; class H5_DLLCPP CommonFG { public: // Creates a new group at this location which can be a file or another group. - Group createGroup( const char* name, size_t size_hint = 0 ) const; - Group createGroup( const string& name, size_t size_hint = 0 ) const; + Group createGroup(const char* name, size_t size_hint = 0) const; + Group createGroup(const string& name, size_t size_hint = 0) const; - // Opens an existing group in a location which can be a file or another group - Group openGroup( const char* name ) const; - Group openGroup( const string& name ) const; + // Opens an existing group in a location which can be a file or another group. + Group openGroup(const char* name) const; + Group openGroup(const string& name) const; // Creates a new dataset at this location. - DataSet createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT ) const; - DataSet createDataSet( const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT ) const; + DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + DataSet createDataSet(const string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; // Opens an existing dataset at this location. - DataSet openDataSet( const char* name ) const; - DataSet openDataSet( const string& name ) const; - - // Creates a link of the specified type from new_name to current_name; - // both names are interpreted relative to the specified location id - void link( H5G_link_t link_type, const char* curr_name, const char* new_name ) const; - void link( H5G_link_t link_type, const string& curr_name, const string& new_name ) const; + DataSet openDataSet(const char* name) const; + DataSet openDataSet(const string& name) const; // Removes the specified name at this location. - void unlink( const char* name ) const; - void unlink( const string& name ) const; + void unlink(const char* name) const; + void unlink(const string& name) const; - // Get id of the location, either group or file - pure virtual so - // the subclass can get the correct id - virtual hid_t getLocId() const = 0; + // Retrieves comment for the HDF5 object specified by its name. + string getComment(const char* name, size_t bufsize) const; + string getComment(const string& name, size_t bufsize) const; - // Renames an object at this location. - void move( const char* src, const char* dst ) const; - void move( const string& src, const string& dst ) const; + // Sets the comment for an HDF5 object specified by its name. + void setComment(const char* name, const char* comment) const; + void setComment(const string& name, const string& comment) const; + + // Returns the name of the HDF5 object that the symbolic link points to. + string getLinkval(const char* name, size_t size) const; + string getLinkval(const string& name, size_t size) const; + + // Returns the number of objects in this group. + hsize_t getNumObjs() const; // Returns information about an HDF5 object, given by its name, // at this location. - void getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const; - void getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const; + void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; - // Returns the name of the HDF5 object that the symbolic link points to. - string getLinkval( const char* name, size_t size ) const; - string getLinkval( const string& name, size_t size ) const; + // Retrieves the name of an object in this group, given the + // object's index. + ssize_t getObjnameByIdx(hsize_t idx, string& name, size_t size) const; - // Sets the comment for an HDF5 object specified by its name - void setComment( const char* name, const char* comment ) const; - void setComment( const string& name, const string& comment ) const; + // Returns the type of an object in this group, given the + // object's index. + H5G_obj_t getObjTypeByIdx(hsize_t idx) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, string& type_name) const; - // Retrieves comment for the HDF5 object specified by its name - string getComment( const char* name, size_t bufsize ) const; - string getComment( const string& name, size_t bufsize ) const; + // Iterates over the elements of this group - not implemented in + // C++ style yet. + int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); + int iterateElems(const string& name, int *idx, H5G_iterate_t op, void *op_data); + + // Creates a link of the specified type from new_name to current_name; + // both names are interpreted relative to the specified location id. + void link(H5G_link_t link_type, const char* curr_name, const char* new_name) const; + void link(H5G_link_t link_type, const string& curr_name, const string& new_name) const; - // Mounts the file 'child' onto this location - void mount( const char* name, H5File& child, PropList& plist) const; - void mount( const string& name, H5File& child, PropList& plist ) const; + // Mounts the file 'child' onto this location. + void mount(const char* name, H5File& child, PropList& plist) const; + void mount(const string& name, H5File& child, PropList& plist) const; - // Unmounts the file named 'name' from this parent location - void unmount( const char* name ) const; - void unmount( const string& name ) const; + // Unmounts the file named 'name' from this parent location. + void unmount(const char* name) const; + void unmount(const string& name) const; - // Iterates over the elements of this group - not implemented in - // C++ style yet - int iterateElems( const char* name, int *idx, H5G_iterate_t op, void *op_data ); - int iterateElems( const string& name, int *idx, H5G_iterate_t op, void *op_data ); + // Renames an object at this location. + void move(const char* src, const char* dst) const; + void move(const string& src, const string& dst) const; + + // Opens a generic named datatype in this location. + DataType openDataType(const char* name) const; + DataType openDataType(const string& name) const; - // Opens a generic named datatype in this location - DataType openDataType( const char* name ) const; - DataType openDataType( const string& name ) const; + // Opens a named enumeration datatype in this location. + EnumType openEnumType(const char* name) const; + EnumType openEnumType(const string& name) const; - // Opens a named enumeration datatype in this location - EnumType openEnumType( const char* name ) const; - EnumType openEnumType( const string& name ) const; + // Opens a named compound datatype in this location. + CompType openCompType(const char* name) const; + CompType openCompType(const string& name) const; - // Opens a named compound datatype in this location - CompType openCompType( const char* name ) const; - CompType openCompType( const string& name ) const; + // Opens a named integer datatype in this location. + IntType openIntType(const char* name) const; + IntType openIntType(const string& name) const; - // Opens a named integer datatype in this location - IntType openIntType( const char* name ) const; - IntType openIntType( const string& name ) const; + // Opens a named floating-point datatype in this location. + FloatType openFloatType(const char* name) const; + FloatType openFloatType(const string& name) const; - // Opens a named floating-point datatype in this location - FloatType openFloatType( const char* name ) const; - FloatType openFloatType( const string& name ) const; + // Opens a named string datatype in this location. + StrType openStrType(const char* name) const; + StrType openStrType(const string& name) const; - // Opens a named string datatype in this location - StrType openStrType( const char* name ) const; - StrType openStrType( const string& name ) const; + /// For subclasses, H5File and Group, to return the correct + /// object id, i.e. file or group id. + virtual hid_t getLocId() const = 0; - // for H5File and Group to throw appropriate exception + /// For H5File and Group to throw appropriate exception. virtual void throwException(const string func_name, const string msg) const = 0; + // Default constructor. CommonFG(); + + // Noop destructor. virtual ~CommonFG(); private: // Common code for member functions openXxxType - hid_t p_openDataType( const char* name ) const; + hid_t p_open_data_type(const char* name) const; }; // end of CommonFG declaration diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 0115486..d0dbbc5 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -19,6 +19,8 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5Alltypes.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h index f3ef33c..e9f8585 100644 --- a/c++/src/H5Cpp.h +++ b/c++/src/H5Cpp.h @@ -24,8 +24,9 @@ #include "H5Object.h" #include "H5AbstractDs.h" #include "H5Attribute.h" -#include "H5DataType.h" #include "H5DcreatProp.h" +#include "H5CommonFG.h" +#include "H5DataType.h" #include "H5DxferProp.h" #include "H5FaccProp.h" #include "H5FcreatProp.h" @@ -36,8 +37,9 @@ #include "H5FloatType.h" #include "H5StrType.h" #include "H5CompType.h" +#include "H5ArrayType.h" +#include "H5VarLenType.h" #include "H5DataSet.h" -#include "H5CommonFG.h" #include "H5Group.h" #include "H5File.h" #include "H5Library.h" diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 1229647..1753c04 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -24,10 +24,10 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" -#include "H5PropList.h" #include "H5DxferProp.h" -#include "H5DataType.h" #include "H5DcreatProp.h" +#include "H5CommonFG.h" +#include "H5DataType.h" #include "H5DataSpace.h" #include "H5AbstractDs.h" #include "H5DataSet.h" diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index d0e22be..5bb8d6f 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -23,8 +23,10 @@ #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" -#include "H5Object.h" #include "H5DataSpace.h" +#include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AtomType.h" #include "H5PredType.h" @@ -164,9 +166,9 @@ bool DataType::operator==(const DataType& compared_type ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::commit( H5Object& loc, const char* name ) const +void DataType::commit(CommonFG& loc, const char* name) const { - hid_t loc_id = loc.getId(); // get location id for C API + hid_t loc_id = loc.getLocId(); // get location id for C API // Call C routine to commit the transient datatype herr_t ret_value = H5Tcommit( loc_id, name, id ); @@ -183,7 +185,7 @@ void DataType::commit( H5Object& loc, const char* name ) const /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::commit( H5Object& loc, const string& name ) const +void DataType::commit(CommonFG& loc, const string& name) const { commit( loc, name.c_str() ); } diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 0d08a42..fe56cb1 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -36,8 +36,8 @@ class H5_DLLCPP DataType : public H5Object { // Commits a transient datatype to a file; this datatype becomes // a named datatype which can be accessed from the location. - void commit( H5Object& loc, const string& name ) const; - void commit( H5Object& loc, const char* name ) const; + void commit( CommonFG& loc, const string& name ) const; + void commit( CommonFG& loc, const char* name ) const; // Determines whether this datatype is a named datatype or // a transient datatype. diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 2f031a6..f95b043 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -19,8 +19,9 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" -#include "H5DataType.h" #include "H5DcreatProp.h" +#include "H5CommonFG.h" +#include "H5DataType.h" #ifndef H5_NO_NAMESPACE namespace H5 { diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 94b6f9a..2872c22 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -22,6 +22,8 @@ #include "H5AbstractDs.h" #include "H5DxferProp.h" #include "H5DataSpace.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5DataSet.h" #include "H5AtomType.h" diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 80f9525..1912edb 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -19,6 +19,8 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 3476f73..a1eef70 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -76,95 +76,11 @@ hid_t Group::getLocId() const Group::Group( const hid_t group_id ) : H5Object( group_id ) {} //-------------------------------------------------------------------------- -// Function: Group::getNumObjs -///\brief Returns the number of objects in this group. -///\exception H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -hsize_t Group::getNumObjs() const -{ - hsize_t num_objs; - herr_t ret_value = H5Gget_num_objs(id, &num_objs); - if(ret_value < 0) - { - throwException("getNumObjs", "H5Gget_num_objs failed"); - } - return (num_objs); -} - -//-------------------------------------------------------------------------- -// Function: Group::getObjnameByIdx -///\brief Retrieves the name of an object in this group by giving the -/// object's index. -///\return Object name -///\exception H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -ssize_t Group::getObjnameByIdx(hsize_t idx, string& name, size_t size) const -{ - char* name_C = new char[size]; - ssize_t name_len = H5Gget_objname_by_idx(id, idx, name_C, size); - if(name_len < 0) - { - throwException("getObjnameByIdx", "H5Gget_objname_by_idx failed"); - } - name = string( name_C ); - delete [] name_C; - return (name_len); -} - -//-------------------------------------------------------------------------- -// Function: Group::getObjTypeByIdx -///\brief Returns the type of an object in this group by giving the -/// object's index. -///\return Object type -///\exception H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -int Group::getObjTypeByIdx(hsize_t idx) const -{ - int obj_type = H5Gget_objtype_by_idx(id, idx); - if (obj_type == H5G_UNKNOWN) - { - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); - } - return (obj_type); -} - -//-------------------------------------------------------------------------- -// Function: Group::getObjTypeByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function because it also provides -/// the returned object type in text. -///\param idx - IN: Index of the object -///\param type_name - IN: Object type in text -///\return Object type -///\exception H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -int Group::getObjTypeByIdx(hsize_t idx, string& type_name) const -{ - int obj_type = H5Gget_objtype_by_idx(id, idx); - switch (obj_type) - { - case H5G_GROUP: type_name = string("group"); break; - case H5G_DATASET: type_name = string("dataset"); break; - case H5G_TYPE: type_name = string("datatype"); break; - case H5G_UNKNOWN: - default: - { - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); - } - } - return (obj_type); -} - -//-------------------------------------------------------------------------- // Function: Group::Reference ///\brief Creates a reference to an HDF5 object or a dataset region. -///\param name - IN: Name of the object to be referenced +///\param name - IN: Name of the object to be referenced ///\param dataspace - IN: Dataspace with selection -///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION +///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION ///\return A reference ///\exception H5::ReferenceIException // Programmer Binh-Minh Ribler - May, 2004 @@ -196,8 +112,8 @@ void* Group::Reference(const char* name) const //-------------------------------------------------------------------------- // Function: Group::getObjType ///\brief Retrieves the type of object that an object reference points to. -///\param ref - IN: Reference to query -///\param ref_type - IN: Type of reference to query +///\param ref - IN: Reference to query +///\param ref_type - IN: Type of reference to query // Return An object type, which can be one of the following: // H5G_LINK Object is a symbolic link. // H5G_GROUP Object is a group. diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 9695c48..5935d49 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -22,52 +22,36 @@ namespace H5 { class H5_DLLCPP Group : public H5Object, public CommonFG { public: - // default constructor - Group(); - - // Copy constructor: makes a copy of the original object - Group( const Group& original ); - - // Returns the number of objects in the group. - hsize_t getNumObjs() const; - - // Retrieves the name of an object in a given group by giving index - //ssize_t getObjnameByIdx(hsize_t idx, char *name, size_t size) const; - ssize_t getObjnameByIdx(hsize_t idx, string& name, size_t size) const; - - // Returns the type of an object in a given group by giving index; - // the overloaded function also provided the object type in text as - // "group" for H5G_GROUP - // "dataset" for H5G_DATASET - // "datatype" for H5G_TYPE - int getObjTypeByIdx(hsize_t idx) const; - int getObjTypeByIdx(hsize_t idx, string& type_name) const; + // Retrieves the type of object that an object reference points to. + H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const; - // Creates a reference to a named Hdf5 object in this object. - void* Reference(const char* name) const; + // Retrieves a dataspace with the region pointed to selected. + DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; // Creates a reference to a named Hdf5 object or to a dataset region // in this object. void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; - // Retrieves the type of object that an object reference points to. - H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const; + // Creates a reference to a named Hdf5 object in this object. + void* Reference(const char* name) const; - // Retrieves a dataspace with the region pointed to selected. - DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; + // Throw group exception. + virtual void throwException(const string func_name, const string msg) const; - // for CommonFG to get the file id + // for CommonFG to get the file id. virtual hid_t getLocId() const; - // Throw group exception - virtual void throwException(const string func_name, const string msg) const; + // Default constructor + Group(); + + // Copy constructor: makes a copy of the original object. + Group(const Group& original); + // Destructor. virtual ~Group(); - // Creates a copy of an existing Group using its id - // (used only by template functions in FGtemplates.h - // to return a Group; will not be published; maybe, use friend???) - Group( const hid_t group_id ); + // Creates a copy of an existing Group using its id. + Group(const hid_t group_id); }; #ifndef H5_NO_NAMESPACE diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 47edf74..ba14de1 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -19,6 +19,8 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AbstractDs.h" #include "H5DxferProp.h" diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index a449dc2..872a04c 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -14,6 +14,7 @@ #include <string> +#include "H5CppDoc.h" // included only for Doxygen to generate part of RM #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 1d6fd95..127c315 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -19,6 +19,8 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5DataSpace.h" #include "H5AbstractDs.h" diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index b6577a2..d527250 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -74,11 +74,7 @@ class H5_DLLCPP H5Object : public IdComponent { void removeAttr( const char* name ) const; void removeAttr( const string& name ) const; - // Creates a reference to a named Hdf5 object in this object. - void* Reference(const char* name) const; - - // Creates a reference to a dataset region in this object. - void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; + // Noop destructor. virtual ~H5Object(); protected: diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index bea8b20..d80b531 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -19,6 +19,8 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AtomType.h" #include "H5Library.h" diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index e297e7e..942f72f 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -19,6 +19,8 @@ #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5AtomType.h" #include "H5AbstractDs.h" diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 45524f0..1cdf62e 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -15,11 +15,12 @@ #include <string> #include "H5Include.h" -#include "H5RefCounter.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5PropList.h" #include "H5Object.h" +#include "H5DcreatProp.h" +#include "H5CommonFG.h" #include "H5DataType.h" #include "H5VarLenType.h" |