Generic Plug-in Factory. More...
#include <gplugin.h>
Public Types | |
typedef void(* | About_t )() |
typedef bool *(* | Configure_t )(GPlugIn *) |
Public Member Functions | |
GPlugInFactory (GPlugInManager *mng, const R::RString &name, const R::RString &desc, const R::RString &lib, const R::RString &list) | |
int | GetLevel (void) const |
void | SetLevel (int level) |
R::RString | GetName (void) const |
R::RString | GetDesc (void) const |
R::RString | GetList (void) const |
GPlugInManager * | GetMng (void) const |
void | SetAbout (About_t dlg) |
void | SetConfig (void *dlg) |
void | SetHandler (void *handle) |
void | SetDlgHandler (void *handleDlg) |
int | Compare (const GPlugInFactory &f) const |
int | Compare (const R::RString &name) const |
int | Compare (const size_t level) const |
virtual GPlugIn * | NewPlugIn (GSession *session)=0 |
void | Create (GSession *session) |
void | Delete (void) |
void | About (void) |
void | Configure (void) |
void | InsertParam (R::RParam *param) |
void | ApplyConfig (void) |
bool | HasAbout (void) const |
bool | HasConfigure (void) const |
virtual const char * | GetAPIVersion (void) const =0 |
GPlugInManager * | GetMng (void) |
GPlugIn * | GetPlugIn (void) const |
template<class plugin > | |
plugin * | GetPlugIn (void) const |
bool | IsCreated (void) const |
R::RString | GetLib (void) const |
const char * | GetVersion (void) const |
virtual | ~GPlugInFactory (void) |
Protected Attributes | |
R::RString | Name |
R::RString | Desc |
int | Level |
GPlugInManager * | Mng |
GSession * | Session |
GPlugIn * | Plugin |
R::RString | Lib |
About_t | AboutDlg |
void * | ConfigDlg |
void * | Handle |
void * | HandleDlg |
R::RString | List |
Detailed Description
Generic Plug-in Factory.
The GPlugInFactory class provides a template for a generic plug-in factory. A factory handles the loading of the dynamic library containing the plug-in.
Member Typedef Documentation
typedef void(* About_t)() |
Type of a function used to show the about box of a plug-in.
typedef bool*(* Configure_t)(GPlugIn *) |
Type of a function used to show dialog box of a plug-in.
Constructor & Destructor Documentation
GPlugInFactory | ( | GPlugInManager * | mng, |
const R::RString & | name, | ||
const R::RString & | desc, | ||
const R::RString & | lib, | ||
const R::RString & | list | ||
) |
Constructor.
- Parameters
-
mng Manager of the plug-in. name Name of the Factory/Plug-in ('/' are replaced by '-' for the configuration file). desc Description of the plug-in. lib Library of the Factory/Plug-in. list List of the plug-in. Must be a null string if the plug-in is not part of multiple lists.
|
virtual |
Destruct the factory.
Member Function Documentation
int GetLevel | ( | void | ) | const |
Get the level of the plug-in.
void SetLevel | ( | int | level | ) |
Set the level of the plug-in.
- Parameters
-
level Level of the plug-in.
R::RString GetName | ( | void | ) | const |
Name of the plug-in.
R::RString GetDesc | ( | void | ) | const |
Description of the plug-in.
R::RString GetList | ( | void | ) | const |
Get the name of the list.
GPlugInManager* GetMng | ( | void | ) | const |
Get the manager of the factory.
- Returns
- Pointer to the manager.
void SetAbout | ( | About_t | dlg | ) |
Set the about box.
- Parameters
-
dlg Param to the function.
void SetConfig | ( | void * | dlg | ) |
Set the configure box.
- Parameters
-
dlg Param to the function.
void SetHandler | ( | void * | handle | ) |
Set the handler of the library.
- Parameters
-
handle Handle of the library.
void SetDlgHandler | ( | void * | handleDlg | ) |
Set the Handler of the library containing the dialog box.
- Parameters
-
handleDlg Handle of the dialog library
int Compare | ( | const GPlugInFactory & | f | ) | const |
Comparison method needed by R::RContainer.
- Parameters
-
f Factory to compare.
int Compare | ( | const R::RString & | name | ) | const |
Comparison method needed by R::RContainer.
- Parameters
-
name Name to compare.
int Compare | ( | const size_t | level | ) | const |
Comparison method needed by R::RContainer.
- Parameters
-
level Level to compare.
Create the new plug-in.
- Parameters
-
session Session.
void Create | ( | GSession * | session | ) |
Create a plug-in.
- Parameters
-
session Session.
void Delete | ( | void | ) |
Delete a plug-in.
void About | ( | void | ) |
Show 'about' information.
void Configure | ( | void | ) |
Configure the parameters.
void InsertParam | ( | R::RParam * | param | ) |
Declare a new parameter. If it exist, the parameter passed as argument is deleted.
- Parameters
-
param Parameter.
void ApplyConfig | ( | void | ) |
Apply the configuration eventually to the plug-in.
bool HasAbout | ( | void | ) | const |
Specify if an about box exist.
bool HasConfigure | ( | void | ) | const |
Specify if a configure box exist.
|
pure virtual |
Get the API Version of the plug-in.
- Returns
- C String.
GPlugInManager* GetMng | ( | void | ) |
Return the manager of the plug-in.
GPlugIn* GetPlugIn | ( | void | ) | const |
Get the plug-in of this factory.
plugin* GetPlugIn | ( | void | ) | const |
Get the plug-in of this factory.
bool IsCreated | ( | void | ) | const |
Specify if the plug-in is created.
R::RString GetLib | ( | void | ) | const |
Get the library of the plug-in.
const char* GetVersion | ( | void | ) | const |
Return the version of the plug-in.
Member Data Documentation
|
protected |
Name of the plug-in.
|
protected |
Description of the plug-in.
|
protected |
Specific order of the plug-in in the list.
|
protected |
Plug-in Manager associated.
|
protected |
Current session.
|
protected |
Pointer to the plug-in.
|
protected |
File of the library.
|
protected |
Pointer to a function showing the about box.
|
protected |
Pointer to a function showing the configure box.
- Parameters
-
f Factory of the plug-in to configure.
|
protected |
The Handle(void *) to maintain the handler for the opened library.
|
protected |
The Handle(void *) to maintain the handler for the opened library.
|
protected |
Name of the corresponding (if any) list.