Generic Plug-in Factory. More...

#include <gplugin.h>

Inheritance diagram for GPlugInFactory:
[legend]

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
 
GPlugInManagerGetMng (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 GPlugInNewPlugIn (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
 
GPlugInManagerGetMng (void)
 
GPlugInGetPlugIn (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
 
GPlugInManagerMng
 
GSessionSession
 
GPlugInPlugin
 
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
mngManager of the plug-in.
nameName of the Factory/Plug-in ('/' are replaced by '-' for the configuration file).
descDescription of the plug-in.
libLibrary of the Factory/Plug-in.
listList of the plug-in. Must be a null string if the plug-in is not part of multiple lists.
virtual ~GPlugInFactory ( void  )
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
levelLevel 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
dlgParam to the function.
void SetConfig ( void *  dlg)

Set the configure box.

Parameters
dlgParam to the function.
void SetHandler ( void *  handle)

Set the handler of the library.

Parameters
handleHandle of the library.
void SetDlgHandler ( void *  handleDlg)

Set the Handler of the library containing the dialog box.

Parameters
handleDlgHandle of the dialog library
int Compare ( const GPlugInFactory f) const

Comparison method needed by R::RContainer.

Parameters
fFactory to compare.
int Compare ( const R::RString name) const

Comparison method needed by R::RContainer.

Parameters
nameName to compare.
int Compare ( const size_t  level) const

Comparison method needed by R::RContainer.

Parameters
levelLevel to compare.
virtual GPlugIn* NewPlugIn ( GSession session)
pure virtual

Create the new plug-in.

Parameters
sessionSession.
void Create ( GSession session)

Create a plug-in.

Parameters
sessionSession.
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
paramParameter.
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.

virtual const char* GetAPIVersion ( void  ) const
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

R::RString Name
protected

Name of the plug-in.

R::RString Desc
protected

Description of the plug-in.

int Level
protected

Specific order of the plug-in in the list.

GPlugInManager* Mng
protected

Plug-in Manager associated.

GSession* Session
protected

Current session.

GPlugIn* Plugin
protected

Pointer to the plug-in.

R::RString Lib
protected

File of the library.

About_t AboutDlg
protected

Pointer to a function showing the about box.

void* ConfigDlg
protected

Pointer to a function showing the configure box.

Parameters
fFactory of the plug-in to configure.
void* Handle
protected

The Handle(void *) to maintain the handler for the opened library.

void* HandleDlg
protected

The Handle(void *) to maintain the handler for the opened library.

R::RString List
protected

Name of the corresponding (if any) list.