diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2008-07-25 21:51:01 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2008-07-25 21:51:01 (GMT) |
commit | 18fb7d1a78ff488c23ed5e3bec583034176f3bb4 (patch) | |
tree | cdf00652c7201807d9fa41feb5bfe357023a695c /c++/src/H5File.h | |
parent | bb8bf261eef26e860eaa1ebf2dd24d053a9378ec (diff) | |
download | hdf5-18fb7d1a78ff488c23ed5e3bec583034176f3bb4.zip hdf5-18fb7d1a78ff488c23ed5e3bec583034176f3bb4.tar.gz hdf5-18fb7d1a78ff488c23ed5e3bec583034176f3bb4.tar.bz2 |
[svn-r15407] Purpose: Fix bug
Description:
Changed all subclasses' setId to protected p_setId and put back setId
in IdComponent. p_setId is used in the library where the id provided
by a C API passed on to user's application in the form of a C++ API
object, which will be destroyed properly, and so p_setId does not
call incRefCount. On the other hand, the public version setId is
used by other applications, in which the id passed to setId needs
to be closed properly by the application, so setId must call incRefCount
for the new object to prevent prematurely closing of the id.
Platforms tested:
Linux 2.6 (kagiso)
SunOS 5.10 (linew)
FreeBSD (duty)
Diffstat (limited to 'c++/src/H5File.h')
-rw-r--r-- | c++/src/H5File.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 92b1e20..b49118e 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -109,9 +109,8 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { // Copy constructor: makes a copy of the original H5File object. H5File(const H5File& original); - // Gets/Sets the HDF5 file id. + // Gets the HDF5 file id. virtual hid_t getId() const; - virtual void setId(const hid_t new_id); // H5File destructor. virtual ~H5File(); @@ -136,6 +135,10 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { // Retrieves a dataspace with the region pointed to selected. hid_t p_get_region(void *ref, H5R_type_t ref_type) const; + protected: + // Sets the HDF5 file id. + virtual void p_setId(const hid_t new_id); + #endif // DOXYGEN_SHOULD_SKIP_THIS }; |