summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Group.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2004-05-27 07:54:58 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2004-05-27 07:54:58 (GMT)
commit315ca49e4a04ce8874cac02d1cc4a6b7a45bd57c (patch)
tree2bba19f41db044afddcc261bc7bf800eb8790725 /c++/src/H5Group.cpp
parent23de8877a3025bb2f8751b312dfe5751b8b91074 (diff)
downloadhdf5-315ca49e4a04ce8874cac02d1cc4a6b7a45bd57c.zip
hdf5-315ca49e4a04ce8874cac02d1cc4a6b7a45bd57c.tar.gz
hdf5-315ca49e4a04ce8874cac02d1cc4a6b7a45bd57c.tar.bz2
[svn-r8588] Purpose:
Add C++ wrappers - incrementally check-in Description Added wrapper for these C APIs: H5Rcreate H5Rget_obj_type H5Rget_region This is an incremental check-in to preserve the code, corresponding tests will follow in a few weeks. Platforms: Linux 2.4 (eirene) I'm checking the code out and test on arabica too. Misc. update:
Diffstat (limited to 'c++/src/H5Group.cpp')
-rw-r--r--c++/src/H5Group.cpp80
1 files changed, 65 insertions, 15 deletions
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index 4530dba..dcc6aca 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -161,23 +161,40 @@ int Group::getObjTypeByIdx(hsize_t idx, string& type_name) const
return (obj_type);
}
-// Iterates a user's function over the entries of a group.
-//int Group::iterateElems( const string& name, int *idx, H5G_iterate_t op , void *op_data )
-//{
- //return( iterateElems( name.c_str(), idx, op, op_data ));
-//}
-//int Group::iterateElems( const char* name, int *idx, H5G_iterate_t op , void *op_data )
-//{
- //int ret_value = H5Giterate( id, name, idx, op, op_data );
- //if( ret_value >= 0 )
- //return( ret_value );
- //else // raise exception when H5Aiterate returns a negative value
- //{
- //throw GroupIException("Group::iterateElems", "H5Giterate failed");
- //}
-//}
+//--------------------------------------------------------------------------
+// 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 dataspace - IN: Dataspace with selection
+///\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
+//--------------------------------------------------------------------------
+void* Group::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
+{
+ return(p_reference(name, dataspace.getId(), ref_type));
+}
//--------------------------------------------------------------------------
+// Function: Group::Reference
+///\brief This is an overloaded function, provided for your convenience.
+/// It differs from the above function in that it only creates
+/// a reference to an HDF5 object, not to a dataset region.
+///\param name - IN: Name of the object to be referenced
+///\return A reference
+///\exception H5::ReferenceIException
+///\par Description
+// This function passes H5R_OBJECT and -1 to the protected
+// function for it to pass to the C API H5Rcreate
+// to create a reference to the named object.
+// Programmer Binh-Minh Ribler - May, 2004
+//--------------------------------------------------------------------------
+void* Group::Reference(const char* name) const
+{
+ return(p_reference(name, -1, H5R_OBJECT));
+}
+//--------------------------------------------------------------------------
// Function: Group::p_close (private)
///\brief Closes this group.
///\exception H5::GroupIException
@@ -196,6 +213,39 @@ void Group::p_close() 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
+// Return An object type, which can be one of the following:
+// H5G_LINK Object is a symbolic link.
+// H5G_GROUP Object is a group.
+// H5G_DATASET Object is a dataset.
+// H5G_TYPE Object is a named datatype
+// Exception H5::ReferenceIException
+// Programmer Binh-Minh Ribler - May, 2004
+//--------------------------------------------------------------------------
+H5G_obj_t Group::getObjType(void *ref, H5R_type_t ref_type) const
+{
+ return(p_get_obj_type(ref, ref_type));
+}
+
+//--------------------------------------------------------------------------
+// Function: Group::getRegion
+///\brief Retrieves a dataspace with the region pointed to selected.
+///\param ref - IN: Reference to get region of
+///\param ref_type - IN: Type of reference to get region of - default
+///\return DataSpace instance
+///\exception H5::ReferenceIException
+// Programmer Binh-Minh Ribler - May, 2004
+//--------------------------------------------------------------------------
+DataSpace Group::getRegion(void *ref, H5R_type_t ref_type) const
+{
+ DataSpace dataspace(p_get_region(ref, ref_type));
+ return(dataspace);
+}
+
+//--------------------------------------------------------------------------
// Function: Group::throwException
///\brief Throws group exception - initially implemented for CommonFG
///\param func_name - Name of the function where failure occurs