Go to the documentation of this file.
30 #ifndef __TERRALIB_CORE_LIB_LIBRARYMANAGER_H__
31 #define __TERRALIB_CORE_LIB_LIBRARYMANAGER_H__
34 #include "../Config.h"
40 #include <boost/function.hpp>
162 #define TERRALIB_LIBRARY_BEGIN(library_name) \
163 class library_ ## library_name \
167 library_ ## library_name() \
169 LibraryEntry le = {#library_name, \
174 te::core::LibraryManager::instance().insert(le); \
177 ~library_ ## library_name() \
179 if(te::core::LibraryManager::instance().exists(#library_name))\
181 te::core::LibraryManager::instance().get(#library_name).shutdown();\
182 te::core::LibraryManager::instance().remove(#library_name);\
187 #define TERRALIB_LIBRARY_STARTUP \
190 #define TERRALIB_LIBRARY_SHUTDOWN \
193 #define TERRALIB_LIBRARY_END(library_name) \
196 static library_ ## library_name s_lib;
198 #endif // __TERRALIB_CORE_LIB_LIBRARYMANAGER_H__
LibraryManager(const LibraryManager &)
const LibraryEntry & get(const std::string &name)
Return a null pointer if a library doesnt't exist.
LibraryManager()
Singleton constructor must be private or protected.
~LibraryManager()
Singleton destructor must be private or protected.
LibraryManager & operator=(const LibraryManager &)
bool exists(const std::string &name)
Checks if a LibraryEntry exists from a given name.
void insert(const LibraryEntry &entry)
It inserts a LibraryEntry to the manager.
void remove(const std::string &name)
It removes a LibraryEntry from the manager.
A singleton that can be used to observe the available libraries in the system.
boost::function0< void > CleanupFnct
boost::function0< void > StartupFnct
static LibraryManager & instance()
It returns a reference to the singleton instance.
CleanupFnct m_cleanupFptr
bool isInitialized(const std::string &name)
The current state of the LibraryEntry.