summaryrefslogtreecommitdiffstats
path: root/c++/src/H5IdComponent.h
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2005-08-08 03:53:58 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2005-08-08 03:53:58 (GMT)
commit07592ad7c32fe5ed0b947a7a6a4ee3aef58173ab (patch)
treea9439aefae26c6a9897e1190095079e32e891fb5 /c++/src/H5IdComponent.h
parente49bb1feeaa3e2c18a2bd38ff5a5ef3142b5f9b1 (diff)
downloadhdf5-07592ad7c32fe5ed0b947a7a6a4ee3aef58173ab.zip
hdf5-07592ad7c32fe5ed0b947a7a6a4ee3aef58173ab.tar.gz
hdf5-07592ad7c32fe5ed0b947a7a6a4ee3aef58173ab.tar.bz2
[svn-r11206] Purpose: Additional wrapper/Code improvement
Description: Added wrapper for H5Iget_type. Added try/catch to many APIs that call private functions so that more specific information can be provided at failure. Added IdComponent::inMemFunc to help providing specific info. Added const to parameters of several functions that missed that. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) AIX 5.1 (copper) IRIX64 with -n32 (modi4) HPUX 11.00 (kelgia)
Diffstat (limited to 'c++/src/H5IdComponent.h')
-rw-r--r--c++/src/H5IdComponent.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h
index e50eb2a..33fa7d2 100644
--- a/c++/src/H5IdComponent.h
+++ b/c++/src/H5IdComponent.h
@@ -25,24 +25,25 @@ namespace H5 {
class H5_DLLCPP IdComponent {
public:
// Increment reference counter.
- void incRefCount(hid_t obj_id) const;
+ void incRefCount(const hid_t obj_id) const;
void incRefCount() const;
// Decrement reference counter.
- void decRefCount(hid_t obj_id) const;
+ void decRefCount(const hid_t obj_id) const;
void decRefCount() const;
// Get the reference counter to this identifier.
- int getCounter(hid_t obj_id) const;
+ int getCounter(const hid_t obj_id) const;
int getCounter() const;
+ // Returns an HDF object type, given the object id.
+ static H5I_type_t getHDFObjType(const hid_t obj_id);
+
// Assignment operator.
IdComponent& operator=( const IdComponent& rhs );
- //void reset();
-
// Sets the identifier of this object to a new value.
- void setId( hid_t new_id );
+ void setId(const hid_t new_id);
// Creates an object to hold an HDF5 identifier.
IdComponent( const hid_t h5_id );
@@ -57,6 +58,14 @@ class H5_DLLCPP IdComponent {
// Pure virtual function for there are various H5*close for the
// subclasses.
virtual void close() = 0;
+
+ // Makes and returns the string "<class-name>::<func_name>";
+ // <class-name> is returned by fromClass().
+ string inMemFunc(const char* func_name) const;
+
+ // Returns this class name.
+ virtual string fromClass() const {return ("IdComponent");}
+
#endif // DOXYGEN_SHOULD_SKIP_THIS
// Destructor
@@ -89,7 +98,7 @@ class H5_DLLCPP IdComponent {
hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
// Verifies that the given id is valid.
- bool p_valid_id(hid_t obj_id) const;
+ bool p_valid_id(const hid_t obj_id) const;
#endif // DOXYGEN_SHOULD_SKIP_THIS