diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-05-10 15:20:28 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-05-10 15:20:28 (GMT) |
commit | 8df5c966e09c34524c39d4afe71029ef6664d687 (patch) | |
tree | 512f68e03ffaf0a554464bb15a3291781e932bd7 /c++/src/H5Object.h | |
parent | 6c161ba4dc7c25da6ecbe98aec10fff7b1365df6 (diff) | |
download | hdf5-8df5c966e09c34524c39d4afe71029ef6664d687.zip hdf5-8df5c966e09c34524c39d4afe71029ef6664d687.tar.gz hdf5-8df5c966e09c34524c39d4afe71029ef6664d687.tar.bz2 |
Improvement of class hierarchy
Description:
- Moved class Attribute to be derived from class H5Location instead of
IdComponent because an attribute id can be used as loc_id in C APIs.
- Copied wrappers of H5A APIs in H5Location into H5Object because H5A
functions do not take an attribute id as loc_id. The original wrappers
will be deprecated in future releases.
- Revised comments
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 (platypus)
Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5Object.h')
-rw-r--r-- | c++/src/H5Object.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index fa9e8a9..b118bb8 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -37,6 +37,30 @@ namespace H5 { // Inheritance: H5Location -> IdComponent class H5_DLLCPP H5Object : public H5Location { public: + // Creates an attribute for the specified object + // PropList is currently not used, so always be default. + Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + + // Given its name, opens the attribute that belongs to this object. + Attribute openAttribute(const char* name) const; + Attribute openAttribute(const H5std_string& name) const; + + // Given its index, opens the attribute that belongs to this object. + Attribute openAttribute(const unsigned int idx) const; + + // Checks whether the named attribute exists for this object. + bool attrExists(const char* name) const; + bool attrExists(const H5std_string& name) const; + + // Renames the named attribute of this object to a new name. + void renameAttr(const char* oldname, const char* newname) const; + void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + + // Removes the named attribute from this object. + void removeAttr(const char* name) const; + void removeAttr(const H5std_string& name) const; + // Gets the name of this HDF5 object, i.e., Group, DataSet, or // DataType. ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; |