diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2017-12-01 18:41:26 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2017-12-01 18:41:26 (GMT) |
commit | b8c6b68c35fa2be23ef488a1d81097ff3ed55000 (patch) | |
tree | c3429ee577e454526c8704d66a84f0c45b7959a1 /c++/src/H5Location.cpp | |
parent | 23a702e7bad93fc4f14eab07678c75d276e2d0ad (diff) | |
parent | 60f76980aab92f0e0730170b99a2363acd3c97fa (diff) | |
download | hdf5-hdf5-1_8_20.zip hdf5-hdf5-1_8_20.tar.gz hdf5-hdf5-1_8_20.tar.bz2 |
Merge pull request #811 in HDFFV/hdf5 from hdf5_1_8_20 to 1.8/masterhdf5-1_8_20
* commit '60f76980aab92f0e0730170b99a2363acd3c97fa': (108 commits)
Update version numbers and remove empty sections in RELEASE.txt.
Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES.
Update version for 1.8.20 release.
Fixed documentation warnings
HDFFV-10329 Correct LINK INTERFACE and VS20013 compile
Switch default build mode from development to production. Increment version string to pre2.
Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797)
Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0)
Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af)
Fix linking of libs
Changed file path to relative.
iAdd NAG to supported compilers in RELEASE.txt.
Add description to RELEASE.txt for HDFFV-10323
Correct issue number
Set version to 1.8.20-pre1
Update supported and tested platforms in RELEASE.txt.
HDFFV-10321 Merge from 1.8
Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed.
updated issues related to Fortran
Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed.
...
Diffstat (limited to 'c++/src/H5Location.cpp')
-rw-r--r-- | c++/src/H5Location.cpp | 130 |
1 files changed, 98 insertions, 32 deletions
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 3af9d10..afeaca7 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -87,7 +87,7 @@ H5Location::H5Location() : IdComponent() {} Notes for H5A wrappers ====================== May, 2017 (1.8.19) - These H5A wrappers are copied from H5Object to prevent an attribute + These H5A wrappers are copied to H5Object to prevent an attribute id being passed in to H5A APIs. The original H5A wrapper functions here will be deprecated in future releases. @@ -95,7 +95,8 @@ May, 2017 (1.8.19) //-------------------------------------------------------------------------- // Function: H5Location::createAttribute -///\brief Deprecated - Creates an attribute for a group, dataset, or named datatype. +///\brief Deprecated - replaced by H5Object::createAttribute +// brief Creates an attribute for a group, dataset, or named datatype. ///\param name - IN: Name of the attribute ///\param data_type - IN: Datatype for the attribute ///\param data_space - IN: Dataspace for the attribute - only simple @@ -134,7 +135,8 @@ Attribute H5Location::createAttribute(const char* name, const DataType& data_typ //-------------------------------------------------------------------------- // Function: H5Location::createAttribute -///\brief Deprecated - This is an overloaded member function, provided for convenience. +///\brief Deprecated - replaced by H5Object::createAttribute +// 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. // Programmer Binh-Minh Ribler - 2000 @@ -146,7 +148,8 @@ Attribute H5Location::createAttribute(const H5std_string& name, const DataType& //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Deprecated - Opens an attribute given its name. +///\brief Deprecated - replaced by H5Object::openAttribute +// brief Opens an attribute given its name. ///\param name - IN: Name of the attribute ///\return Attribute instance ///\exception H5::AttributeIException @@ -169,9 +172,11 @@ Attribute H5Location::openAttribute(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Deprecated - 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. +///\brief Deprecated - replaced by H5Object::openAttribute +// 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 attribute // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Location::openAttribute(const H5std_string& name) const @@ -181,7 +186,8 @@ Attribute H5Location::openAttribute(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Deprecated - Opens an attribute given its index. +///\brief Deprecated - replaced by H5Object::openAttribute +// brief Opens an attribute given its index. ///\param idx - IN: Index of the attribute, a 0-based, non-negative integer ///\return Attribute instance ///\exception H5::AttributeIException @@ -205,7 +211,7 @@ Attribute H5Location::openAttribute(const unsigned int idx) const //-------------------------------------------------------------------------- // Function: H5Location::iterateAttrs -///\brief Deprecated - Iterates a user's function over all the attributes of an H5 +///\brief Iterates a user's function over all the attributes of an H5 /// object, which may be a group, dataset or named datatype. ///\param user_op - IN: User's function to operate on each attribute ///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices @@ -218,7 +224,7 @@ Attribute H5Location::openAttribute(const unsigned int idx) const /// void (*)(H5::H5Location&, H5std_string, void*). /// For information, please refer to the C layer Reference Manual /// at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Location::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data) @@ -250,7 +256,8 @@ int H5Location::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_d //-------------------------------------------------------------------------- // Function: H5Location::attrExists -///\brief Deprecated - Checks whether the named attribute exists at this location. +///\brief Deprecated - replaced by H5Object::attrExists() +// brief Checks whether the named attribute exists at this location. ///\param name - IN: Name of the attribute to be queried ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2013 @@ -271,10 +278,12 @@ bool H5Location::attrExists(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::attrExists -///\brief Deprecated - 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. -// Programmer Binh-Minh Ribler - 2000 +///\brief Deprecated - replaced by H5Object::attrExists() +// 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 attribute to be queried +// Programmer Binh-Minh Ribler - 2013 //-------------------------------------------------------------------------- bool H5Location::attrExists(const H5std_string& name) const { @@ -283,7 +292,8 @@ bool H5Location::attrExists(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::removeAttr -///\brief Deprecated - Removes the named attribute from this object. +///\brief Deprecated - replaced by H5Object::removeAttr() +// brief Removes the named attribute from this object. ///\param name - IN: Name of the attribute to be removed ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 @@ -297,9 +307,11 @@ void H5Location::removeAttr(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::removeAttr -///\brief Deprecated - 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. +///\brief Deprecated - replaced by H5Object::removeAttr() +// 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 attribute to be removed // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::removeAttr(const H5std_string& name) const @@ -309,7 +321,8 @@ void H5Location::removeAttr(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::renameAttr -///\brief Deprecated - Renames the named attribute from this object. +///\brief Deprecated - replaced by H5Object::renameAttr() +// brief Renames the named attribute from this object. ///\param oldname - IN: Name of the attribute to be renamed ///\param newname - IN: New name ame of the attribute ///\exception H5::AttributeIException @@ -324,10 +337,13 @@ void H5Location::renameAttr(const char* oldname, const char* newname) const //-------------------------------------------------------------------------- // Function: H5Location::renameAttr -///\brief Deprecated - 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 the names. -/// +///\brief Deprecated - replaced by H5Object::renameAttr() +// 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 the names. +// +///\param oldname - IN: Name of the attribute to be renamed +///\param newname - IN: New name ame of the attribute ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- @@ -338,25 +354,28 @@ void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& new //-------------------------------------------------------------------------- // Function: H5Location::getNumAttrs -///\brief Returns the number of attributes attached to this HDF5 object. +///\brief Deprecated - replaced by H5Object::getNumAttrs() +// brief Returns the number of attributes attached to this HDF5 object. ///\return Number of attributes ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 +// Modification +// - Moved to H5Object in 1.8.20. -BMR //-------------------------------------------------------------------------- int H5Location::getNumAttrs() const { - H5O_info_t oinfo; /* Object info */ + H5O_info_t objinfo; /* Object info */ - if(H5Oget_info(getId(), &oinfo) < 0) + if(H5Oget_info(getId(), &objinfo) < 0) throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); else - return(static_cast<int>(oinfo.num_attrs)); + return(static_cast<int>(objinfo.num_attrs)); } //-------------------------------------------------------------------------- // Function: H5Location::nameExists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name +///\brief Checks if a link of a given name exists in a location. +///\param name - IN: Searched name - \c char* ///\param lapl - IN: Link access property list ///\exception H5::LocationException // Programmer Binh-Minh Ribler - Nov, 2016 @@ -377,8 +396,8 @@ bool H5Location::nameExists(const char* name, const LinkAccPropList& lapl) const //-------------------------------------------------------------------------- // Function: H5Location::nameExists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name +///\brief Checks if a link of a given name exists in a location. +///\param name - IN: Searched name - \c H5std_string ///\param lapl - IN: Link access property list ///\exception H5::LocationException // Programmer Binh-Minh Ribler - Dec, 2016 @@ -431,6 +450,53 @@ H5std_string H5Location::getFileName() const } //-------------------------------------------------------------------------- +// Function: H5Location::getObjectInfo +///\brief Retrieve information about an object, specified by location. +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Aug, 2017 +//-------------------------------------------------------------------------- +void H5Location::getObjectInfo(H5O_info_t *objinfo) const +{ + herr_t ret_value = H5Oget_info(getId(), objinfo); + if (ret_value < 0) + { + throw LocationException(inMemFunc("getObjectInfo"), "H5Oget_info failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::getObjectInfo +///\brief Retrieve information about an object, specified by name. +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Aug, 2017 +//-------------------------------------------------------------------------- +void H5Location::getObjectInfo(const char *name, H5O_info_t *objinfo, + const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Oget_info_by_name(getId(), name, objinfo, lapl.getId()); + if (ret_value < 0) + { + throw LocationException(inMemFunc("getObjectInfo"), "H5Oget_info_by_name failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::getObjectInfo +///\brief Retrieve information about an object, specified by name. +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Aug, 2017 +//-------------------------------------------------------------------------- +void H5Location::getObjectInfo(const H5std_string& name, H5O_info_t *objinfo, + const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Oget_info_by_name(getId(), name.c_str(), objinfo, lapl.getId()); + if (ret_value < 0) + { + throw LocationException(inMemFunc("getObjectInfo"), "H5Oget_info_by_name failed"); + } +} + +//-------------------------------------------------------------------------- // Function: H5Location::objVersion ///\brief Returns the header version of this HDF5 object. ///\return Object version, which can have the following values: |