diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-10-06 19:09:59 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-10-06 19:09:59 (GMT) |
commit | 8e9b142d9cd347432d400b4f9b3b88a3f047c06d (patch) | |
tree | 47f400406beacaac0a987619ee17a7f4ef0bb44d /c++/src/H5Library.h | |
parent | 8d131aca15bca2d042ef175af5cf5a642d4c1152 (diff) | |
parent | 58db7babe40a10916a1c3b7667eaaeb5d48c2fb8 (diff) | |
download | hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.zip hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.tar.gz hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.tar.bz2 |
[svn-r27976] merge from trunk.
Diffstat (limited to 'c++/src/H5Library.h')
-rw-r--r-- | c++/src/H5Library.h | 35 |
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 |