diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-21 16:12:33 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-21 16:12:33 (GMT) |
commit | 2b18e934c6812fd1b487ebfebf9240b009c3e4ae (patch) | |
tree | 4c5f328cf76071650907986d781191af05a3374a /c++/src/H5Location.h | |
parent | 0a9249a4016f327a3382a103d1b3d10cc6451a5a (diff) | |
download | hdf5-2b18e934c6812fd1b487ebfebf9240b009c3e4ae.zip hdf5-2b18e934c6812fd1b487ebfebf9240b009c3e4ae.tar.gz hdf5-2b18e934c6812fd1b487ebfebf9240b009c3e4ae.tar.bz2 |
[svn-r24336] Bring revisions #24118 - #24200 from trunk.
Diffstat (limited to 'c++/src/H5Location.h')
-rw-r--r-- | c++/src/H5Location.h | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 8eae454..4ea13cd 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -14,8 +14,8 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5Location_H -#define _H5Location_H +#ifndef __H5Location_H +#define __H5Location_H #include "H5Classes.h" // constains forward class declarations @@ -36,12 +36,12 @@ typedef void (*attr_operator_t)( H5Location& loc/*in*/, class UserData4Aiterate { // user data for attribute iteration public: - attr_operator_t op; - void* opData; - H5Location* location; + attr_operator_t op; + void* opData; + H5Location* location; }; -// An H5Location can be a file, group, dataset, named datatype, or attribute. +// An H5Location can be a file, group, dataset, or committed datatype. class H5_DLLCPP H5Location : public IdComponent { public: @@ -85,29 +85,49 @@ class H5_DLLCPP H5Location : public IdComponent { bool attrExists(const char* name) const; bool attrExists(const H5std_string& name) const; + // Renames the named attribute 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 location. void removeAttr(const char* name) const; void removeAttr(const H5std_string& name) const; - // Renames the named attribute to a new name. - void renameAttr(const char* oldname, const char* newname) const; - void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + // Sets the comment for an HDF5 object specified by its name. + void setComment(const char* name, const char* comment) const; + void setComment(const H5std_string& name, const H5std_string& comment) const; + void setComment(const char* comment) const; + void setComment(const H5std_string& comment) const; + + // Retrieves comment for the HDF5 object specified by its name. + H5std_string getComment(const char* name, size_t bufsize=256) const; + H5std_string getComment(const H5std_string& name, size_t bufsize=256) const; + + // Removes the comment for the HDF5 object specified by its name. + void removeComment(const char* name) const; + void removeComment(const H5std_string& name) const; // Creates a reference to a named object or to a dataset region // in this object. + void reference(void* ref, const char* name, + H5R_type_t ref_type = H5R_OBJECT) const; + void reference(void* ref, const H5std_string& name, + H5R_type_t ref_type = H5R_DATASET_REGION) const; void reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; - void reference(void* ref, const char* name) const; - void reference(void* ref, const H5std_string& name) const; + void reference(void* ref, const H5std_string& name, const DataSpace& dataspace, + H5R_type_t ref_type = H5R_DATASET_REGION) const; // Open a referenced object whose location is specified by either // a file, an HDF5 object, or an attribute. - void dereference(H5File& h5file, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - void dereference(H5Object& obj, const void* ref, H5R_type_t ref_type = H5R_OBJECT); - void dereference(Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); + void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + + // Retrieves a dataspace with the region pointed to selected. + DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; - // For subclasses. - virtual hid_t getId() const = 0; + ///\brief Returns an identifier. (pure virtual) + virtual hid_t getId() const = 0; protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -124,7 +144,7 @@ class H5_DLLCPP H5Location : public IdComponent { void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; // Dereferences a ref into an HDF5 id. - hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type); + hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func); #ifndef H5_NO_DEPRECATED_SYMBOLS // Retrieves the type of object that an object reference points to. @@ -134,9 +154,6 @@ class H5_DLLCPP H5Location : public IdComponent { // Retrieves the type of object that an object reference points to. H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const; - // Retrieves a dataspace with the region pointed to selected. - hid_t p_get_region(void *ref, H5R_type_t ref_type) const; - // Noop destructor. virtual ~H5Location(); @@ -147,4 +164,4 @@ class H5_DLLCPP H5Location : public IdComponent { #ifndef H5_NO_NAMESPACE } #endif -#endif +#endif // __H5Location_H |