H5Library.h

00001 // C++ informative line for the emacs editor: -*- C++ -*-
00002 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00003  * Copyright by The HDF Group.                                               *
00004  * Copyright by the Board of Trustees of the University of Illinois.         *
00005  * All rights reserved.                                                      *
00006  *                                                                           *
00007  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00008  * terms governing use, modification, and redistribution, is contained in    *
00009  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00010  * of the source code distribution tree; Copyright.html can be found at the  *
00011  * root level of an installed copy of the electronic HDF5 document set and   *
00012  * is linked from the top-level documents page.  It can also be found at     *
00013  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00014  * access to either file, you may request a copy from help@hdfgroup.org.     *
00015  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00016 
00017 #ifndef _H5Library_H
00018 #define _H5Library_H
00019 
00020 #ifndef H5_NO_NAMESPACE
00021 namespace H5 {
00022 #endif
00023 
00024 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00025 #define NOTATEXIT       (-10)   // just in case the HDF5 library use more
00026         // negative constants. Note: the solution used for the atexit/global
00027         // destructors is not reliable, and desperately needs improvement
00028         // It is not even working, inifiteloop message still printed when
00029         // calling H5close
00030 #endif // DOXYGEN_SHOULD_SKIP_THIS
00031 
00032 class H5_DLLCPP H5Library {
00033    public:
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035         static bool need_cleanup; // indicates if H5close should be called
00036 #endif // DOXYGEN_SHOULD_SKIP_THIS
00037 
00038         // Initializes the HDF5 library.
00039         static void open();
00040 
00041         // Flushes all data to disk, closes files, and cleans up memory.
00042         static void close();
00043 
00044         // Instructs library not to install atexit cleanup routine
00045         static void dontAtExit();
00046 
00047         // Returns the HDF library release number.
00048         static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum );
00049 
00050         // Verifies that the arguments match the version numbers compiled
00051         // into the library
00052         static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum );
00053 
00054         // Walks through all the garbage collection routines for the library,
00055         // which are supposed to free any unused memory they have allocated.
00056         static void garbageCollect();
00057 
00058         // Sets limits on the different kinds of free lists.
00059         static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int
00060         arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);
00061 
00062    private:
00063         // Default constructor - no instance ever created
00064         H5Library() {};
00065 
00066 };
00067 #ifndef H5_NO_NAMESPACE
00068 }
00069 #endif
00070 #endif