MyGUI: MyGUI_PluginManager.h Source File

MyGUI 3.4.3

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>
17#include "MyGUI_BackwardCompatibility.h"
18
19namespace MyGUI
20{
21
24 class MYGUI_EXPORT PluginManager : public MemberObsolete<PluginManager>
25 {
26 MYGUI_SINGLETON_DECLARATION(PluginManager);
27
28 public:
29 PluginManager();
30
31 void initialise();
32 void shutdown();
33
35 bool loadPlugin(std::string_view _file);
36
38 void unloadPlugin(std::string_view _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, std::string_view _file, Version _version);
55
56 private:
58 using DynLibList = std::map<std::string, DynLib*, std::less<>>;
59
61 using PluginList = std::set<IPlugin*>;
62
64 DynLibList mLibs;
65
67 PluginList mPlugins;
68
69 bool mIsInitialise{false};
70 std::string mXmlPluginTagName;
71 };
72
73} // namespace MyGUI
74
75#endif // MYGUI_PLUGIN_MANAGER_H_
MyGUI_BackwardCompatibility.h
MyGUI_DynLib.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Plugin.h
MyGUI_Prerequest.h
MyGUI_Singleton.h
MYGUI_SINGLETON_DECLARATION
#define MYGUI_SINGLETON_DECLARATION(ClassName)
Definition MyGUI_Singleton.h:112
MyGUI_Version.h
MyGUI_XmlDocument.h
MyGUI::IPlugin
Base plugin class.
Definition MyGUI_Plugin.h:19
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::PluginManager::installPlugin
void installPlugin(IPlugin *_plugin)
Definition MyGUI_PluginManager.cpp:136
MyGUI::PluginManager::unloadPlugin
void unloadPlugin(std::string_view _file)
Unload plugin.
Definition MyGUI_PluginManager.cpp:81
MyGUI::PluginManager::uninstallPlugin
void uninstallPlugin(IPlugin *_plugin)
Definition MyGUI_PluginManager.cpp:150
MyGUI::PluginManager::initialise
void initialise()
Definition MyGUI_PluginManager.cpp:25
MyGUI::PluginManager::unloadAllPlugins
void unloadAllPlugins()
Unload all plugins.
Definition MyGUI_PluginManager.cpp:165
MyGUI::PluginManager::loadPlugin
bool loadPlugin(std::string_view _file)
Load plugin.
Definition MyGUI_PluginManager.cpp:49
MyGUI::PluginManager::shutdown
void shutdown()
Definition MyGUI_PluginManager.cpp:37
MyGUI::PluginManager::PluginManager
PluginManager(const PluginManager &)=delete
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15