eLynx SDK v3.3.0
C++ image processing API reference
Public Member Functions | Protected Types | Static Protected Member Functions | Protected Attributes

eLynx::PluginManager Class Reference

Base tool class for plugin management. More...

#include <PluginManager.h>

Inheritance diagram for eLynx::PluginManager:
eLynx::Image::ImageFilterManager

List of all members.

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 IPluginPackageGetPackage (size_t iIndex=0) const
 Get the package corresponding to the file index.
const IPluginPackageGetPackage (const IPlugin &iPlugin) const
 Get the package containing a requested plugin.
const IPluginPackageGetPackage (const UUID &iUUID, bool ibPlugin=false) const
 Get a package from an UUID.
const IPluginPackageGetPackage (const char *iprName, bool ibPlugin=true) const
 Get the package from a name.
const IPluginPackageGetPackageFromPackageID (const UUID &iUUID) const
const IPluginPackageGetPackageFromFilename (const char *iprFilename) const
const IPluginPackageGetPackageFromPluginName (const char *iprName) const
const IPluginPackageGetPackageFromPluginID (const UUID &iUUID) const
Plugin retrieval
size_t GetPluginCount () const
 Get the number of registred plugin.
const IPluginGetPlugin (size_t iIndex=0) const
 Get the plugin corresponding to index in registred list.
const IPluginGetPlugin (const UUID &iUUID) const
 Get the plugin by is classId.
const IPluginGetPlugin (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.

Detailed Description

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.


Constructor & Destructor Documentation

eLynx::PluginManager::PluginManager ( const UUID iFamilyType )

Default constructor.

Parameters:
iFamilyTypeThe 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.


Member Function Documentation

const IPluginPackage* eLynx::PluginManager::GetPackage ( size_t  iIndex = 0 ) const

Get the package corresponding to the file index.

Parameters:
iIndexThe package file index in range [0..GetPackageCount()-1].
Returns:
A reference pointer on the ith IPluginPackage.
const IPluginPackage* eLynx::PluginManager::GetPackage ( const IPlugin iPlugin ) const

Get the package containing a requested plugin.

Parameters:
iPluginThe requested plugin.
Returns:
A reference pointer on the IPluginPackage containing the desired plugin, NULL if the plugin is not registrered.
const IPluginPackage* eLynx::PluginManager::GetPackage ( const UUID iUUID,
bool  ibPlugin = false 
) const

Get a package from an UUID.

Parameters:
iUUIDThe UUID of the requested package.
ibPluginfalse for PackageID, true for plugin ClassID.
Returns:
A reference pointer on the IPluginPackage containing the desired package, NULL if the package is not registred.
const IPluginPackage* eLynx::PluginManager::GetPackage ( const char *  iprName,
bool  ibPlugin = true 
) const

Get the package from a name.

Parameters:
iprNameThe filename of requested package or the name of the required plugin.
ibPlugintrue if iprName is the plugin name, false if it's package filename.
Returns:
A reference pointer on the IPluginPackage containing the desired plugin, NULL if the plugin is not available from loaded packages.
size_t eLynx::PluginManager::GetPackageCount (  ) const

Get the number of registred packages.

This is the number of registred dll files.

Returns:
The number of registred plugin packages.
const IPlugin* eLynx::PluginManager::GetPlugin ( size_t  iIndex = 0 ) const

Get the plugin corresponding to index in registred list.

Parameters:
iIndexThe plugin index in range [0..GetPluginCount()-1].
Returns:
A reference pointer on the ith IPlugin.
const IPlugin* eLynx::PluginManager::GetPlugin ( const UUID iUUID ) const

Get the plugin by is classId.

Parameters:
iUUIDThe UUID of the required plugin.
Returns:
A reference pointer on the desired plugin, NULL if the plugin is not available from loaded packages.
const IPlugin* eLynx::PluginManager::GetPlugin ( const char *  iprName ) const

Get the plugin by is description string.

Parameters:
iprNameThe name of the required plugin.
Returns:
A reference pointer on the desired plugin, NULL if the plugin is not available from loaded packages.
size_t eLynx::PluginManager::GetPluginCount (  ) const

Get the number of registred plugin.

This is the total number of registred plugins.

Returns:
The number of registred plugin.
bool eLynx::PluginManager::IsEmpty (  ) const

Retrieve if at least one plugin is registred.

Returns:
true if no plugins are registred, false 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.

Parameters:
iprPathThe base path where to seach packages.
iprExtThe extension of the family type package.
bool eLynx::PluginManager::RegisterFile ( const char *  iprFilename )

Register a plugin package in the managed list.

Parameters:
iprFilenameThe package file to register.
Returns:
true if succeeded, false otherwise.
bool eLynx::PluginManager::Unregister ( const IPlugin iprPlugin )

Unregister a plugin.

Parameters:
iprPluginThe plugin to unregister.
Returns:
true if succeeded, false otherwise.
bool eLynx::PluginManager::Unregister ( const IPluginPackage iprPackage )

Unregister a package, and his associated registered plugins.

Parameters:
iprPackageThe package to unregister.
Returns:
true if succeeded, false otherwise.
bool eLynx::PluginManager::UnregisterPackage ( const char *  iprFilename )

Unregister a package from his filename.

Parameters:
iprFilenameThe package filename.
Returns:
true if succeeded, false otherwise.
bool eLynx::PluginManager::UnregisterPackage ( const UUID iUUID )

Unregister a package from his UUID.

Parameters:
iUUIDThe package UUID.
Returns:
true if succeeded, false otherwise.
bool eLynx::PluginManager::UnregisterPlugin ( const UUID iUUID )

Unregister a plugin from his UUID.

Parameters:
iUUIDThe UUID that identifie the plugin to unregister.
Returns:
true if succeeded, false otherwise.
bool eLynx::PluginManager::UnregisterPlugin ( const char *  iprName )

Unregister a plugin from his name.

Parameters:
iprNameThe plugin name.
Returns:
true if succeeded, false otherwise.

The documentation for this class was generated from the following file:

Generated on Thu Dec 9 2010 by doxygen 1.7.2