Functions. More...
#include <gfunction.h>
Public Member Functions | |
GFunction (GSession *session, GPlugInFactory *fac) | |
virtual void | Call (size_t number, void *param, void *ret)=0 |
virtual R::RString | Info (size_t info) |
virtual | ~GFunction (void) |
Public Member Functions inherited from GPlugIn | |
GPlugIn (GSession *session, GPlugInFactory *fac) | |
virtual void | ApplyConfig (void) |
void | InsertParam (R::RParam *param) |
template<class T > | |
T * | FindParam (const R::RString &name) |
R::RCursor< R::RParam > | GetParams (const R::RString &cat=R::RString::Null) |
void | GetCategories (R::RContainer< R::RString, true, false > &cats) |
virtual void | Init (void) |
virtual void | CreateConfig (void) |
virtual void | Reset (void) |
GPlugInFactory * | GetFactory (void) const |
int | Compare (const GPlugIn &plugin) const |
int | Compare (const R::RString &plugin) const |
R::RString | GetName (void) const |
R::RString | GetDesc (void) const |
GSession * | GetSession (void) const |
virtual void | Done (void) |
virtual | ~GPlugIn (void) |
Additional Inherited Members | |
Protected Attributes inherited from GPlugIn | |
GPlugInFactory * | Factory |
GSession * | Session |
size_t | Id |
Detailed Description
Functions.
The GFunction class provides a representation for a specific function (for example a dictionary that returns if a given word is contained in it).
See the documentation related to GPlugIn for more general information.
Constructor & Destructor Documentation
GFunction | ( | GSession * | session, |
GPlugInFactory * | fac | ||
) |
Constructor of a function.
- Parameters
-
session Session. fac Plug-in factory.
|
virtual |
Destruct the function.
Member Function Documentation
|
pure virtual |
Call a function. Both pointers are untyped : it is the responsibility of the caller to send the right type for the parameters and to correctly interpret the corresponding response.
In practice, a number is associated to a call in order to implement multiple functions in one plug-in for efficiency (for example because all functions need a same memory consuming structure).
Suppose that the method takes a string as first parameter and returns its length. This method should be written:
The method should be call:
When multiple parameters must be passed to the function, it is necessary to pass one pointer to a structure that contains them.
- Parameters
-
number Number of the particular function called. param Pointer to the parameter. ret Pointer to the result returned.
|
virtual |
Exchange a particular information with the plug-in.
- Parameters
-
info Information to get.