Plug-in Manager. More...
#include <gpluginmanager.h>
Public Types | |
enum | tPluginsType { ptSelect, ptOrdered, ptList, ptListSelect } |
Public Member Functions | |
GPlugInManager (const R::RString &name, tPluginsType type) | |
R::RString | GetName (void) const |
R::RString | GetVersion (void) const |
tPluginsType | GetPlugInType (void) const |
int | Compare (const GPlugInManager &pmng) const |
int | Compare (const R::RString &name) const |
void | ReOrder (void) |
void | Load (const R::RString &dll, void *handle, void *handleDlg) |
void | Create (GSession *session) |
void | Disconnect (GSession *session) |
void | Delete (void) |
void | CreateConfig (R::RConfig *config) |
void | ReadConfig (R::RConfig *config) |
void | SaveConfig (R::RConfig *config) |
void | InitPlugIns (GSession *session) |
void | RegisterPlugIn (GPlugIn *plugin, bool enable) |
R::RCursor< GPlugInList > | GetPlugInLists (void) const |
GPlugInList * | GetPlugInList (const R::RString &list, int need=1) const |
GPlugInFactory * | GetFactory (const R::RString &name, const R::RString &list, int need=1) const |
GPlugInFactory * | GetFactory (const R::RString &name, int need=1) const |
size_t | GetNbFactories (const R::RString &list=R::RString::Null) const |
R::RCursor< GPlugInFactory > | GetFactories (const R::RString &list=R::RString::Null) const |
size_t | GetNbPlugIns (const R::RString &list=R::RString::Null) const |
template<class plugin > | |
plugin * | GetPlugIn (const R::RString &name, const R::RString &list, int need=1) const |
template<class plugin > | |
plugin * | GetPlugIn (const R::RString &name, int need=1) const |
template<class plugin > | |
R::RCastCursor< GPlugIn, plugin > | GetPlugIns (const R::RString &list=R::RString::Null) const |
void | SetCurrentPlugIn (const R::RString &name, const R::RString &list, int need=1) |
void | SetCurrentPlugIn (const R::RString &name, int need=1) |
template<class plugin > | |
plugin * | GetCurrentPlugIn (const R::RString &list, int need=1) const |
template<class plugin > | |
plugin * | GetCurrentPlugIn (int need=1) const |
GPlugInFactory * | GetCurrentFactory (const R::RString &list, int need=1) const |
GPlugInFactory * | GetCurrentFactory (int need=1) const |
virtual | ~GPlugInManager (void) |
Protected Attributes | |
R::RString | Name |
R::RString | Version |
tPluginsType | PluginsType |
union { | |
GPlugInList * List | |
R::RContainer< GPlugInList, true, true > * Lists | |
} | Data |
Detailed Description
Plug-in Manager.
The GPlugInManager class provides a plug-in manager (for example, a list of storages). There are different kind of plug-in manager depending on how their plug-ins are treated:
- A list of plug-ins where one is the current one.
- A list of plug-ins to execute in a given order.
- A simple list of plug-ins.
- Multiple lists of plug-ins with, for each list, a current plug-in (in particular for GMeasure plug-ins).
Several template methods are provided to get a plug-in, to get a cursor over plug-ins or to get the current one.
Member Enumeration Documentation
enum tPluginsType |
Constructor & Destructor Documentation
GPlugInManager | ( | const R::RString & | name, |
tPluginsType | type | ||
) |
Constructor for the manager of plug-ins manager.
- Parameters
-
name Name of the manager. type Type of the manager.
|
virtual |
Destructor the plug-ins manager.
Member Function Documentation
R::RString GetName | ( | void | ) | const |
Get the name of the current Manager.
R::RString GetVersion | ( | void | ) | const |
Get the version of the current Manager.
tPluginsType GetPlugInType | ( | void | ) | const |
Get the type of the plug-ins.
int Compare | ( | const GPlugInManager & | pmng | ) | const |
Comparison method needed by R::RContainer.
- Parameters
-
pmng Plug-ins manager to compare.
int Compare | ( | const R::RString & | name | ) | const |
Comparison method needed by R::RContainer.
- Parameters
-
name Name to compare.
void ReOrder | ( | void | ) |
ReOrder the containers of the manager. This method must be called if the level of a plug-in changes, and works only with an ordered list of plug-ins.
void Load | ( | const R::RString & | dll, |
void * | handle, | ||
void * | handleDlg | ||
) |
Load a plug-in and its dialog boxes.
- Parameters
-
dll Name of the dynamic link library. handle Handle to the library of the plug-in. handleDlg Handle to the library of the dialogs.
void Create | ( | GSession * | session | ) |
Create the plug-ins for a given session.
- Parameters
-
session Pointer to the session.
void Disconnect | ( | GSession * | session | ) |
Disconnect the plug-ins for a given session.
void Delete | ( | void | ) |
Delete the plug-ins.
void CreateConfig | ( | R::RConfig * | config | ) |
Create the configuration parameters in the configuration structure.
- Parameters
-
config Configuration structure.
void ReadConfig | ( | R::RConfig * | config | ) |
Read the configuration parameters from the configuration structure.
- Parameters
-
config Configuration structure.
void SaveConfig | ( | R::RConfig * | config | ) |
Save the configuration parameters in the configuration structure.
- Parameters
-
config Configuration structure.
void InitPlugIns | ( | GSession * | session | ) |
Initialize the different plug-ins.
- Parameters
-
session Session.
void RegisterPlugIn | ( | GPlugIn * | plugin, |
bool | enable | ||
) |
Register a plug-in as enabled or not.
- Parameters
-
plugin Plugin. enable Enabled ?
R::RCursor<GPlugInList> GetPlugInLists | ( | void | ) | const |
- Returns
- List of the plug-ins list if supported, or an empty cursor.
GPlugInList* GetPlugInList | ( | const R::RString & | list, |
int | need = 1 |
||
) | const |
- Returns
- a given plug-ins list.
- Parameters
-
list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
GPlugInFactory* GetFactory | ( | const R::RString & | name, |
const R::RString & | list, | ||
int | need = 1 |
||
) | const |
Get a pointer to a given GPlugInFactory.
- Parameters
-
name Name of the GPlugInFactory. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
- Returns
- Pointer to the GPlugInFactory, or null/exception if the GPlugInFactory does not exist.
GPlugInFactory* GetFactory | ( | const R::RString & | name, |
int | need = 1 |
||
) | const |
Get a pointer to a given GPlugInFactory.
- Parameters
-
name Name of the GPlugInFactory. need If the parameter is non-null and the plug-in does doesn't exist, generate an exception.
- Returns
- Pointer to the GPlugInFactory, or null/exception if the GPlugInFactory does not exist.
size_t GetNbFactories | ( | const R::RString & | list = R::RString::Null | ) | const |
Get the number of factories registered.
- Parameters
-
list List.
R::RCursor<GPlugInFactory> GetFactories | ( | const R::RString & | list = R::RString::Null | ) | const |
Get a cursor over the registered factories.
- Parameters
-
list List.
size_t GetNbPlugIns | ( | const R::RString & | list = R::RString::Null | ) | const |
Get the number of enabled plug-ins.
- Parameters
-
list List.
plugin* GetPlugIn | ( | const R::RString & | name, |
const R::RString & | list, | ||
int | need = 1 |
||
) | const |
Get a pointer to a given plug-in.
- Parameters
-
name Name of the plug-in. list List. need If the parameter is not-null and the plug-in doesn't exist, generate an exception.
- Returns
- Pointer to the plug-in, or null/exception if the name does not exist.
plugin* GetPlugIn | ( | const R::RString & | name, |
int | need = 1 |
||
) | const |
Get a pointer to a given plug-in.
- Parameters
-
name Name of the plug-in. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
- Returns
- Pointer to the plug-in, or null/exception if the name does not exist.
R::RCastCursor<GPlugIn,plugin> GetPlugIns | ( | const R::RString & | list = R::RString::Null | ) | const |
Get a cursor over the enabled plug-ins.
- Parameters
-
list List.
void SetCurrentPlugIn | ( | const R::RString & | name, |
const R::RString & | list, | ||
int | need = 1 |
||
) |
Set the current method if the plug-ins must have a selected one. An exception is generated if list doesn't exists, the plug-in doesn't exist or is not enabled
- Parameters
-
name Name of the method. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
void SetCurrentPlugIn | ( | const R::RString & | name, |
int | need = 1 |
||
) |
Set the current method if the plug-ins must have a selected one.
- Parameters
-
name Name of the method. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
plugin* GetCurrentPlugIn | ( | const R::RString & | list, |
int | need = 1 |
||
) | const |
Get the current plug-in in a list.
- Parameters
-
list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
- Returns
- Pointer to the GPlugIn, or null/exception if no plug-in is selected or if the list does not need to select one.
plugin* GetCurrentPlugIn | ( | int | need = 1 | ) | const |
Get the current plug-in in a list.
- Parameters
-
need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
- Returns
- Pointer to the GPlugIn, or null/exception if no plug-in is selected or if the list does not need to select one.
GPlugInFactory* GetCurrentFactory | ( | const R::RString & | list, |
int | need = 1 |
||
) | const |
Get the current GPlugInFactory.
- Parameters
-
list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
- Returns
- Pointer to the GPlugInFactory, or null/exception if no plug-in is selected or if the list does not need to select one.
GPlugInFactory* GetCurrentFactory | ( | int | need = 1 | ) | const |
Get the current GPlugInFactory.
- Parameters
-
need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
- Returns
- Pointer to the GPlugInFactory, or null/exception if no plug-in is selected or if the list does not need to select one.
Member Data Documentation
|
protected |
Name of the manager.
|
protected |
Version of the manager.
|
protected |
Types of plug-ins handle by the manager.
GPlugInList* List |
R::RContainer<GPlugInList,true,true>* Lists |
union { ... } Data |
Plug-ins managed.