summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Library.cpp
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2017-07-06 19:16:57 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2017-07-06 19:16:57 (GMT)
commit23a702e7bad93fc4f14eab07678c75d276e2d0ad (patch)
treeafb57ddaeca17021342fa09b8999c15569630e71 /c++/src/H5Library.cpp
parent03dbcb75918b2cbf39800d9edf5665d3471a1fee (diff)
parentc15238a38fdb3692466bc1218de4c5aeb420fdcc (diff)
downloadhdf5-23a702e7bad93fc4f14eab07678c75d276e2d0ad.zip
hdf5-23a702e7bad93fc4f14eab07678c75d276e2d0ad.tar.gz
hdf5-23a702e7bad93fc4f14eab07678c75d276e2d0ad.tar.bz2
Merge pull request #593 in HDFFV/hdf5 from hdf5_1_8_19 to 1.8/masterhdf5-1_8_19
* commit 'c15238a38fdb3692466bc1218de4c5aeb420fdcc': (153 commits) Commit changes to release version strings in README.txt and RELEASE.txt from release. Put back link targets for dynamically loaded libraries in Makefile.ams that avoid linking with libhdf5 dependencies. Some configurations failed unnecessarily to find and link with lz and lsz when these targets were removed. Update URL for obtaining source inINSTALL file. Disable building of libdynlib* dynamically loaded plugin test libraries on CYGWIN. Added known problem entry to RELEASE.txt. Set version for 1.8.19 release. Barbara updated contents of README.txt file. Moved libdynlib* plugin test libraries to noist_LT_LIBRARIES with added flag '-rpath /nowhere' to stop them being installed while keeping them from linking with libhdf5, etc. Incremented version to 1.8.19-pre1 and ran bin/release to create tar and zip files for testing. HDF5 1.8.19-pre1 released. Add RELEASE.txt entry for H5Dget_chunk_size. Remove test entries Ran bin/reconfigure after so number change. Update hl lib .so numbers: new function was added. Update RELEASE.txt: move H5DOread_chunks entry to new features, clarify entry for HDFFV-10051. Updated notes for test fixes and added bug fix for h5diff help text. Update h5vers and release scripts for 1.8.19 branch, set version to 1.8.19-pre1. Make script name consistent across product versions Update version to 1.8.19-pre1. Propagate .so number changes to Makefile.ins with bin/reconfigure. Add toolset option Update so version numbers according to the interface compatibility report. Update supported Platforms section. Remove empty sub-sections of New Features and Bugs Fixed sections. Add entries for HDFFV-10051 and HDFFV-9934 to RELEASE.txt. Correct spelling ...
Diffstat (limited to 'c++/src/H5Library.cpp')
-rw-r--r--c++/src/H5Library.cpp218
1 files changed, 111 insertions, 107 deletions
diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp
index c8209e5..d60312c 100644
--- a/c++/src/H5Library.cpp
+++ b/c++/src/H5Library.cpp
@@ -5,12 +5,10 @@
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <string>
@@ -24,10 +22,12 @@
#include "H5FaccProp.h"
#include "H5FcreatProp.h"
#include "H5OcreatProp.h"
+#include "H5DcreatProp.h"
#include "H5DxferProp.h"
+#include "H5LaccProp.h"
+#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
-#include "H5DcreatProp.h"
#include "H5AtomType.h"
#include "H5PredType.h"
#include "H5DataSpace.h"
@@ -36,127 +36,127 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: H5Library::open (static)
-///\brief Initializes the HDF5 library.
+// Function: H5Library::open (static)
+///\brief Initializes the HDF5 library.
///
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5Library::open()
{
- herr_t ret_value = H5open();
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::open", "H5open failed");
- }
+ herr_t ret_value = H5open();
+ if(ret_value < 0)
+ {
+ throw LibraryIException("H5Library::open", "H5open failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::close (static)
-///\brief Flushes all data to disk, closes files, and cleans up memory.
+// Function: H5Library::close (static)
+///\brief Flushes all data to disk, closes files, and cleans up memory.
///
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5Library::close()
{
- herr_t ret_value = H5close();
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::close", "H5close failed");
- }
+ herr_t ret_value = H5close();
+ if(ret_value < 0)
+ {
+ throw LibraryIException("H5Library::close", "H5close failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::dontAtExit (static)
-///\brief Instructs library not to install the C \c atexit cleanup routine
+// Function: H5Library::dontAtExit (static)
+///\brief Instructs library not to install the C \c atexit cleanup routine
///
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Removed the check for failure returned from H5dont_atexit.
-// will be fixed to not fail (HDFFV-9540)
+// Removed the check for failure returned from H5dont_atexit.
+// will be fixed to not fail (HDFFV-9540)
//--------------------------------------------------------------------------
void H5Library::dontAtExit()
{
- herr_t ret_value = H5dont_atexit();
+ herr_t ret_value = H5dont_atexit();
}
//--------------------------------------------------------------------------
-// Function: H5Library::getLibVersion (static)
-///\brief Returns the HDF library release number.
-///\param majnum - OUT: Major version of the library
-///\param minnum - OUT: Minor version of the library
-///\param relnum - OUT: Release number of the library
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Library::getLibVersion (static)
+///\brief Returns the HDF library release number.
+///\param majnum - OUT: Major version of the library
+///\param minnum - OUT: Minor version of the library
+///\param relnum - OUT: Release number of the library
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum )
+void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum)
{
- herr_t ret_value = H5get_libversion( &majnum, &minnum, &relnum );
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed");
- }
+ herr_t ret_value = H5get_libversion(&majnum, &minnum, &relnum);
+ if(ret_value < 0)
+ {
+ throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::checkVersion (static)
-///\brief Verifies that the arguments match the version numbers
-/// compiled into the library
-///\param majnum - IN: Major version of the library
-///\param minnum - IN: Minor version of the library
-///\param relnum - IN: Release number of the library
-///\exception H5::LibraryIException
+// Function: H5Library::checkVersion (static)
+///\brief Verifies that the arguments match the version numbers
+/// compiled into the library
+///\param majnum - IN: Major version of the library
+///\param minnum - IN: Minor version of the library
+///\param relnum - IN: Release number of the library
+///\exception H5::LibraryIException
///\par Description
-/// For information about library version, please refer to
-/// the C layer Reference Manual at:
+/// For information about library version, please refer to
+/// the C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum)
{
- herr_t ret_value = H5check_version(majnum, minnum, relnum);
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::checkVersion", "H5check_version failed");
- }
+ herr_t ret_value = H5check_version(majnum, minnum, relnum);
+ if(ret_value < 0)
+ {
+ throw LibraryIException("H5Library::checkVersion", "H5check_version failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::garbageCollect (static)
-///\brief Walks through all the garbage collection routines for the
-/// library, which are supposed to free any unused memory they
-/// have allocated.
+// Function: H5Library::garbageCollect (static)
+///\brief Walks through all the garbage collection routines for the
+/// library, which are supposed to free any unused memory they
+/// have allocated.
///
-///\exception H5::LibraryIException
+///\exception H5::LibraryIException
///\par Description
-/// It is not required that H5Library::garbageCollect be called
-/// at any particular time; it is only necessary in certain
-/// situations, such as when the application has performed actions
-/// that cause the library to allocate many objects. The
-/// application should call H5Library::garbageCollect if it
-/// eventually releases those objects and wants to reduce the
-/// memory used by the library from the peak usage required.
+/// It is not required that H5Library::garbageCollect be called
+/// at any particular time; it is only necessary in certain
+/// situations, such as when the application has performed actions
+/// that cause the library to allocate many objects. The
+/// application should call H5Library::garbageCollect if it
+/// eventually releases those objects and wants to reduce the
+/// memory used by the library from the peak usage required.
///\par
-/// The library automatically garbage collects all the free
-/// lists when the application ends.
-// Programmer Binh-Minh Ribler - May, 2004
+/// The library automatically garbage collects all the free
+/// lists when the application ends.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Library::garbageCollect()
{
- herr_t ret_value = H5garbage_collect();
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed");
- }
+ herr_t ret_value = H5garbage_collect();
+ if(ret_value < 0)
+ {
+ throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed");
+ }
}
//--------------------------------------------------------------------------
// Function: H5Library::initH5cpp (static)
///\brief Initializes C++ library and registers terminating functions at
-/// exit. Only for the library functions, not for user-defined
-/// functions.
+/// exit. Only for the library functions, not for user-defined
+/// functions.
// Description
// initH5cpp registers the following functions with std::atexit():
// termH5cpp() - calls H5close() after all cleanup in
@@ -184,23 +184,27 @@ void H5Library::initH5cpp()
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating PropList::deleteConstants failed");
- ret_value = std::atexit(FileAccPropList::deleteConstants);
+ ret_value = std::atexit(LinkAccPropList::deleteConstants);
+ if (ret_value != 0)
+ throw LibraryIException("H5Library::initH5cpp", "Registrating LinkAccPropList::deleteConstants failed");
+
+ ret_value = std::atexit(FileAccPropList::deleteConstants);
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed");
- ret_value = std::atexit(FileCreatPropList::deleteConstants);
+ ret_value = std::atexit(FileCreatPropList::deleteConstants);
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating FileCreatPropList::deleteConstants failed");
- ret_value = std::atexit(DSetMemXferPropList::deleteConstants);
+ ret_value = std::atexit(DSetMemXferPropList::deleteConstants);
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating DSetMemXferPropList::deleteConstants failed");
- ret_value = std::atexit(DSetCreatPropList::deleteConstants);
+ ret_value = std::atexit(DSetCreatPropList::deleteConstants);
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating DSetCreatPropList::deleteConstants failed");
- ret_value = std::atexit(ObjCreatPropList::deleteConstants);
+ ret_value = std::atexit(ObjCreatPropList::deleteConstants);
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating ObjCreatPropList::deleteConstants failed");
@@ -225,31 +229,31 @@ void H5Library::termH5cpp()
}
//--------------------------------------------------------------------------
-// Function: H5Library::setFreeListLimits (static)
-///\brief Sets limits on the different kinds of free lists.
-///\param reg_global_lim - IN: Limit on all "regular" free list memory used
-///\param reg_list_lim - IN: Limit on memory used in each "regular" free list
-///\param arr_global_lim - IN: Limit on all "array" free list memory used
-///\param arr_list_lim - IN: Limit on memory used in each "array" free list
-///\param blk_global_lim - IN: Limit on all "block" free list memory used
-///\param blk_list_lim - IN: Limit on memory used in each "block" free list
-///\exception H5::LibraryIException
+// Function: H5Library::setFreeListLimits (static)
+///\brief Sets limits on the different kinds of free lists.
+///\param reg_global_lim - IN: Limit on all "regular" free list memory used
+///\param reg_list_lim - IN: Limit on memory used in each "regular" free list
+///\param arr_global_lim - IN: Limit on all "array" free list memory used
+///\param arr_list_lim - IN: Limit on memory used in each "array" free list
+///\param blk_global_lim - IN: Limit on all "block" free list memory used
+///\param blk_list_lim - IN: Limit on memory used in each "block" free list
+///\exception H5::LibraryIException
///\par Description
-/// Setting a value of -1 for a limit means no limit of that type.
-/// For more information on free list limits, please refer to C
-/// layer Reference Manual at:
+/// Setting a value of -1 for a limit means no limit of that type.
+/// For more information on free list limits, please refer to C
+/// layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits
-// Programmer Binh-Minh Ribler - May, 2004
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim,
- int arr_global_lim, int arr_list_lim, int blk_global_lim,
- int blk_list_lim)
+ int arr_global_lim, int arr_list_lim, int blk_global_lim,
+ int blk_list_lim)
{
- herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim);
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed");
- }
+ herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim);
+ if(ret_value < 0)
+ {
+ throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed");
+ }
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS