MyGUI  3.2.1
MyGUI_PluginManager.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_PLUGIN_MANAGER_H__
00008 #define __MYGUI_PLUGIN_MANAGER_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Singleton.h"
00012 #include "MyGUI_Plugin.h"
00013 #include "MyGUI_XmlDocument.h"
00014 #include "MyGUI_Version.h"
00015 #include "MyGUI_DynLib.h"
00016 #include <set>
00017 #include "MyGUI_BackwardCompatibility.h"
00018 
00019 namespace MyGUI
00020 {
00021 
00024     class MYGUI_EXPORT PluginManager :
00025         public Singleton<PluginManager>,
00026         public MemberObsolete<PluginManager>
00027     {
00028     public:
00029         PluginManager();
00030 
00031         void initialise();
00032         void shutdown();
00033 
00035         bool loadPlugin(const std::string& _file);
00036 
00038         void unloadPlugin(const std::string& _file);
00039 
00043         void installPlugin(IPlugin* _plugin);
00044 
00048         void uninstallPlugin(IPlugin* _plugin);
00049 
00051         void unloadAllPlugins();
00052 
00053     private:
00054         void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
00055 
00056     private:
00058         typedef std::map <std::string, DynLib*> DynLibList;
00059 
00061         typedef std::set <IPlugin*> PluginList;
00062 
00064         DynLibList mLibs;
00065 
00067         PluginList mPlugins;
00068 
00069         bool mIsInitialise;
00070         std::string mXmlPluginTagName;
00071     };
00072 
00073 } // namespace MyGUI
00074 
00075 #endif // __MYGUI_PLUGIN_MANAGER_H__