This should allow concurrency in the plugins to be independent from their container. Contains also some work on the system for registering plugins.
30 lines
578 B
C++
30 lines
578 B
C++
#ifndef PLUGINREGISTER_H
|
|
#define PLUGINREGISTER_H
|
|
|
|
#include <memory>
|
|
#include <map>
|
|
#include <mutex>
|
|
#include <QString>
|
|
|
|
class QAction;
|
|
class PluginModule;
|
|
|
|
class PluginRegister {
|
|
public:
|
|
using PluginModuleSPtr = std::shared_ptr<PluginModule>;
|
|
using ModuleMap = std::map<QString, PluginModuleSPtr>;
|
|
|
|
static PluginRegister* getInstance();
|
|
|
|
PluginRegister();
|
|
void registerModule(PluginModuleSPtr module);
|
|
const ModuleMap& modules() const { return m_moduleMap; }
|
|
private:
|
|
|
|
ModuleMap m_moduleMap;
|
|
|
|
static PluginRegister* s_pluginRegister;
|
|
};
|
|
|
|
|
|
#endif // PLUGINREGISTER_H
|