ParCompMark::PluginManager Class Reference
#include <PCMPluginManager.h>
Inheritance diagram for ParCompMark::PluginManager:
Detailed Description
Singleton plugin loader and handler class.
Definition at line 56 of file PCMPluginManager.h.
Methods | |
virtual void | initialize () |
Initialize plugin manager. | |
virtual void | finalize () |
Finalize plugin manager. | |
virtual void | loadPlugins () |
Load all plugins in described mPluginIniFile. | |
virtual void | loadPlugins_old () |
Load all plugins in described mPluginIniFile. | |
virtual void | unloadPlugins () |
Unload all loaded plugins. | |
virtual Plugin::Pointer | getPlugin (const std::string &name) |
Get plugin by name. | |
virtual Plugin::Pointer | _loadPlugin (const Plugin::PluginType &type, const std::string &filename) |
Load a plugin for the given filename relative to mPluginDirectory. | |
virtual void | _checkNeededLibs (Plugin::Pointer &plugin) |
Check needed libs for the specified plugin. | |
Public Member Functions | |
Constructors & destructor | |
PluginManager (const std::string &pluginDirectory="plugins/", const std::string &iniFile="plugins.ini") | |
Creates plugin manager. | |
virtual | ~PluginManager () |
The destructor. | |
Getters & setters | |
const std::string & | getPluginDirectory () const |
Getter of mPluginDirectory. | |
const std::string & | getPluginIniFile () const |
Getter of mPluginIniFile. | |
const bool & | getInitialized () const |
Getter of mInitialized. | |
Protected Attributes | |
Variables | |
Container< Plugin, Mutex >::Pointer | mPlugins |
Container of plugins. | |
std::string | mPluginDirectory |
Plugin directory path, relative to application data directory (. | |
std::string | mPluginIniFile |
Name of plugin ini file placed in mPluginDirectory. | |
bool | mInitialized |
The plugin manager is initialized. |
Constructor & Destructor Documentation
ParCompMark::PluginManager::PluginManager | ( | const std::string & | pluginDirectory = "plugins/" , |
|
const std::string & | iniFile = "plugins.ini" | |||
) |
Creates plugin manager.
- Parameters:
-
[in] pluginDirectory Plugin directory path, relative to application data directory [in] iniFile Name of plugin ini file. Not used.
Definition at line 54 of file PCMPluginManager.cpp.
References ParCompMark::Singleton< T >::getInstance(), mInitialized, mPluginDirectory, mPluginIniFile, mPlugins, and ParCompMark::Logger::NOTICE.
Here is the call graph for this function:
ParCompMark::PluginManager::~PluginManager | ( | ) | [virtual] |
The destructor.
This class has virtual destructor.
Definition at line 71 of file PCMPluginManager.cpp.
References finalize(), ParCompMark::Singleton< T >::getInstance(), mInitialized, and ParCompMark::Logger::NOTICE.
Here is the call graph for this function:
Member Function Documentation
void ParCompMark::PluginManager::_checkNeededLibs | ( | Plugin::Pointer & | plugin | ) | [protected, virtual] |
Check needed libs for the specified plugin.
Throw exception when a lib needed by the plugin is not linked to parcompmark.
- Parameters:
-
[out] plugin Type of the plugin.
Definition at line 253 of file PCMPluginManager.cpp.
References ParCompMark::Logger::DEBUG, and ParCompMark::Singleton< T >::getInstance().
Referenced by loadPlugins(), and loadPlugins_old().
Here is the call graph for this function:
Plugin::Pointer ParCompMark::PluginManager::_loadPlugin | ( | const Plugin::PluginType & | type, | |
const std::string & | filename | |||
) | [protected, virtual] |
Load a plugin for the given filename relative to mPluginDirectory.
- Parameters:
-
[in] type Pointer to the plugin. [in] filename Filename relative to mPluginDirectory.
- Returns:
- Pointer to the plugin.
Definition at line 223 of file PCMPluginManager.cpp.
References ParCompMark::Logger::DEBUG, Except, ParCompMark::Singleton< T >::getInstance(), ParCompMark::FileSystemManager::getInstance(), ParCompMark::FileSystemManager::getPathDataFile(), ParCompMark::Pointer< T, Lock >::lock(), mPlugins, ParCompMark::Plugin::RENDERER_PLUGIN, and ParCompMark::Pointer< T, Lock >::unlock().
Referenced by loadPlugins(), and loadPlugins_old().
Here is the call graph for this function:
void ParCompMark::PluginManager::finalize | ( | ) | [virtual] |
Finalize plugin manager.
Definition at line 98 of file PCMPluginManager.cpp.
References Assert, ParCompMark::Logger::DEBUG, ParCompMark::Singleton< T >::getInstance(), mInitialized, and unloadPlugins().
Referenced by ~PluginManager().
Here is the call graph for this function:
const bool & ParCompMark::PluginManager::getInitialized | ( | ) | const [inline] |
Getter of mInitialized.
Returns value of mInitialized.
- Returns:
- The value of mInitialized
Definition at line 272 of file PCMPluginManager.h.
Plugin::Pointer ParCompMark::PluginManager::getPlugin | ( | const std::string & | name | ) | [virtual] |
Get plugin by name.
- Parameters:
-
[in] name Name of the plugin.
- Returns:
- Pointer to the plugin.
Definition at line 210 of file PCMPluginManager.cpp.
References Assert, ParCompMark::Pointer< T, Lock >::lock(), mInitialized, mPlugins, and ParCompMark::Pointer< T, Lock >::unlock().
Here is the call graph for this function:
const std::string & ParCompMark::PluginManager::getPluginDirectory | ( | ) | const [inline] |
Getter of mPluginDirectory.
Returns value of mPluginDirectory.
- Returns:
- The value of mPluginDirectory
Definition at line 258 of file PCMPluginManager.h.
const std::string & ParCompMark::PluginManager::getPluginIniFile | ( | ) | const [inline] |
Getter of mPluginIniFile.
Returns value of mPluginIniFile.
- Returns:
- The value of mPluginIniFile
Definition at line 265 of file PCMPluginManager.h.
void ParCompMark::PluginManager::initialize | ( | ) | [virtual] |
Initialize plugin manager.
Definition at line 85 of file PCMPluginManager.cpp.
References Assert, ParCompMark::Logger::DEBUG, ParCompMark::Singleton< T >::getInstance(), loadPlugins(), and mInitialized.
Here is the call graph for this function:
void ParCompMark::PluginManager::loadPlugins | ( | ) | [virtual] |
Load all plugins in described mPluginIniFile.
Definition at line 111 of file PCMPluginManager.cpp.
References _checkNeededLibs(), _loadPlugin(), ParCompMark::Singleton< T >::getInstance(), ParCompMark::FileSystemManager::getInstance(), ParCompMark::FileSystemManager::listDataDirectory(), ParCompMark::Logger::NOTICE, and ParCompMark::Plugin::RENDERER_PLUGIN.
Referenced by initialize().
Here is the call graph for this function:
void ParCompMark::PluginManager::loadPlugins_old | ( | ) | [virtual] |
Load all plugins in described mPluginIniFile.
Not used.
Definition at line 135 of file PCMPluginManager.cpp.
References _checkNeededLibs(), _loadPlugin(), Assert, ParCompMark::Plugin::BASIC_PLUGIN, ParCompMark::FileSystemManager::closeFile(), Except, ParCompMark::Singleton< T >::getInstance(), ParCompMark::FileSystemManager::getInstance(), mPluginDirectory, mPluginIniFile, ParCompMark::Logger::NOTICE, ParCompMark::FileSystemManager::READ, ParCompMark::Plugin::RENDERER_PLUGIN, and ParCompMark::StringConverter::trim().
Here is the call graph for this function:
void ParCompMark::PluginManager::unloadPlugins | ( | ) | [virtual] |
Unload all loaded plugins.
Definition at line 201 of file PCMPluginManager.cpp.
References ParCompMark::Singleton< T >::getInstance(), ParCompMark::Pointer< T, Lock >::kill(), mPlugins, and ParCompMark::Logger::NOTICE.
Referenced by finalize().
Here is the call graph for this function:
Member Data Documentation
bool ParCompMark::PluginManager::mInitialized [protected] |
The plugin manager is initialized.
Not used.
- Remarks:
- This is own attribute of this class.
Definition at line 101 of file PCMPluginManager.h.
Referenced by finalize(), getPlugin(), initialize(), PluginManager(), and ~PluginManager().
std::string ParCompMark::PluginManager::mPluginDirectory [protected] |
Plugin directory path, relative to application data directory (.
- Remarks:
- This is own attribute of this class.
Definition at line 87 of file PCMPluginManager.h.
Referenced by loadPlugins_old(), and PluginManager().
std::string ParCompMark::PluginManager::mPluginIniFile [protected] |
Name of plugin ini file placed in mPluginDirectory.
- Remarks:
- This is own attribute of this class.
Definition at line 94 of file PCMPluginManager.h.
Referenced by loadPlugins_old(), and PluginManager().
Container< Plugin, Mutex >::Pointer ParCompMark::PluginManager::mPlugins [protected] |
Container of plugins.
- Remarks:
- This is own attribute of this class.
Definition at line 80 of file PCMPluginManager.h.
Referenced by _loadPlugin(), getPlugin(), PluginManager(), and unloadPlugins().
The documentation for this class was generated from the following files: