summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2004-07-16 05:30:03 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2004-07-16 05:30:03 (GMT)
commit5bc3314c9b3636025e60a0b2bd3a894ae9e33c84 (patch)
tree95d603798157bb61fc639b9a44b5f334c4f51037 /c++
parent909b3f6beaa5bec01c9bb223c6eacebbac470242 (diff)
downloadhdf5-5bc3314c9b3636025e60a0b2bd3a894ae9e33c84.zip
hdf5-5bc3314c9b3636025e60a0b2bd3a894ae9e33c84.tar.gz
hdf5-5bc3314c9b3636025e60a0b2bd3a894ae9e33c84.tar.bz2
[svn-r8890] Purpose: Code cleanup
Description: Renamed some private functions appropriately. Moved some functions from Group into the base class CommonFG for H5File to use too. Updated function headers as progressively reviewing the generated RM. Also, fixed a daily test failure on kelgia by adding #ifndef H5_NO_STD to H5IdComponent.h. I tried to test on kelgia before my checkin last time, but something was not right in my environment, and I wasn't able to test. I did test on three platforms though. Platforms tested: SunOS 5.7 (arabica) Linux 2.4 (eirene) Windows XP
Diffstat (limited to 'c++')
-rw-r--r--c++/src/H5AbstractDs.cpp28
-rw-r--r--c++/src/H5AbstractDs.h2
-rw-r--r--c++/src/H5Attribute.cpp4
-rw-r--r--c++/src/H5Attribute.h2
-rw-r--r--c++/src/H5CommonFG.cpp129
-rw-r--r--c++/src/H5CommonFG.h128
-rw-r--r--c++/src/H5CompType.cpp40
-rw-r--r--c++/src/H5CompType.h2
-rw-r--r--c++/src/H5DataSet.cpp2
-rw-r--r--c++/src/H5DataSet.h2
-rw-r--r--c++/src/H5DataSpace.h6
-rw-r--r--c++/src/H5DataType.h2
-rw-r--r--c++/src/H5Exception.cpp16
-rw-r--r--c++/src/H5Exception.h6
-rw-r--r--c++/src/H5File.cpp12
-rw-r--r--c++/src/H5Group.cpp84
-rw-r--r--c++/src/H5Group.h15
-rw-r--r--c++/src/H5IdComponent.h4
18 files changed, 249 insertions, 235 deletions
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index 57488b9..0968344 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -61,9 +61,9 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {}
H5T_class_t AbstractDs::getTypeClass() const
{
// Gets the datatype used by this dataset or attribute.
- // p_getType calls either H5Dget_type or H5Aget_type depending on
+ // p_get_type calls either H5Dget_type or H5Aget_type depending on
// which object invokes getTypeClass
- DataType datatype( p_getType());
+ DataType datatype(p_get_type());
// Gets the class of the datatype and validate it before returning
H5T_class_t type_class = H5Tget_class( datatype.getId());
@@ -87,9 +87,9 @@ H5T_class_t AbstractDs::getTypeClass() const
DataType AbstractDs::getDataType() const
{
// Gets the id of the datatype used by this dataset or attribute.
- // p_getType calls either H5Dget_type or H5Aget_type depending on
+ // p_get_type calls either H5Dget_type or H5Aget_type depending on
// which object invokes getTypeClass
- hid_t datatype_id = p_getType(); // returned value is already validated
+ hid_t datatype_id = p_get_type(); // returned value is already validated
// Create and return the DataType object
DataType datatype( datatype_id );
@@ -106,8 +106,8 @@ DataType AbstractDs::getDataType() const
//--------------------------------------------------------------------------
EnumType AbstractDs::getEnumType() const
{
- EnumType enumtype( p_getType());
- return( enumtype );
+ EnumType enumtype(p_get_type());
+ return(enumtype);
}
//--------------------------------------------------------------------------
@@ -120,8 +120,8 @@ EnumType AbstractDs::getEnumType() const
//--------------------------------------------------------------------------
CompType AbstractDs::getCompType() const
{
- CompType comptype( p_getType());
- return( comptype );
+ CompType comptype(p_get_type());
+ return(comptype);
}
//--------------------------------------------------------------------------
@@ -134,8 +134,8 @@ CompType AbstractDs::getCompType() const
//--------------------------------------------------------------------------
IntType AbstractDs::getIntType() const
{
- IntType inttype( p_getType());
- return( inttype );
+ IntType inttype(p_get_type());
+ return(inttype);
}
//--------------------------------------------------------------------------
@@ -148,8 +148,8 @@ IntType AbstractDs::getIntType() const
//--------------------------------------------------------------------------
FloatType AbstractDs::getFloatType() const
{
- FloatType floatype( p_getType());
- return( floatype );
+ FloatType floatype(p_get_type());
+ return(floatype);
}
//--------------------------------------------------------------------------
@@ -162,8 +162,8 @@ FloatType AbstractDs::getFloatType() const
//--------------------------------------------------------------------------
StrType AbstractDs::getStrType() const
{
- StrType strtype( p_getType());
- return( strtype );
+ StrType strtype(p_get_type());
+ return(strtype);
}
//--------------------------------------------------------------------------
diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h
index 12f873d..6e54588 100644
--- a/c++/src/H5AbstractDs.h
+++ b/c++/src/H5AbstractDs.h
@@ -61,7 +61,7 @@ class H5_DLLCPP AbstractDs : public H5Object {
private:
// This member function is implemented by DataSet and Attribute
- virtual hid_t p_getType() const = 0;
+ virtual hid_t p_get_type() const = 0;
// This member function is implemented by DataSet and Attribute
virtual void p_close() const = 0;
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index 60c541e..1e5e919 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -165,7 +165,7 @@ DataSpace Attribute::getSpace() const
}
//--------------------------------------------------------------------------
-// Function: Attribute::p_getType (private)
+// Function: Attribute::p_get_type (private)
// Purpose Gets the datatype of this attribute.
// Return Id of the datatype
// Exception H5::AttributeIException
@@ -173,7 +173,7 @@ DataSpace Attribute::getSpace() const
// This private function is used in AbstractDs.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-hid_t Attribute::p_getType() const
+hid_t Attribute::p_get_type() const
{
hid_t type_id = H5Aget_type( id );
if( type_id > 0 )
diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h
index a027fc3..8b06a8b 100644
--- a/c++/src/H5Attribute.h
+++ b/c++/src/H5Attribute.h
@@ -57,7 +57,7 @@ class H5_DLLCPP Attribute : public AbstractDs {
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// sub-types
- virtual hid_t p_getType() const;
+ virtual hid_t p_get_type() const;
// Default constructor
Attribute();
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp
index 3f739d0..ee3e299 100644
--- a/c++/src/H5CommonFG.cpp
+++ b/c++/src/H5CommonFG.cpp
@@ -515,7 +515,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
@@ -525,7 +525,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
@@ -543,7 +543,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
//
//--------------------------------------------------------------------------
@@ -556,7 +556,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 );
}
@@ -582,8 +582,8 @@ DataType CommonFG::openDataType( const string& name ) const
//--------------------------------------------------------------------------
EnumType CommonFG::openEnumType( const char* name ) const
{
- EnumType enum_type( p_openDataType( name ));
- return( enum_type );
+ EnumType enum_type(p_open_data_type(name));
+ return(enum_type);
}
//--------------------------------------------------------------------------
@@ -608,8 +608,8 @@ EnumType CommonFG::openEnumType( const string& name ) const
//--------------------------------------------------------------------------
CompType CommonFG::openCompType( const char* name ) const
{
- CompType comp_type( p_openDataType( name ));
- return( comp_type );
+ CompType comp_type(p_open_data_type(name));
+ return(comp_type);
}
//--------------------------------------------------------------------------
@@ -634,8 +634,8 @@ CompType CommonFG::openCompType( const string& name ) const
//--------------------------------------------------------------------------
IntType CommonFG::openIntType( const char* name ) const
{
- IntType int_type( p_openDataType( name ));
- return( int_type );
+ IntType int_type(p_open_data_type(name));
+ return(int_type);
}
//--------------------------------------------------------------------------
@@ -660,8 +660,8 @@ IntType CommonFG::openIntType( const string& name ) const
//--------------------------------------------------------------------------
FloatType CommonFG::openFloatType( const char* name ) const
{
- FloatType float_type( p_openDataType( name ));
- return( float_type );
+ FloatType float_type(p_open_data_type(name));
+ return(float_type);
}
//--------------------------------------------------------------------------
@@ -686,8 +686,8 @@ FloatType CommonFG::openFloatType( const string& name ) const
//--------------------------------------------------------------------------
StrType CommonFG::openStrType( const char* name ) const
{
- StrType str_type( p_openDataType( name ));
- return( str_type );
+ StrType str_type(p_open_data_type(name));
+ return(str_type);
}
//--------------------------------------------------------------------------
@@ -705,9 +705,9 @@ StrType CommonFG::openStrType( const string& name ) const
//--------------------------------------------------------------------------
// Function: CommonFG::iterateElems
///\brief Iterates a user's function over the entries of a group.
-///\param name - IN: Name of group to iterate over
-///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices
-///\param op - IN: User's function to operate on each entry
+///\param name - IN : Name of group to iterate over
+///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices
+///\param op - IN : User's function to operate on each entry
///\param op_data - IN/OUT: Data associated with the operation
///\return The return value of the first operator that returns non-zero,
/// or zero if all members were processed with no operator
@@ -738,6 +738,101 @@ int CommonFG::iterateElems( const string& name, int *idx, H5G_iterate_t op , voi
}
//--------------------------------------------------------------------------
+// Function: CommonFG::getNumObjs
+///\brief Returns the number of objects in this group.
+///\return Number of objects
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - January, 2003
+//--------------------------------------------------------------------------
+hsize_t CommonFG::getNumObjs() const
+{
+ hsize_t num_objs;
+ herr_t ret_value = H5Gget_num_objs(getLocId(), &num_objs);
+ if(ret_value < 0)
+ {
+ throwException("getNumObjs", "H5Gget_num_objs failed");
+ }
+ return (num_objs);
+}
+
+//--------------------------------------------------------------------------
+// Function: CommonFG::getObjnameByIdx
+///\brief Retrieves the name of an object in this group by giving the
+/// object's index.
+///\param idx - IN: Transient index of the object
+///\param name - IN/OUT: Retrieved name of the object
+///\param size - IN: Length to retrieve
+///\return Actual size of the object name or 0, if object has no name
+///\exception H5::FileIException or H5::GroupIException
+///\par Description
+/// The value of idx can be any nonnegative number less than the
+/// total number of objects in the group, which is returned by
+/// the function \c CommonFG::getNumObjs. Note that this is a
+/// transient index; thus, an object may have a different index
+/// each time the group is opened.
+// Programmer Binh-Minh Ribler - January, 2003
+//--------------------------------------------------------------------------
+ssize_t CommonFG::getObjnameByIdx(hsize_t idx, string& name, size_t size) const
+{
+ char* name_C = new char[size];
+ ssize_t name_len = H5Gget_objname_by_idx(getLocId(), 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: CommonFG::getObjTypeByIdx
+///\brief Returns the type of an object in this group by giving the
+/// object's index.
+///\param idx - IN: Transient index of the object
+///\return Object type
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - January, 2003
+//--------------------------------------------------------------------------
+H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const
+{
+ H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx);
+ if (obj_type == H5G_UNKNOWN)
+ {
+ throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
+ }
+ return (obj_type);
+}
+
+//--------------------------------------------------------------------------
+// Function: CommonFG::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: Transient index of the object
+///\param type_name - IN: Object type in text
+///\return Object type
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - January, 2003
+//--------------------------------------------------------------------------
+H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, string& type_name) const
+{
+ H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx);
+ switch (obj_type)
+ {
+ case H5G_LINK: type_name = string("symbolic link"); break;
+ 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: CommonFG default constructor
///\brief Default constructor.
// Programmer Binh-Minh Ribler - 2000
diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h
index 0d20d77..eb14c61 100644
--- a/c++/src/H5CommonFG.h
+++ b/c++/src/H5CommonFG.h
@@ -29,101 +29,115 @@ 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 string& name, size_t size_hint = 0 ) const;
- Group createGroup( const char* 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 string& name ) const;
- Group openGroup( const char* 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 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 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 string& name ) const;
- DataSet openDataSet( const char* name ) const;
+ 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 string& curr_name, const string& new_name ) const;
- void link( H5G_link_t link_type, const char* curr_name, const char* new_name ) const;
+ // 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;
// Removes the specified name at this location.
- void unlink( const string& name ) const;
- void unlink( const char* 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
+ /// For subclasses to get the correct object id, i.e. file or group id.
virtual hid_t getLocId() const = 0;
// Renames an object at this location.
- void move( const string& src, const string& dst ) const;
- void move( const char* src, const char* dst ) const;
+ void move(const char* src, const char* dst) const;
+ void move(const string& src, const string& dst) const;
// Returns information about an HDF5 object, given by its name,
// at this location.
- 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 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 string& name, size_t size ) const;
- string getLinkval( const char* name, size_t size ) const;
+ string getLinkval(const char* name, size_t size) const;
+ string getLinkval(const string& name, size_t size) const;
- // Sets the comment for an HDF5 object specified by its name
- void setComment( const string& name, const string& comment ) const;
- void setComment( const char* name, const char* comment ) 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;
- // Retrieves comment for the HDF5 object specified by its name
- string getComment( const string& name, size_t bufsize ) const;
- string getComment( const char* name, size_t bufsize ) 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;
- // Mounts the file 'child' onto this location
- void mount( const string& name, H5File& child, PropList& plist ) const;
- void mount( const char* 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 string& name ) const;
- void unmount( const char* 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 string& name, int *idx, H5G_iterate_t op, void *op_data );
- int iterateElems( const char* name, int *idx, H5G_iterate_t op, void *op_data );
+ // 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);
- // Opens a generic named datatype in this location
- DataType openDataType( const string& name ) const;
- DataType openDataType( const char* 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 string& name ) const;
- EnumType openEnumType( const char* 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 string& name ) const;
- CompType openCompType( const char* 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 string& name ) const;
- IntType openIntType( const char* 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 string& name ) const;
- FloatType openFloatType( const char* 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 string& name ) const;
- StrType openStrType( const char* name ) const;
+ // Opens a named string datatype in this location.
+ StrType openStrType(const char* name) const;
+ StrType openStrType(const string& name) const;
- // for H5File and Group to throw appropriate exception
+ // Returns the number of objects in this group.
+ hsize_t CommonFG::getNumObjs() const;
+
+ // Retrieves the name of an object in this group by giving the
+ // object's index.
+ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, string& name, size_t size) const;
+
+ // Returns the type of an object in this group by giving the
+ // object's index.
+ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const;
+ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, string& type_name) const;
+
+ /// 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 394ce18..72341f4 100644
--- a/c++/src/H5CompType.cpp
+++ b/c++/src/H5CompType.cpp
@@ -216,7 +216,7 @@ H5T_class_t CompType::getMemberClass( int member_num ) const
// of the specified member. It provides the id to construct appropriate
// sub-types in the functions getMemberXxxType below, where Xxx indicates
// the sub-types.
-hid_t CompType::p_getMemberType( int member_num ) const
+hid_t CompType::p_get_member_type(int member_num) const
{
// get the id of the specified member first
hid_t member_type_id = H5Tget_member_type( id, member_num );
@@ -224,7 +224,7 @@ hid_t CompType::p_getMemberType( int member_num ) const
return( member_type_id );
else
{
- // p_getMemberType is private, use caller's function name for api
+ // p_get_member_type is private, use caller's function name for api
throw DataTypeIException("CompType::getMemberDataType",
"H5Tget_member_type failed");
}
@@ -241,8 +241,8 @@ hid_t CompType::p_getMemberType( int member_num ) const
//--------------------------------------------------------------------------
DataType CompType::getMemberDataType( int member_num ) const
{
- DataType datatype( p_getMemberType( member_num ));
- return( datatype );
+ DataType datatype(p_get_member_type(member_num));
+ return(datatype);
}
//--------------------------------------------------------------------------
@@ -256,8 +256,8 @@ DataType CompType::getMemberDataType( int member_num ) const
//--------------------------------------------------------------------------
EnumType CompType::getMemberEnumType( int member_num ) const
{
- EnumType enumtype( p_getMemberType( member_num ));
- return( enumtype );
+ EnumType enumtype(p_get_member_type(member_num));
+ return(enumtype);
}
//--------------------------------------------------------------------------
@@ -271,8 +271,8 @@ EnumType CompType::getMemberEnumType( int member_num ) const
//--------------------------------------------------------------------------
CompType CompType::getMemberCompType( int member_num ) const
{
- CompType comptype( p_getMemberType( member_num ));
- return( comptype );
+ CompType comptype(p_get_member_type(member_num));
+ return(comptype);
}
//--------------------------------------------------------------------------
@@ -286,8 +286,8 @@ CompType CompType::getMemberCompType( int member_num ) const
//--------------------------------------------------------------------------
IntType CompType::getMemberIntType( int member_num ) const
{
- IntType inttype( p_getMemberType( member_num ));
- return( inttype );
+ IntType inttype(p_get_member_type(member_num));
+ return(inttype);
}
//--------------------------------------------------------------------------
@@ -301,8 +301,8 @@ IntType CompType::getMemberIntType( int member_num ) const
//--------------------------------------------------------------------------
FloatType CompType::getMemberFloatType( int member_num ) const
{
- FloatType floatype( p_getMemberType( member_num ));
- return( floatype );
+ FloatType floatype(p_get_member_type(member_num));
+ return(floatype);
}
//--------------------------------------------------------------------------
@@ -316,9 +316,9 @@ FloatType CompType::getMemberFloatType( int member_num ) const
//--------------------------------------------------------------------------
StrType CompType::getMemberStrType( int member_num ) const
{
- StrType strtype( p_getMemberType( member_num ));
- return( strtype );
-}
+ StrType strtype(p_get_member_type(member_num));
+ return(strtype);
+}
/* old style of getMemberType - using overloads; new style above
returns the appropriate datatypes but has different named functions.
@@ -328,27 +328,27 @@ StrType CompType::getMemberStrType( int member_num ) const
// Several overloading of getMemberType are for different datatypes
void CompType::getMemberType( int member_num, EnumType& enumtype ) const
{
- p_getMemberType( member_num, enumtype );
+ p_get_member_type(member_num, enumtype);
}
void CompType::getMemberType( int member_num, CompType& comptype ) const
{
- p_getMemberType( member_num, comptype );
+ p_get_member_type(member_num, comptype);
}
void CompType::getMemberType( int member_num, IntType& inttype ) const
{
- p_getMemberType( member_num, inttype );
+ p_get_member_type(member_num, inttype);
}
void CompType::getMemberType( int member_num, FloatType& floatype ) const
{
- p_getMemberType( member_num, floatype );
+ p_get_member_type(member_num, floatype);
}
void CompType::getMemberType( int member_num, StrType& strtype ) const
{
- p_getMemberType( member_num, strtype );
+ p_get_member_type(member_num, strtype);
}
// end of overloading of getMemberType
*/
diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h
index 02c83f1..fa104f0 100644
--- a/c++/src/H5CompType.h
+++ b/c++/src/H5CompType.h
@@ -96,7 +96,7 @@ class H5_DLLCPP CompType : public DataType {
private:
// Contains common code that is used by the member functions
// getMemberXxxType
- hid_t p_getMemberType( int member_num ) const;
+ hid_t p_get_member_type(int member_num) const;
};
#ifndef H5_NO_NAMESPACE
}
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 254138e..5b38621 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -87,7 +87,7 @@ DataSpace DataSet::getSpace() const
// This private member function calls the C API to get the identifier
// of the datatype that is used by this dataset. It is used
// by the various AbstractDs functions to get the specific datatype.
-hid_t DataSet::p_getType() const
+hid_t DataSet::p_get_type() const
{
hid_t type_id = H5Dget_type( id );
if( type_id > 0 )
diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h
index 6960757..c12a539 100644
--- a/c++/src/H5DataSet.h
+++ b/c++/src/H5DataSet.h
@@ -98,7 +98,7 @@ class H5_DLLCPP DataSet : public AbstractDs {
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// sub-types
- virtual hid_t p_getType() const;
+ virtual hid_t p_get_type() const;
};
#ifndef H5_NO_NAMESPACE
}
diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h
index 87b5a81..4378f40 100644
--- a/c++/src/H5DataSpace.h
+++ b/c++/src/H5DataSpace.h
@@ -26,13 +26,13 @@ class H5_DLLCPP DataSpace : public IdComponent {
static const DataSpace ALL;
// Creates a dataspace object given the space type
- DataSpace( H5S_class_t type ); // H5Screate
+ DataSpace(H5S_class_t type);
// Creates a simple dataspace
- DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); // H5Screate_simple
+ DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL);
// Makes copy of an existing dataspace.
- void copy( const DataSpace& like_space ); // H5Scopy
+ void copy(const DataSpace& like_space);
// Assignment operator
DataSpace& operator=( const DataSpace& rhs );
diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h
index fa288d7..d0141f8 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( CommonFG& loc, const string& name ) const;
void commit( CommonFG& loc, const char* name ) const;
+ void commit( CommonFG& loc, const string& name ) const;
// Determines whether this datatype is a named datatype or
// a transient datatype.
diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp
index 20c54aa..196205c 100644
--- a/c++/src/H5Exception.cpp
+++ b/c++/src/H5Exception.cpp
@@ -29,7 +29,7 @@ const string Exception::DEFAULT_MSG("No detailed information provided");
///\brief Default constructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Exception::Exception() : detailMessage(""), funcName("") {}
+Exception::Exception() : detail_message(""), func_name("") {}
//--------------------------------------------------------------------------
// Function: Exception overloaded constructor
@@ -40,7 +40,7 @@ Exception::Exception() : detailMessage(""), funcName("") {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Exception::Exception(const string func_name, const string message) : detailMessage(message), funcName(func_name) {}
+Exception::Exception(const string func_name, const string message) : detail_message(message), func_name(func_name) {}
//--------------------------------------------------------------------------
// Function: Exception copy constructor
@@ -50,8 +50,8 @@ Exception::Exception(const string func_name, const string message) : detailMessa
//--------------------------------------------------------------------------
Exception::Exception( const Exception& orig )
{
- detailMessage = orig.detailMessage;
- funcName = orig.funcName;
+ detail_message = orig.detail_message;
+ func_name = orig.func_name;
}
//--------------------------------------------------------------------------
@@ -227,7 +227,7 @@ void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk_t func, void
//--------------------------------------------------------------------------
string Exception::getDetailMsg() const
{
- return(detailMessage);
+ return(detail_message);
}
//--------------------------------------------------------------------------
@@ -239,7 +239,7 @@ string Exception::getDetailMsg() const
//--------------------------------------------------------------------------
const char* Exception::getCDetailMsg() const
{
- return(detailMessage.c_str());
+ return(detail_message.c_str());
}
//--------------------------------------------------------------------------
@@ -250,7 +250,7 @@ const char* Exception::getCDetailMsg() const
//--------------------------------------------------------------------------
string Exception::getFuncName() const
{
- return(funcName);
+ return(func_name);
}
//--------------------------------------------------------------------------
@@ -261,7 +261,7 @@ string Exception::getFuncName() const
//--------------------------------------------------------------------------
const char* Exception::getCFuncName() const
{
- return(funcName.c_str());
+ return(func_name.c_str());
}
//--------------------------------------------------------------------------
diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h
index 28e01f9..8f6f1c9 100644
--- a/c++/src/H5Exception.h
+++ b/c++/src/H5Exception.h
@@ -82,11 +82,11 @@ class H5_DLLCPP Exception {
#if defined(WIN32)
#pragma warning(disable: 4251)
#endif
- string detailMessage;
- string funcName;
+ string detail_message;
+ string func_name;
protected:
- // Default value for detailMessage
+ // Default value for detail_message
static const string DEFAULT_MSG;
};
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index 3962fc3..79ddf93 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -455,13 +455,13 @@ void* H5File::Reference(const char* name) const
//--------------------------------------------------------------------------
// Function: H5File::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 Object type, which can be one of the following:
-/// \li \c H5G_LINK Object is a symbolic link.
-/// \li \c H5G_GROUP Object is a group.
-/// \li \c H5G_DATASET Object is a dataset.
-/// \li \c H5G_TYPE Object is a named datatype
+/// \li \c H5G_LINK - Object is a symbolic link.
+/// \li \c H5G_GROUP - Object is a group.
+/// \li \c H5G_DATASET - Object is a dataset.
+/// \li \c H5G_TYPE - Object is a named datatype
///\exception H5::ReferenceIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index bb1011f..8827630 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -77,90 +77,6 @@ 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
diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h
index 65119dd..df299c3 100644
--- a/c++/src/H5Group.h
+++ b/c++/src/H5Group.h
@@ -28,21 +28,6 @@ class H5_DLLCPP Group : public H5Object, public CommonFG {
// 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;
-
// Creates a reference to a named Hdf5 object in this object.
void* Reference(const char* name) const;
diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h
index 73305ef..12dc97f 100644
--- a/c++/src/H5IdComponent.h
+++ b/c++/src/H5IdComponent.h
@@ -73,7 +73,11 @@ class H5_DLLCPP IdComponent {
IdComponent();
// Gets the name of the file, in which an HDF5 object belongs.
+#ifndef H5_NO_STD
std::string p_get_file_name() const;
+#else
+ string p_get_file_name() const;
+#endif // H5_NO_STD
// Gets the id of the H5 file in which the given object is located.
hid_t p_get_file_id();