20 mXmlPluginTagName(
"Plugin"),
21 mSingletonHolder(this)
46 mIsInitialise =
false;
60 MYGUI_LOG(Error,
"Plugin '" << _file <<
"' not found");
68 MYGUI_LOG(Error,
"Cannot find symbol 'dllStartPlugin' in library " << _file);
85 DynLibList::iterator it = mLibs.find(_file);
86 if (it != mLibs.end())
93 getClassTypeName() <<
"Cannot find symbol 'dllStopPlugin' in library " << _file);
114 else if (node->
getName() ==
"Plugin")
116 std::string_view source;
119 while (source_node.next(
"Source"))
121 std::string_view build = source_node->findAttribute(
"build");
122#if MYGUI_DEBUG_MODE == 1
123 if (build ==
"Debug")
124 source = source_node->getContent();
126 if (build !=
"Debug")
127 source = source_node->getContent();
142 mPlugins.insert(_plugin);
147 MYGUI_LOG(Info,
"Plugin successfully installed");
155 PluginList::iterator it = mPlugins.find(_plugin);
156 if (it != mPlugins.end())
162 MYGUI_LOG(Info,
"Plugin successfully uninstalled");
167 while (!mLibs.empty())
#define MYGUI_ASSERT(exp, dest)
#define MYGUI_LOG(level, text)
#define MYGUI_SINGLETON_DEFINITION(ClassName)
Resource holding data about a dynamic library.
void * getSymbol(const char *strName) const noexcept
const std::string & getName() const
Get the name of the library.
void unload(DynLib *library)
Unload library.
DynLib * load(std::string_view fileName)
Load library.
static DynLibManager & getInstance()
virtual void initialize()=0
virtual const std::string & getName() const =0
virtual void shutdown()=0
virtual void uninstall()=0
Plugin manager. Load/unload and register plugins.
void installPlugin(IPlugin *_plugin)
void unloadPlugin(std::string_view _file)
Unload plugin.
void uninstallPlugin(IPlugin *_plugin)
void unloadAllPlugins()
Unload all plugins.
bool loadPlugin(std::string_view _file)
Load plugin.
static std::string_view getClassTypeName()
void unregisterLoadXmlDelegate(std::string_view _key)
LoadXmlDelegate & registerLoadXmlDelegate(std::string_view _key)
static ResourceManager & getInstance()
bool findAttribute(std::string_view _name, std::string &_value)
ElementEnumerator getElementEnumerator()
const std::string & getName() const
void(*)() DLL_STOP_PLUGIN
void(*)() DLL_START_PLUGIN
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))