[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:
This commit is contained in:
Binh-Minh Ribler
2004-05-27 02:54:58 -05:00
parent 23de8877a3
commit 315ca49e4a
10 changed files with 433 additions and 70 deletions

View File

@@ -410,6 +410,74 @@ void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space)
}
}
//--------------------------------------------------------------------------
// Function: DataSet::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* DataSet::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
{
return(p_reference(name, dataspace.getId(), ref_type));
}
//--------------------------------------------------------------------------
// Function: DataSet::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* DataSet::Reference(const char* name) const
{
return(p_reference(name, -1, H5R_OBJECT));
}
//--------------------------------------------------------------------------
// Function: DataSet::getObjType
///\brief Retrieves the type of object that an object reference points to.
///\param ref_type - IN: Type of reference to query
///\param ref - IN: 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 DataSet::getObjType(void *ref, H5R_type_t ref_type) const
{
return(p_get_obj_type(ref, ref_type));
}
//--------------------------------------------------------------------------
// Function: DataSet::getRegion
///\brief Retrieves a dataspace with the region pointed to selected.
///\param ref_type - IN: Type of reference to get region of - default
/// to H5R_DATASET_REGION
///\param ref - IN: Reference to get region of
///\return DataSpace instance
///\exception H5::ReferenceIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
DataSpace DataSet::getRegion(void *ref, H5R_type_t ref_type) const
{
DataSpace dataspace(p_get_region(ref, ref_type));
return(dataspace);
}
//--------------------------------------------------------------------------
// Function: DataSet::p_close (private)
///\brief Closes this dataset.