MyGUI  3.2.1
MyGUI_DynLibManager.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_DYN_LIB_MANAGER_H__
00008 #define __MYGUI_DYN_LIB_MANAGER_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Singleton.h"
00012 #include "MyGUI_DynLib.h"
00013 #include <map>
00014 
00015 namespace MyGUI
00016 {
00017 
00020     class MYGUI_EXPORT DynLibManager :
00021         public Singleton<DynLibManager>
00022     {
00023     public:
00024         DynLibManager();
00025 
00026         void initialise();
00027         void shutdown();
00028 
00030         DynLib* load(const std::string& fileName);
00032         void unload(DynLib* library);
00033 
00034         void unloadAll();
00035 
00036         /*internal:*/
00037         void _unloadDelayDynLibs();
00038 
00039     private:
00040         void notifyEventFrameStart(float _time);
00041 
00042     private:
00044         typedef std::map <std::string, DynLib*> StringDynLibMap;
00046         StringDynLibMap mLibsMap;
00047 
00048         bool mIsInitialise;
00049 
00050         typedef std::vector<DynLib*> VectorDynLib;
00051         VectorDynLib mDelayDynLib;
00052     };
00053 
00054 } // namespace MyGUI
00055 
00056 #endif // __MYGUI_DYN_LIB_MANAGER_H__