10 #ifndef PLUGINMANAGER_H_
11 #define PLUGINMANAGER_H_
85 template<
typename __C,
typename __P>
95 template<
typename __C>
102 loadedModulesInfo.clear();
103 pluginInstancesInfo.clear();
106 std::map<void*, std::string> getPluginInstancesInfo()
108 return pluginInstancesInfo;
111 std::vector<std::string> getLoadedModules()
113 std::vector<std::string> result;
114 std::map<std::string, LoadedModulesInfo>::iterator it;
115 for (it = loadedModulesInfo.begin(); it != loadedModulesInfo.end(); ++it)
117 result.push_back((*it).first);
146 bool loadModule(
const std::string& modulePath);
154 bool unloadModule(
const std::string& modulePath);
163 std::string getPluginModuleName(
const std::string& pluginName)
const;
170 static void pluginLoadedCb(
const std::string& name);
172 static std::vector<std::string> loadedPlugins;
175 typedef std::map<std::string, std::string> PluginsInfo;
181 PluginsInfo pluginsInfo;
183 struct LoadedModulesInfo
185 LoadedModulesInfo() :
190 LoadedModulesInfo(
void* p) :
195 unsigned int refCount;
204 std::map<std::string, LoadedModulesInfo> loadedModulesInfo;
210 std::map<void*, std::string> pluginInstancesInfo;
218 #endif // PLUGINMANAGER_H_
__C * getPluginInstance(const std::string &pluginName, const __P ¶ms)
Creates instance of a plugin using plugin specific parameters to initialize it.
Definition: PluginManagerTemplates.hpp:13
static PluginManager & getInstance()
Returns instance of PluginManager.
Definition: PluginManager.cpp:179
bool isPluginAvailable(const std::string &pluginName) const
Checks if given plugin is provided by any module.
Definition: PluginManager.cpp:121
void freePluginInstance(__C *instance)
Frees plugin instance created by getPluginInstance function. Apart from removing instance it will che...
Definition: PluginManagerTemplates.hpp:39
std::string getDefaultModulesDirectory() const
Returns default location of OpenAB modules.
Definition: PluginManager.cpp:110
virtual ~PluginManager()
Destructor, virtual by default.
Definition: PluginManager.cpp:31
std::map< std::string, std::string > getListOfPlugins() const
List all available plugins with information about which modules are providing them. Keys in returned map are pluigins names and their values are modules names that are providing them e.g. PBAP /usr/lib/OpenAB/libOpenAB_plugin_input_pbap.so.
Definition: PluginManager.cpp:128
PluginManager provides way to manage OpenAB plugins. Allows to discover modules that are providing Op...
Definition: PluginManager.hpp:25
void scanDirectory(const std::string &path)
Scans directory for OpenAB modules. Updates list of available plugins.
Definition: PluginManager.cpp:46