#include <rrPlugin.h>
Public Member Functions | |
Plugin (const string &name=gEmptyString, const string &cat=gNoneString, RoadRunner *aRR=NULL, const string &language=gNoneString, const PluginManager *pm=NULL) | |
virtual | ~Plugin () |
string | getName () |
string | getLibraryName () |
string | getAuthor () |
string | getCategory () |
string | getVersion () |
string | getCopyright () |
RoadRunner * | getRoadRunnerInstance () |
virtual string | getInfo () |
virtual string | getExtendedInfo () |
virtual unsigned char * | getManualAsPDF () const |
virtual unsigned int | getPDFManualByteSize () |
Parameters * | getParameters () |
StringList | getParameterNames () |
string | getPluginPropertiesAsXML () |
PluginParameter * | getParameter (const string ¶m, const string &capability="") |
PluginParameter * | getParameter (const string ¶m, Capability &capability) |
bool | setParameter (const string &nameOf, const char *value) |
bool | setParameter (const string &nameOf, const char *value, Capability &capability) |
void | terminate () |
bool | isBeingTerminated () |
bool | wasTerminated () |
check if the plugin was terminated | |
virtual bool | isWorking () |
check if the plugin is working | |
bool | assignRoadRunnerInstance (RoadRunner *rr) |
Assign a roadrunner instance for the plugin to use. | |
virtual bool | assignOnStartedEvent (PluginEvent pluginStarted, void *userData1=NULL, void *userData2=NULL) |
virtual bool | assignOnProgressEvent (PluginEvent pluginsProgress, void *userData1=NULL, void *userData2=NULL) |
virtual bool | assignOnFinishedEvent (PluginEvent pluginsFinished, void *userData1=NULL, void *userData2=NULL) |
virtual string | getResult () |
virtual bool | resetPlugin () |
virtual bool | assignInput (void *data) |
virtual string | getStatus () |
virtual string | getImplementationLanguage ()=0 |
virtual bool | execute (bool inAThread=false)=0 |
Protected Member Functions | |
void | setLibraryName (const string &libName) |
Protected Attributes | |
string | mName |
Name of Plugin. | |
string | mLibraryName |
Name of compiled shared library implementing the Plugin. | |
string | mAuthor |
Name of plugin author(s) | |
string | mCategory |
Plugin category. | |
string | mVersion |
Plugin version. | |
string | mCopyright |
Plugin copyright language. | |
string | mImplementationLanguage |
Plugin implementation language. | |
bool | mTerminate |
Boolean flag indicating if a user wants to terminate the work in a plugin. | |
bool | mIsWorking |
Boolean flag indicating if the plugin is working. | |
RoadRunner * | mRR |
const PluginManager * | mPM |
PluginEvent | mWorkStartedEvent |
PluginEvent | mWorkProgressEvent |
PluginEvent | mWorkFinishedEvent |
void * | mWorkStartedData1 |
void * | mWorkStartedData2 |
void * | mWorkProgressData1 |
void * | mWorkProgressData2 |
void * | mWorkFinishedData1 |
void * | mWorkFinishedData2 |
Capabilities | mCapabilities |
void * | mClientData |
The Plugin class is a base class for all RoadRunner plugins. A Plugin is implemented in a shared library, e.g. a DLL on Windows, and loaded at runtime by a PluginManager. Any RoadRunner Plugin need to inherit from the Plugin class or any of its descendants. Here are the main characteristics of a Plugin:
rrp::Plugin::Plugin | ( | const string & | name = gEmptyString , |
const string & | cat = gNoneString , |
||
RoadRunner * | aRR = NULL , |
||
const string & | language = gNoneString , |
||
const PluginManager * | pm = NULL |
||
) |
Create a plugin
|
virtual |
Destroy the plugin.
|
virtual |
Function allowing opaque data being passed to a plugin. This
|
virtual |
Assign function pointer and data the event
|
virtual |
Assign function pointer and data the event
|
virtual |
Assign function pointer and data the event
|
pure virtual |
Execute the plugin
Implemented in rrp::CPlugin.
string rrp::Plugin::getAuthor | ( | ) |
Get the name of plugin author(s)
string rrp::Plugin::getCategory | ( | ) |
Get plugin category
string rrp::Plugin::getCopyright | ( | ) |
Get plugin copyright text
|
virtual |
Retrieve more information than getInfo()
|
pure virtual |
Retrieve the implementation language of the plugin.
Implemented in rrp::CPlugin, and rrp::CPPPlugin.
|
virtual |
Retrieves various plugin information
string rrp::Plugin::getLibraryName | ( | ) |
Get the name of the compiled shared library that implemements the plugin.
|
virtual |
Retrieve a plugins documentation embedded as PDF. May be NULL
string rrp::Plugin::getName | ( | ) |
Get the name of the plugin.
PluginParameter * rrp::Plugin::getParameter | ( | const string & | param, |
const string & | capability = "" |
||
) |
Retieves a specific parameter, in a specific capability.
PluginParameter * rrp::Plugin::getParameter | ( | const string & | param, |
Capability & | capability | ||
) |
Retieves a specific parameter, in a specific capability.
StringList rrp::Plugin::getParameterNames | ( | ) |
Retieves the names of the parameters
Parameters * rrp::Plugin::getParameters | ( | ) |
Retieves the parameters
|
virtual |
Retrieve the size in bytes of the PDF string.
string rrp::Plugin::getPluginPropertiesAsXML | ( | ) |
Retieves a plugin properties, as XML
|
virtual |
Function returnin a plugins "result", as a string
RoadRunner * rrp::Plugin::getRoadRunnerInstance | ( | ) |
Retrieves the RoadRunner instance the plugin is using. Can be NULL.
|
virtual |
Retrieve the status of the plugin.
string rrp::Plugin::getVersion | ( | ) |
Get plugin version information
bool rrp::Plugin::isBeingTerminated | ( | ) |
Check if the plugin worker is in the process of being terminated
|
virtual |
Reset the plugin.
|
protected |
Set the name of the shared library
bool rrp::Plugin::setParameter | ( | const string & | nameOf, |
const char * | value | ||
) |
Sets the value of specified Parameter with value as specified
bool rrp::Plugin::setParameter | ( | const string & | nameOf, |
const char * | value, | ||
Capability & | capability | ||
) |
Sets the value of specified Parameter with value as specified
void rrp::Plugin::terminate | ( | ) |
If the work of the plugin is carried out in a separate thread, terminate() will signal termination of such work.
|
protected |
Capabilities container. Descendant add capabilites to this container, as they wish. It is basically a container for parameter data that can be exchanged to/from the plugin by using parameters
|
protected |
Opaque data pointer. Plugin designer may use this to communicat data of any type out/in to the plugin using the assignPluginInput() function.
|
protected |
A pointer to the PluginManager that loaded the Plugin uses.
|
protected |
A pointer to a RoadRunner instance which the plugin uses.
|
protected |
Opaque data parameter 1 passed in the WorkFinished event function
|
protected |
Opaque data parameter 2 passed in the WorkFinished event function
|
protected |
WorkFinished event function pointer
|
protected |
Opaque data parameter 1 passed in the WorkProgress event function
|
protected |
Opaque data parameter 2 passed in the WorkProgress event function
|
protected |
Work In progress event function pointer
|
protected |
Opaque data parameter 1 passed in the WorkStarted event function
|
protected |
Opaque data parameter 2 passed in the WorkStarted event function
|
protected |
WorkStarted event function pointer