48 using ObjectDeleter = std::function<
void(
void*)>;
55 using ComponentFunction = std::function<
int32_t(
void*, std::mutex&)>;
58 using ComponentPtrList = std::list<std::pair<std::string, void*>>;
63 ObjectDeleter deleter;
70 struct ComponentLifeCycleManager
73 ComponentFunction takeComponentOwnership;
76 ComponentFunction destroyComponent;
80 using PluginMap = std::map<std::string, std::pair<std::shared_ptr<Plugin>,
bool>>;
83 using PluginComponentsMap = std::map<std::string, ComponentPtrList>;
86 using ExitFuncMap = std::map<std::string, JAMI_PluginExitFunc>;
87 using ObjectFactoryVec = std::vector<ObjectFactory>;
88 using ObjectFactoryMap = std::map<std::string, ObjectFactory>;
96 bool load(
const std::string& path);
103 bool unload(
const std::string& path);
150 ComponentFunction&& destroyComponent);
159 void destroyPluginComponents(
const std::string& path);
165 bool callPluginInitFunction(
const std::string& path);
171 bool registerPlugin(std::unique_ptr<Plugin>&
plugin);
178 std::unique_ptr<void, ObjectDeleter> createObject(
const std::string& type);
203 std::mutex mutex_ {};
206 registerObjectFactory_,
211 PluginMap dynPluginMap_ {};
214 ExitFuncMap exitFunc_ {};
216 ObjectFactoryMap exactMatchMap_ {};
217 ObjectFactoryVec wildCardVec_ {};
220 std::map<std::string, ServiceFunction> services_ {};
223 std::map<std::string, ComponentLifeCycleManager> componentsLifeCycleManagers_ {};
226 PluginComponentsMap pluginComponentsMap_ {};
bool registerComponentManager(const std::string &name, ComponentFunction &&takeOwnership, ComponentFunction &&destroyComponent)
Registers a component manager that will have two functions, one to take ownership of the component an...