summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Library.h
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-10-04 07:33:40 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-10-04 07:33:40 (GMT)
commit914643490ab581c4b0bb78ca30a8e1fa520b4d6d (patch)
tree53436d1611395e02c652c7ac5c075898fc2ae261 /c++/src/H5Library.h
parent0ee053bb95a620b6f8109d22a372f6acc1cee300 (diff)
parent888a002cddaa4e1d9a165ea01dfe62f399df9eb9 (diff)
downloadhdf5-914643490ab581c4b0bb78ca30a8e1fa520b4d6d.zip
hdf5-914643490ab581c4b0bb78ca30a8e1fa520b4d6d.tar.gz
hdf5-914643490ab581c4b0bb78ca30a8e1fa520b4d6d.tar.bz2
[svn-r27946] Brought VDS branch in sync with trunk (up to r27945).
Tested on Ubuntu 15.04 (Linux 3.19 x86_64), gcc 4.9.2, MPICH 3.1.4 and CMake 3.3.2. - Autotools serial w/ Fortran, C++ - Autotools parallel w/ Fortran - CMake serial w/ Fortran, C++
Diffstat (limited to 'c++/src/H5Library.h')
-rw-r--r--c++/src/H5Library.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h
index e5365f9..68ab039 100644
--- a/c++/src/H5Library.h
+++ b/c++/src/H5Library.h
@@ -21,14 +21,6 @@
namespace H5 {
#endif
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-#define NOTATEXIT (-10) // just in case the HDF5 library use more
- // negative constants. Note: the solution used for the atexit/global
- // destructors is not reliable, and desperately needs improvement
- // It is not even working, inifiteloop message still printed when
- // calling H5close
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
/*! \class H5Library
\brief Class H5Library operates the HDF5 library globably.
@@ -37,10 +29,6 @@ namespace H5 {
*/
class H5_DLLCPP H5Library {
public:
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- static bool need_cleanup; // indicates if H5close should be called
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
// Initializes the HDF5 library.
static void open();
@@ -65,9 +53,28 @@ class H5_DLLCPP H5Library {
static void 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);
+ // Initializes C++ library and registers terminating functions at exit.
+ // Only for the library functions, not for user-defined functions.
+ static void initH5cpp(void);
+
+ // Sends request for terminating the HDF5 library.
+ static void termH5cpp(void);
+
+ static H5Library* getInstance();
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
private:
- // Default constructor - no instance ever created
- H5Library() {};
+
+ // private instance to be created by H5Library only
+ static H5Library* instance;
+
+ // Default constructor - no instance ever created from outsiders
+ H5Library();
+
+ // Destructor
+ ~H5Library();
+#endif // DOXYGEN_SHOULD_SKIP_THIS
};
#ifndef H5_NO_NAMESPACE