diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-21 05:40:57 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-21 05:40:57 (GMT) |
commit | 4f37cdcd36adb1bafcdf9af49b611180a64d157b (patch) | |
tree | 9111eecc09e15c8b70dd830ce23797d0e5bf0abf /c++/src/H5Object.cpp | |
parent | dd0a040ec807912b80a9f1779fbf46c65d01cd57 (diff) | |
download | hdf5-4f37cdcd36adb1bafcdf9af49b611180a64d157b.zip hdf5-4f37cdcd36adb1bafcdf9af49b611180a64d157b.tar.gz hdf5-4f37cdcd36adb1bafcdf9af49b611180a64d157b.tar.bz2 |
Code improvement
Description:
Moved the new H5Object::getInfo member functions to H5Location and
made them overloaded with the existing H5Location::getObjinfo. This
way is cleaner than the previous approach.
Platforms tested:
Linux/64 (jelly)
Linux/32 (jam)
Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5Object.cpp')
-rw-r--r-- | c++/src/H5Object.cpp | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index a33acb3..b95e222 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -227,130 +227,6 @@ int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_dat } //-------------------------------------------------------------------------- -// Function: H5Object::getInfo -///\brief Retrieves information about an HDF5 object. -///\param objinfo - OUT: Struct containing the object info -///\param fields - IN: Indicates the group of information to be retrieved -///\par Description -/// Valid values of \a fields are as follows: -/// \li \c H5O_INFO_BASIC (default) -/// \li \c H5O_INFO_TIME -/// \li \c H5O_INFO_NUM_ATTRS -/// \li \c H5O_INFO_HDR -/// \li \c H5O_INFO_META_SIZE -/// \li \c H5O_INFO_ALL -// July, 2018 -//-------------------------------------------------------------------------- -void H5Object::getInfo(H5O_info_t& objinfo, unsigned fields) const -{ - - // Use C API to get information of the object - herr_t ret_value = H5Oget_info2(getId(), &objinfo, fields); - - // Throw exception if C API returns failure - if (ret_value < 0) - throwException(inMemFunc("getInfo"), "H5Oget_info2 failed"); -} - -//-------------------------------------------------------------------------- -// Function: H5Object::getInfo -///\brief Retrieves information about an HDF5 object given its name. -///\param name - IN: Name of the object to be queried - \c char * -///\param objinfo - OUT: Struct containing the object info -///\param fields - IN: Indicates the group of information to be retrieved -/// - default to H5O_INFO_BASIC -///\param lapl - IN: Link access property list -///\par Description -/// Valid values of \a fields are as follows: -/// \li \c H5O_INFO_BASIC (default) -/// \li \c H5O_INFO_TIME -/// \li \c H5O_INFO_NUM_ATTRS -/// \li \c H5O_INFO_HDR -/// \li \c H5O_INFO_META_SIZE -/// \li \c H5O_INFO_ALL -// July, 2018 -//-------------------------------------------------------------------------- -void H5Object::getInfo(const char* name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const -{ - // Use C API to get information of the object - herr_t ret_value = H5Oget_info_by_name2(getId(), name, &objinfo, fields, lapl.getId()); - - // Throw exception if C API returns failure - if (ret_value < 0) - throwException(inMemFunc("getInfo"), "H5Oget_info_by_name2 failed"); -} - -//-------------------------------------------------------------------------- -// Function: H5Object::getInfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -///\param name - IN: Name of the object to be queried - \c H5std_string -///\param objinfo - OUT: Struct containing the object info -///\param fields - IN: Indicates the group of information to be retrieved -/// - default to H5O_INFO_BASIC -///\param lapl - IN: Link access property list -// July, 2018 -//-------------------------------------------------------------------------- -void H5Object::getInfo(const H5std_string& name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const -{ - getInfo(name.c_str(), objinfo, fields, lapl); -} - -//-------------------------------------------------------------------------- -// Function: H5Object::getInfo -///\brief Retrieves information about an HDF5 object given its index. -///\param grp_name - IN: Group name where the object belongs - \c char * -///\param idx_type - IN: Type of index -///\param order - IN: Order to traverse -///\param idx - IN: Object position -///\param objinfo - OUT: Struct containing the object info -///\param fields - IN: Indicates the group of information to be retrieved -/// - default to H5O_INFO_BASIC -///\param lapl - IN: Link access property list -///\par Description -/// Valid values of \a fields are as follows: -/// \li \c H5O_INFO_BASIC (default) -/// \li \c H5O_INFO_TIME -/// \li \c H5O_INFO_NUM_ATTRS -/// \li \c H5O_INFO_HDR -/// \li \c H5O_INFO_META_SIZE -/// \li \c H5O_INFO_ALL -// July, 2018 -//-------------------------------------------------------------------------- -void H5Object::getInfo(const char* grp_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields, - const LinkAccPropList& lapl) const -{ - // Use C API to get information of the object - herr_t ret_value = H5Oget_info_by_idx2(getId(), grp_name, idx_type, order, - idx, &objinfo, fields, lapl.getId()); - - // Throw exception if C API returns failure - if (ret_value < 0) - throwException(inMemFunc("getInfo"), "H5Oget_info_by_idx2 failed"); -} - -//-------------------------------------------------------------------------- -// Function: H5Object::getInfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -///\param name - IN: Name of the object to be queried - \c H5std_string -///\param objinfo - OUT: Struct containing the object info -///\param fields - IN: Indicates a group of information to be retrieved -/// - default to H5O_INFO_BASIC -///\param lapl - IN: Link access property list -// July, 2018 -//-------------------------------------------------------------------------- -void H5Object::getInfo(const H5std_string& grp_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields, - const LinkAccPropList& lapl) const -{ - getInfo(grp_name.c_str(), idx_type, order, idx, objinfo, fields, lapl); -} - -//-------------------------------------------------------------------------- // Function: H5Object::objVersion ///\brief Returns the header version of this HDF5 object. ///\return Object version, which can have the following values: |