diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2015-04-06 21:53:25 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2015-04-06 21:53:25 (GMT) |
commit | 5a810576d55f21ee8a872b904026647358113836 (patch) | |
tree | ee7c9c64d2e3e0973867b8830f93f10e62d4d611 /c++ | |
parent | a586729afb1e25f82befc4b394f3e819a4f7a880 (diff) | |
download | hdf5-5a810576d55f21ee8a872b904026647358113836.zip hdf5-5a810576d55f21ee8a872b904026647358113836.tar.gz hdf5-5a810576d55f21ee8a872b904026647358113836.tar.bz2 |
[svn-r26742] Purpose: Fixed HDFFV-7947 (cont.)
Description:
- Added incRefCount() to other constructors that missed from last time.
- Added default value for H5File::getObjCount and removed its extra version
Platforms tested:
Linux/64 (platypus)
Linux/32 2.6 (jam)
SunOS 5.11 (emu)
Diffstat (limited to 'c++')
-rw-r--r-- | c++/src/H5Attribute.cpp | 3 | ||||
-rw-r--r-- | c++/src/H5DataSet.cpp | 1 | ||||
-rw-r--r-- | c++/src/H5DataSpace.cpp | 1 | ||||
-rw-r--r-- | c++/src/H5File.cpp | 19 | ||||
-rw-r--r-- | c++/src/H5File.h | 3 | ||||
-rw-r--r-- | c++/src/H5Group.cpp | 1 | ||||
-rw-r--r-- | c++/src/H5Location.cpp | 2 |
7 files changed, 7 insertions, 23 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 12f39df..71cd431 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -74,7 +74,8 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent() //-------------------------------------------------------------------------- Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent() { - id = existing_id; + id = existing_id; + incRefCount(); // increment number of references to this id } //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 8917f91..b134d39 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -63,6 +63,7 @@ DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {} DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs() { id = existing_id; + incRefCount(); // increment number of references to this id } //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 761a454..d9c262d 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -85,6 +85,7 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : DataSpace::DataSpace(const hid_t existing_id) : IdComponent() { id = existing_id; + incRefCount(); // increment number of references to this id } //-------------------------------------------------------------------------- diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 1ce1db1..9cc51b7 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -405,25 +405,6 @@ ssize_t H5File::getObjCount(unsigned types) const } //-------------------------------------------------------------------------- -// Function: H5File::getObjCount -///\brief This is an overloaded member function, provided for convenience. -/// It takes no parameter and returns the object count of all -/// object types. -///\return Number of opened object IDs -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - May 2004 -//-------------------------------------------------------------------------- -ssize_t H5File::getObjCount() const -{ - ssize_t num_objs = H5Fget_obj_count(id, H5F_OBJ_ALL); - if( num_objs < 0 ) - { - throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed"); - } - return (num_objs); -} - -//-------------------------------------------------------------------------- // Function: H5File::getObjIDs ///\brief Retrieves a list of opened object IDs (files, datasets, /// groups and datatypes) in the same file. diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 77cd232..fb24447 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -59,8 +59,7 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG { // Returns the number of opened object IDs (files, datasets, groups // and datatypes) in the same file. - ssize_t getObjCount(unsigned types) const; - ssize_t getObjCount() const; + ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; // Retrieves a list of opened object IDs (files, datasets, groups // and datatypes) in the same file. diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index b523f89..fd04f1a 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -85,6 +85,7 @@ hid_t Group::getLocId() const Group::Group(const hid_t existing_id) : H5Object(), CommonFG() { id = existing_id; + incRefCount(); // increment number of references to this id } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 83a89d3..be11875 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -195,7 +195,7 @@ Attribute H5Location::openAttribute( const unsigned int idx ) const H5_ITER_INC, (hsize_t)idx, H5P_DEFAULT, H5P_DEFAULT); if( attr_id > 0 ) { - Attribute attr( attr_id ); + Attribute attr; f_Attribute_setId(&attr, attr_id); return(attr); } |