MyGUI  3.2.1
MyGUI_PluginManager.h
Go to the documentation of this file.
1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #ifndef __MYGUI_PLUGIN_MANAGER_H__
8 #define __MYGUI_PLUGIN_MANAGER_H__
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Singleton.h"
12 #include "MyGUI_Plugin.h"
13 #include "MyGUI_XmlDocument.h"
14 #include "MyGUI_Version.h"
15 #include "MyGUI_DynLib.h"
16 #include <set>
18 
19 namespace MyGUI
20 {
21 
25  public Singleton<PluginManager>,
26  public MemberObsolete<PluginManager>
27  {
28  public:
29  PluginManager();
30 
31  void initialise();
32  void shutdown();
33 
35  bool loadPlugin(const std::string& _file);
36 
38  void unloadPlugin(const std::string& _file);
39 
43  void installPlugin(IPlugin* _plugin);
44 
48  void uninstallPlugin(IPlugin* _plugin);
49 
51  void unloadAllPlugins();
52 
53  private:
54  void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
55 
56  private:
58  typedef std::map <std::string, DynLib*> DynLibList;
59 
61  typedef std::set <IPlugin*> PluginList;
62 
64  DynLibList mLibs;
65 
67  PluginList mPlugins;
68 
69  bool mIsInitialise;
70  std::string mXmlPluginTagName;
71  };
72 
73 } // namespace MyGUI
74 
75 #endif // __MYGUI_PLUGIN_MANAGER_H__