MyGUI  3.2.0
MyGUI_PluginManager.h
Go to the documentation of this file.
1 
6 /*
7  This file is part of MyGUI.
8 
9  MyGUI is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  MyGUI is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_PLUGIN_MANAGER_H__
23 #define __MYGUI_PLUGIN_MANAGER_H__
24 
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Singleton.h"
27 #include "MyGUI_Plugin.h"
28 #include "MyGUI_XmlDocument.h"
29 #include "MyGUI_Version.h"
30 #include "MyGUI_DynLib.h"
31 #include <set>
33 
34 namespace MyGUI
35 {
36 
40  public Singleton<PluginManager>,
41  public MemberObsolete<PluginManager>
42  {
43  public:
44  PluginManager();
45 
46  void initialise();
47  void shutdown();
48 
50  bool loadPlugin(const std::string& _file);
51 
53  void unloadPlugin(const std::string& _file);
54 
58  void installPlugin(IPlugin* _plugin);
59 
63  void uninstallPlugin(IPlugin* _plugin);
64 
66  void unloadAllPlugins();
67 
68  private:
69  void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
70 
71  private:
73  typedef std::map <std::string, DynLib*> DynLibList;
74 
76  typedef std::set <IPlugin*> PluginList;
77 
79  DynLibList mLibs;
80 
82  PluginList mPlugins;
83 
84  bool mIsInitialise;
85  };
86 
87 } // namespace MyGUI
88 
89 #endif // __MYGUI_PLUGIN_MANAGER_H__