eLynx SDK
v3.3.0 C++ image processing API reference |
Base tool class for plugin management. More...
#include <PluginManager.h>
Public Member Functions | |
PluginManager (const UUID &iFamilyType) | |
Default constructor. | |
virtual | ~PluginManager () |
Destructor. | |
Registration | |
bool | IsEmpty () const |
Retrieve if at least one plugin is registred. | |
void | Register (const char *iprPath, const char *iprExt) |
Register all package adhering to the family type, in the given path, with the given file extension. | |
bool | RegisterFile (const char *iprFilename) |
Register a plugin package in the managed list. | |
void | Unregister () |
Unregister all packages and all plugins. | |
bool | Unregister (const IPluginPackage *iprPackage) |
Unregister a package, and his associated registered plugins. | |
bool | Unregister (const IPlugin *iprPlugin) |
Unregister a plugin. | |
bool | UnregisterPackage (const char *iprFilename) |
Unregister a package from his filename. | |
bool | UnregisterPackage (const UUID &iUUID) |
Unregister a package from his UUID. | |
bool | UnregisterPlugin (const char *iprName) |
Unregister a plugin from his name. | |
bool | UnregisterPlugin (const UUID &iUUID) |
Unregister a plugin from his UUID. | |
Package retrieval | |
size_t | GetPackageCount () const |
Get the number of registred packages. | |
const IPluginPackage * | GetPackage (size_t iIndex=0) const |
Get the package corresponding to the file index. | |
const IPluginPackage * | GetPackage (const IPlugin &iPlugin) const |
Get the package containing a requested plugin. | |
const IPluginPackage * | GetPackage (const UUID &iUUID, bool ibPlugin=false) const |
Get a package from an UUID. | |
const IPluginPackage * | GetPackage (const char *iprName, bool ibPlugin=true) const |
Get the package from a name. | |
const IPluginPackage * | GetPackageFromPackageID (const UUID &iUUID) const |
const IPluginPackage * | GetPackageFromFilename (const char *iprFilename) const |
const IPluginPackage * | GetPackageFromPluginName (const char *iprName) const |
const IPluginPackage * | GetPackageFromPluginID (const UUID &iUUID) const |
Plugin retrieval | |
size_t | GetPluginCount () const |
Get the number of registred plugin. | |
const IPlugin * | GetPlugin (size_t iIndex=0) const |
Get the plugin corresponding to index in registred list. | |
const IPlugin * | GetPlugin (const UUID &iUUID) const |
Get the plugin by is classId. | |
const IPlugin * | GetPlugin (const char *iprName) const |
Get the plugin by is description string. | |
Protected Types | |
typedef std::map< const IPlugin *, const IPluginPackage * > | PluginMap |
List of available plugins with associated package. | |
Static Protected Member Functions | |
static bool | FileEnumCallback (const char *iprFilename, void *iprUserData) |
Protected Attributes | |
UUID | _familyType |
Plugins family type. | |
std::vector< PluginFile * > | _files |
Package files are aggregated. | |
PluginMap | _plugins |
Plugins are referenced. |
Base tool class for plugin management.
This is the base class to manage plugin packages and plugins. A PluginManager can only manages plugin packages and plugins of same family type define by an UUID.
eLynx::PluginManager::PluginManager | ( | const UUID & | iFamilyType ) |
Default constructor.
iFamilyType | The UUID that uniquely identity a package family type. While Register is not called the manager can't retrieve any plugin. |
virtual eLynx::PluginManager::~PluginManager | ( | ) | [virtual] |
Destructor.
Unregister all packages.
const IPluginPackage* eLynx::PluginManager::GetPackage | ( | size_t | iIndex = 0 ) |
const |
Get the package corresponding to the file index.
iIndex | The package file index in range [0..GetPackageCount()-1]. |
const IPluginPackage* eLynx::PluginManager::GetPackage | ( | const IPlugin & | iPlugin ) | const |
Get the package containing a requested plugin.
iPlugin | The requested plugin. |
const IPluginPackage* eLynx::PluginManager::GetPackage | ( | const UUID & | iUUID, |
bool | ibPlugin = false |
||
) | const |
Get a package from an UUID.
iUUID | The UUID of the requested package. |
ibPlugin | false for PackageID, true for plugin ClassID. |
const IPluginPackage* eLynx::PluginManager::GetPackage | ( | const char * | iprName, |
bool | ibPlugin = true |
||
) | const |
Get the package from a name.
iprName | The filename of requested package or the name of the required plugin. |
ibPlugin | true if iprName is the plugin name, false if it's package filename. |
size_t eLynx::PluginManager::GetPackageCount | ( | ) | const |
Get the number of registred packages.
This is the number of registred dll files.
const IPlugin* eLynx::PluginManager::GetPlugin | ( | size_t | iIndex = 0 ) |
const |
Get the plugin corresponding to index in registred list.
iIndex | The plugin index in range [0..GetPluginCount()-1]. |
Get the plugin by is classId.
iUUID | The UUID of the required plugin. |
const IPlugin* eLynx::PluginManager::GetPlugin | ( | const char * | iprName ) | const |
Get the plugin by is description string.
iprName | The name of the required plugin. |
size_t eLynx::PluginManager::GetPluginCount | ( | ) | const |
Get the number of registred plugin.
This is the total number of registred plugins.
bool eLynx::PluginManager::IsEmpty | ( | ) | const |
Retrieve if at least one plugin is registred.
void eLynx::PluginManager::Register | ( | const char * | iprPath, |
const char * | iprExt | ||
) |
Register all package adhering to the family type, in the given path, with the given file extension.
iprPath | The base path where to seach packages. |
iprExt | The extension of the family type package. |
bool eLynx::PluginManager::RegisterFile | ( | const char * | iprFilename ) |
Register a plugin package in the managed list.
iprFilename | The package file to register. |
bool eLynx::PluginManager::Unregister | ( | const IPlugin * | iprPlugin ) |
Unregister a plugin.
iprPlugin | The plugin to unregister. |
bool eLynx::PluginManager::Unregister | ( | const IPluginPackage * | iprPackage ) |
Unregister a package, and his associated registered plugins.
iprPackage | The package to unregister. |
bool eLynx::PluginManager::UnregisterPackage | ( | const char * | iprFilename ) |
Unregister a package from his filename.
iprFilename | The package filename. |
bool eLynx::PluginManager::UnregisterPackage | ( | const UUID & | iUUID ) |
bool eLynx::PluginManager::UnregisterPlugin | ( | const UUID & | iUUID ) |
bool eLynx::PluginManager::UnregisterPlugin | ( | const char * | iprName ) |
Unregister a plugin from his name.
iprName | The plugin name. |