diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-05-11 19:11:04 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-05-11 19:11:04 (GMT) |
commit | 5520ff138ca79bb5aa46146908773c910f767554 (patch) | |
tree | c9ea17f4530c1eade235ea077f179d3557042233 /c++ | |
parent | c3218d9f39ec281506251c2c6ba0b395adfa9013 (diff) | |
parent | 67ba6cb57d84dd34c69930d469ae445697b49731 (diff) | |
download | hdf5-5520ff138ca79bb5aa46146908773c910f767554.zip hdf5-5520ff138ca79bb5aa46146908773c910f767554.tar.gz hdf5-5520ff138ca79bb5aa46146908773c910f767554.tar.bz2 |
[svn-r27050] merge from trunk.
Diffstat (limited to 'c++')
-rw-r--r-- | c++/examples/Makefile.am | 5 | ||||
-rw-r--r-- | c++/examples/Makefile.in | 5 | ||||
-rw-r--r-- | c++/src/H5CommonFG.cpp | 6 | ||||
-rw-r--r-- | c++/src/H5CommonFG.h | 1 | ||||
-rw-r--r-- | c++/src/H5DataType.cpp | 15 | ||||
-rw-r--r-- | c++/src/H5File.cpp | 31 | ||||
-rw-r--r-- | c++/src/Makefile.in | 2 | ||||
-rw-r--r-- | c++/src/cpp_doc_config | 2 |
8 files changed, 36 insertions, 31 deletions
diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am index 5bb8d59..2408217 100644 --- a/c++/examples/Makefile.am +++ b/c++/examples/Makefile.am @@ -42,8 +42,8 @@ INSTALL_FILES=create.cpp readdata.cpp writedata.cpp compound.cpp \ # Some of the examples depend on files created by running other examples readdata.chkexe_: create.chkexe_ chunks.chkexe_: extend_ds.chkexe_ -h5tutr_rdwt.chkexe_: h5tutrcrtdat.chkexe -h5tutrcrtatt.chkexe_: h5tutrcrtdat.chkexe +h5tutr_rdwt.chkexe_: h5tutr_crtdat.chkexe +h5tutrcrtatt.chkexe_: h5tutr_crtdat.chkexe h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe # Tell conclude.am that these are C++ tests. @@ -52,6 +52,7 @@ CXX_API=yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++ +EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index c8d6b18..03bd135 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -627,6 +627,7 @@ CXX_API = yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++ +EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -1020,8 +1021,8 @@ help: # Some of the examples depend on files created by running other examples readdata.chkexe_: create.chkexe_ chunks.chkexe_: extend_ds.chkexe_ -h5tutr_rdwt.chkexe_: h5tutrcrtdat.chkexe -h5tutrcrtatt.chkexe_: h5tutrcrtdat.chkexe +h5tutr_rdwt.chkexe_: h5tutr_crtdat.chkexe +h5tutrcrtatt.chkexe_: h5tutr_crtdat.chkexe h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe # How to build programs using h5c++ diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 1547a5b..dbe26b4 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -1130,6 +1130,7 @@ H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_ unsigned CommonFG::childObjVersion(const char* objname) const { H5O_info_t objinfo; + unsigned version = 0; // Use C API to get information of the object herr_t ret_value = H5Oget_info_by_name(getLocId(), objname, &objinfo, H5P_DEFAULT); @@ -1140,12 +1141,11 @@ unsigned CommonFG::childObjVersion(const char* objname) const // Return a valid version or throw an exception for invalid value else { - unsigned version = objinfo.hdr.version; + version = objinfo.hdr.version; if (version != H5O_VERSION_1 && version != H5O_VERSION_2) throwException("childObjVersion", "Invalid version for object"); - else - return(version); } + return(version); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index b726e52..d36d78c 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -21,6 +21,7 @@ namespace H5 { #endif +// Class forwarding class Group; class H5File; class ArrayType; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index a227843..cdcd1e6 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -106,7 +106,7 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) +DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object() { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -148,13 +148,18 @@ DataType::DataType(const DataType& original) : H5Object() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 // Description -// This is so that when a predefined type is passed in, a -// copy of it is made, not just a duplicate of the HDF5 id. +// Copying the type so that when a predefined type is passed in, +// a copy of it is made, not just a duplicate of the HDF5 id. +// Note: calling DataType::copy will invoke DataType::close() +// unnecessarily and will produce undefined behavior. +// -BMR, Apr 2015 //-------------------------------------------------------------------------- DataType::DataType(const PredType& pred_type) : H5Object() { - // use DataType::copy to make a copy of this predefined type - copy(pred_type); + // call C routine to copy the datatype + id = H5Tcopy( pred_type.getId() ); + if (id < 0) + throw DataTypeIException("DataType constructor", "H5Tcopy failed"); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 2e70e30..de23d78 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -73,9 +73,6 @@ H5File::H5File() : H5Location(), CommonFG(), id(H5I_INVALID_HID) {} /// exists, and fail, otherwise /// \li \c H5F_ACC_RDWR - Open file for read/write, if it already /// exists, and fail, otherwise -/// \li \c H5F_ACC_DEBUG - print debug information. This flag is -/// used only by HDF5 library developers; it is neither -/// tested nor supported for use in applications. ///\par /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer @@ -133,25 +130,25 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro { // These bits only set for creation, so if any of them are set, // create the file. - if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC|H5F_ACC_DEBUG)) + if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { - hid_t create_plist_id = create_plist.getId(); - hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fcreate failed"); - } + hid_t create_plist_id = create_plist.getId(); + hid_t access_plist_id = access_plist.getId(); + id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fcreate failed"); + } } // Open the file if none of the bits above are set. else { - hid_t access_plist_id = access_plist.getId(); - id = H5Fopen( name, flags, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fopen failed"); - } + hid_t access_plist_id = access_plist.getId(); + id = H5Fopen( name, flags, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fopen failed"); + } } } diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 55c3577..0487f69 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -670,7 +670,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 206 +LT_VERS_REVISION = 208 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index f2caed2..4072c1b 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.8.13 +PROJECT_NUMBER = HDF5 version 1.9.218 currently under development # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a |