46 using ObjectDeleter = std::function<
void(
void*)>;
53 using ComponentFunction = std::function<
int32_t(
void*, std::mutex&)>;
56 using ComponentPtrList = std::list<std::pair<std::string, void*>>;
61 ObjectDeleter deleter;
68 struct ComponentLifeCycleManager
71 ComponentFunction takeComponentOwnership;
74 ComponentFunction destroyComponent;
78 using PluginMap = std::map<std::string, std::pair<std::shared_ptr<Plugin>,
bool>>;
81 using PluginComponentsMap = std::map<std::string, ComponentPtrList>;
84 using ExitFuncMap = std::map<std::string, JAMI_PluginExitFunc>;
85 using ObjectFactoryVec = std::vector<ObjectFactory>;
86 using ObjectFactoryMap = std::map<std::string, ObjectFactory>;
94 bool load(
const std::string& path);
101 bool unload(
const std::string& path);
148 ComponentFunction&& destroyComponent);
157 void destroyPluginComponents(
const std::string& path);
163 bool callPluginInitFunction(
const std::string& path);
169 bool registerPlugin(std::unique_ptr<Plugin>&
plugin);
176 std::unique_ptr<void, ObjectDeleter> createObject(
const std::string& type);
201 std::mutex mutex_ {};
204 registerObjectFactory_,
209 PluginMap dynPluginMap_ {};
212 ExitFuncMap exitFunc_ {};
214 ObjectFactoryMap exactMatchMap_ {};
215 ObjectFactoryVec wildCardVec_ {};
218 std::map<std::string, ServiceFunction> services_ {};
221 std::map<std::string, ComponentLifeCycleManager> componentsLifeCycleManagers_ {};
224 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...