#include <telPlugin.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 | getDescription () |
string | getHint () |
string | getVersion () |
string | getCopyright () |
RoadRunner * | getRoadRunnerInstance () |
virtual string | getInfo () |
virtual string | getExtendedInfo () |
virtual unsigned char * | getManualAsPDF () const |
virtual unsigned int | getPDFManualByteSize () |
virtual Properties * | getProperties () |
virtual tlp::StringList | getPropertyNames () |
string | getPluginPropertiesAsXML () |
virtual PropertyBase * | getProperty (const string ¶m) |
string | getPropertyValueAsString (const string ¶m) |
void * | getPropertyValueHandle (const string ¶m) |
void | setPropertyByString (const string &nameOf, const char *value) |
void | setPropertyValue (const string &nameOf, const void *value) |
void | terminate () |
bool | isBeingTerminated () const |
bool | wasTerminated () const |
check if the plugin was terminated | |
virtual bool | isWorking () const |
check if the plugin is working | |
virtual 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 string | getStatus () |
virtual string | getImplementationLanguage ()=0 |
bool | hasStartedEvent () const |
bool | hasProgressEvent () const |
bool | hasFinishedEvent () const |
void | WorkStartedEvent (void *data1, void *data2) |
void | WorkProgressEvent (void *data1, void *data2) |
void | WorkFinishedEvent (void *data1, void *data2) |
pair< void *, void * > | getWorkStartedData () |
pair< void *, void * > | getWorkProgressData () |
pair< void *, void * > | getWorkFinishedData () |
virtual bool | execute (bool inAThread=false)=0 |
const PluginManager * | getPluginManager () |
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 | mDescription |
Plugin description. | |
string | mHint |
Plugin Hint. | |
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 |
Properties | mProperties |
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:
tlp::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 |
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 tlp::CPlugin.
string tlp::Plugin::getAuthor | ( | ) |
Get the name of plugin author(s)
string tlp::Plugin::getCategory | ( | ) |
Get plugin category
string tlp::Plugin::getCopyright | ( | ) |
Get plugin copyright text
string tlp::Plugin::getDescription | ( | ) |
Get plugin description
|
virtual |
Retrieve more information than getInfo()
string tlp::Plugin::getHint | ( | ) |
Get plugin Hint
|
pure virtual |
Retrieve the implementation language of the plugin.
Implemented in tlp::CPlugin, and tlp::CPPPlugin.
|
virtual |
Retrieves various plugin information
string tlp::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 tlp::Plugin::getName | ( | ) |
Get the name of the plugin.
|
virtual |
Retrieve the size in bytes of the PDF string.
const PluginManager * tlp::Plugin::getPluginManager | ( | ) |
Get a pointer to the plugins manager
string tlp::Plugin::getPluginPropertiesAsXML | ( | ) |
Retieves a plugin properties, as XML
|
virtual |
Retieves the propertys
|
virtual |
Retieves a specific property
Reimplemented in tlp::CPlugin.
|
virtual |
Retieves the names of the propertys
Reimplemented in tlp::CPlugin.
string tlp::Plugin::getPropertyValueAsString | ( | const string & | param) |
Return a property value as a string
void * tlp::Plugin::getPropertyValueHandle | ( | const string & | param) |
Return a handle to a properties value
|
virtual |
Function returnin a plugins "result", as a string
RoadRunner * tlp::Plugin::getRoadRunnerInstance | ( | ) |
Retrieves the RoadRunner instance the plugin is using. Can be NULL.
|
virtual |
Retrieve the status of the plugin.
string tlp::Plugin::getVersion | ( | ) |
Get plugin version information
pair< void *, void * > tlp::Plugin::getWorkFinishedData | ( | ) |
get WorkFinished event data variables
pair< void *, void * > tlp::Plugin::getWorkProgressData | ( | ) |
get WorkProgress event data variables
pair< void *, void * > tlp::Plugin::getWorkStartedData | ( | ) |
get WorkStarted event data variables
bool tlp::Plugin::hasFinishedEvent | ( | ) | const |
Check if the plugin as an assigned WorkerFinishedEvent
bool tlp::Plugin::hasProgressEvent | ( | ) | const |
Check if the plugin as an assigned WorkerProgressEvent
bool tlp::Plugin::hasStartedEvent | ( | ) | const |
Check if the plugin as an assigned WorkerStartedEvent
bool tlp::Plugin::isBeingTerminated | ( | ) | const |
Check if the plugin worker is in the process of being terminated
|
virtual |
Reset the plugin.
|
protected |
Set the name of the shared library
void tlp::Plugin::setPropertyByString | ( | const string & | nameOf, |
const char * | value | ||
) |
Sets the value of specified Property with value as specified
void tlp::Plugin::setPropertyValue | ( | const string & | nameOf, |
const void * | value | ||
) |
Sets the value of specified Property with value as specified
void tlp::Plugin::terminate | ( | ) |
If the work of the plugin is carried out in a separate thread, terminate() will signal termination of such work.
void tlp::Plugin::WorkFinishedEvent | ( | void * | data1, |
void * | data2 | ||
) |
Call WorkFinished event function
void tlp::Plugin::WorkProgressEvent | ( | void * | data1, |
void * | data2 | ||
) |
Call WorkProgress event function
void tlp::Plugin::WorkStartedEvent | ( | void * | data1, |
void * | data2 | ||
) |
Call WorkStarted event function
|
protected |
A pointer to the PluginManager that loaded the Plugin uses.
|
protected |
Properties container. Descendant add properties to this container, as they wish. Property data values can be exchanged to/from the plugin by accessing individual properties.
|
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