libRoadRunner Plugin C API  1.0.0
Plugin Framework for libRoadRunner
 All Data Structures Files Functions Variables Typedefs Groups Pages
rrp_api.h
Go to the documentation of this file.
1 
41 #ifndef rrp_apiH
42 #define rrp_apiH
43 #include "rrp_exporter.h"
44 #include "rrp_types.h"
45 #include "rrp_parameter_api.h"
46 //---------------------------------------------------------------------------
47 
48 #if defined(__cplusplus)
49 namespace rrp { extern "C" {
50 #endif
51 
60 RRP_DECLSPEC RRPluginManagerHandle rrp_cc createPluginManager(const char* pluginDir);
61 
63 // \brief Create a new instance of a plugin manager.
64 // \brief A PluginManager manages a collection of plugins, loaded and unloaded by
65 // the load and unload API functions respectively.
66 // \param pluginDir Full path to folder containing plugins.
67 // \return On success, a handle to a Plugin manager, on failure, NULL.
68 //
69 // \ingroup plugin_manager
70 // */
71 //RRP_DECLSPEC RRPluginManagerHandle rrp_cc createPluginManagerEx(const char* pluginDir);
72 
79 RRP_DECLSPEC bool rrp_cc freePluginManager(RRPluginManagerHandle handle);
80 
87 RRP_DECLSPEC bool rrp_cc loadPlugins(RRPluginManagerHandle handle);
88 
95 RRP_DECLSPEC bool rrp_cc unLoadPlugins(RRPluginManagerHandle handle);
96 
104 RRP_DECLSPEC RRPluginHandle rrp_cc loadPlugin(RRPluginManagerHandle handle, const char* pluginName);
105 
113 RRP_DECLSPEC bool rrp_cc unLoadPlugin(RRPluginManagerHandle handle, RRPluginHandle plugin);
114 
121 RRP_DECLSPEC int rrp_cc getNumberOfPlugins(RRPluginManagerHandle handle);
122 
129 RRP_DECLSPEC char* rrp_cc getPluginNames(RRPluginManagerHandle handle);
130 
137 RRP_DECLSPEC char* rrp_cc getPluginLibraryNames(RRPluginManagerHandle handle);
138 
146 RRP_DECLSPEC RRPluginHandle rrp_cc getFirstPlugin(RRPluginManagerHandle handle);
147 
155 RRP_DECLSPEC RRPluginHandle rrp_cc getNextPlugin(RRPluginManagerHandle handle);
156 
164 RRP_DECLSPEC RRPluginHandle rrp_cc getPreviousPlugin(RRPluginManagerHandle handle);
165 
173 RRP_DECLSPEC RRPluginHandle rrp_cc getCurrentPlugin(RRPluginManagerHandle handle);
174 
183 RRP_DECLSPEC RRPluginHandle rrp_cc getPlugin(RRPluginManagerHandle handle, const char* pluginName);
184 
193 RRP_DECLSPEC long rrp_cc getPluginSharedLibHandle(RRPluginManagerHandle handle, RRPluginHandle pluginHandle);
194 
195 
196 //========================== PLUGIN HANDLE functions
203 RRP_DECLSPEC char* rrp_cc getPluginName(RRPluginHandle handle);
204 
211 RRP_DECLSPEC char* rrp_cc getPluginInfo(RRPluginHandle handle);
212 
220 RRP_DECLSPEC unsigned char* rrp_cc getPluginManualAsPDF(RRPluginHandle handle);
221 
228 RRP_DECLSPEC unsigned int rrp_cc getPluginManualNrOfBytes(RRPluginHandle handle);
229 
238 RRP_DECLSPEC bool rrp_cc assignRoadRunnerInstance(RRPluginHandle pHandle, RRHandle rrHandle);
239 
249 RRP_DECLSPEC bool rrp_cc executePlugin(RRPluginHandle handle);
250 
258 RRP_DECLSPEC bool rrp_cc executePluginEx(RRPluginHandle handle, bool inAThread);
259 
266 RRP_DECLSPEC char* rrp_cc getPluginStatus(RRPluginHandle handle);
267 
274 RRP_DECLSPEC char* rrp_cc getPluginResult(RRPluginHandle handle);
275 
282 RRP_DECLSPEC bool rrp_cc resetPlugin(RRPluginHandle handle);
283 
290 RRP_DECLSPEC bool rrp_cc isPluginWorking(RRPluginHandle handle);
291 
299 RRP_DECLSPEC void rrp_cc terminateWork(RRPluginHandle handle);
300 
307 RRP_DECLSPEC bool rrp_cc isBeingTerminated(RRPluginHandle handle);
308 
315 RRP_DECLSPEC bool rrp_cc wasTerminated(RRPluginHandle handle);
316 
326 RRP_DECLSPEC bool rrp_cc assignOnStartedEvent(RRPluginHandle handle, PluginEvent cb, void* userData1, void* userData2);
327 
337 RRP_DECLSPEC bool rrp_cc assignOnProgressEvent(RRPluginHandle handle, PluginEvent cb, void* userData1, void* userData2);
338 
348 RRP_DECLSPEC bool rrp_cc assignOnFinishedEvent(RRPluginHandle handle, PluginEvent cb, void* userData1, void* userData2);
349 
357 RRP_DECLSPEC bool rrp_cc assignPluginInput(RRPluginHandle handle, void* userData);
358 
365 RRP_DECLSPEC RRHandle rrp_cc getRRHandleFromPlugin(RRPluginHandle handle);
366 
373 RRP_DECLSPEC char* rrp_cc getPluginPropertiesAsXML(RRPluginHandle handle);
374 
381 RRP_DECLSPEC RRParametersHandle rrp_cc getPluginParameters(RRPluginHandle handle);
382 
389 RRP_DECLSPEC char* rrp_cc getListOfPluginParameterNames(RRPluginHandle handle);
390 
398 RRP_DECLSPEC RRParameterHandle rrp_cc getPluginParameter(RRPluginHandle handle, const char* parameterName);
399 
408 RRP_DECLSPEC bool rrp_cc setPluginParameter(RRPluginHandle handle, const char* parameterName, const char* value);
409 
416 RRP_DECLSPEC RRDataHandle rrp_cc getRoadRunnerDataHandle(RRHandle handle);
417 
424 RRP_DECLSPEC RRCDataPtr rrp_cc createRRCData(RRDataHandle rrDataHandle);
425 
435 RRP_DECLSPEC int rrp_cc getRRCDataNumRows (RRCDataPtr rrData);
436 
446 RRP_DECLSPEC int rrp_cc getRRCDataNumCols (RRCDataPtr rrData);
447 
463 RRP_DECLSPEC bool rrp_cc getRRCDataElementF(RRCDataPtr rrcData, int r, int c, double *value);
464 
465 
480 RRP_DECLSPEC bool rrp_cc getRoadRunnerDataElement(RRDataHandle rrData, int r, int c, double *value);
481 RRP_DECLSPEC char* rrp_cc getRoadRunnerDataColumnHeader(RRDataHandle _data);
482 RRP_DECLSPEC int rrp_cc getRoadRunnerDataNumRows(RRDataHandle rrData);
483 RRP_DECLSPEC int rrp_cc getRoadRunnerDataNumCols(RRDataHandle rrData);
484 RRP_DECLSPEC RRDataHandle rrp_cc createRoadRunnerData(int rows, int cols, char* colNames);
485 RRP_DECLSPEC bool rrp_cc freeRoadRunnerData(RRDataHandle handle);
492 RRP_DECLSPEC char* rrp_cc stringArrayToStringFWD(const RRStringArrayPtr list);
493 
494 RRP_DECLSPEC bool rrp_cc writeRoadRunnerDataToFile(RRDataHandle rrData, char* fName);
495 RRP_DECLSPEC bool rrp_cc readRoadRunnerDataFromFile(RRDataHandle rrData, char* fName);
496 
497 
498 
505 RRP_DECLSPEC char* rrp_cc getLastPluginError();
506 
511 RRP_DECLSPEC bool rrp_cc freeText(char* text);
512 
513 
514 #if defined(__cplusplus)
515 } } //rrp namespace and extern "C"
516 #endif
517 
518 #endif
519 
520 
bool freeText(char *text)
Free char* generated by library routines.
Definition: rrp_api.cpp:424
bool getRoadRunnerDataElement(RRDataHandle rrData, int r, int c, double *value)
Retrieves an element at a given row and column from a RoadRunner data type variable.
Definition: rrp_api.cpp:438
RRPluginHandle getFirstPlugin(RRPluginManagerHandle handle)
getFirstPlugin retrieves the "first" plugin in the plugin managers internal list of plugins...
Definition: rrp_api.cpp:60
unsigned int getPluginManualNrOfBytes(RRPluginHandle handle)
Get the byte size for the PDF manual.
Definition: rrp_api.cpp:248
RRDataHandle getRoadRunnerDataHandle(RRHandle handle)
Retrieve a handle to RoadRunners internal data.
Definition: rrp_api.cpp:373
bool resetPlugin(RRPluginHandle handle)
Reset a Plugin. Plugin dependent. A reset function should bring the internal state of a plugin to a k...
Definition: rrp_api.cpp:333
int getRRCDataNumCols(RRCDataPtr rrData)
Retrieve the number of columns in the given rrCData data (returned form simulat(RRHandle handle)) ...
Definition: rrp_api.cpp:399
bool setPluginParameter(RRPluginHandle handle, const char *parameterName, const char *value)
Set the value of a PluginParameter by a string.
Definition: rrp_api.cpp:231
void * RRParametersHandle
Void pointer to a RRParameters instance (Container for parameters)
Definition: rrp_types.h:66
bool executePlugin(RRPluginHandle handle)
The executePlugin function is the function designated to fire of a Plugins "worker". What is done when this function is entered is plugin dependent.
Definition: rrp_api.cpp:280
int getNumberOfPlugins(RRPluginManagerHandle handle)
Get Number of loaded plugins.
Definition: rrp_api.cpp:141
bool isPluginWorking(RRPluginHandle handle)
check if plugin is actively working
Definition: rrp_api.cpp:365
void(* PluginEvent)(void *, void *)
Typedef for plugin event function.
Definition: rrp_types.h:54
bool assignPluginInput(RRPluginHandle handle, void *userData)
Hand external data to a plugin.
Definition: rrp_api.cpp:325
Plugins API Types Header.
char * stringArrayToStringFWD(const RRStringArrayPtr list)
Returns a string list in string form.
Definition: rrp_api.cpp:414
bool unLoadPlugins(RRPluginManagerHandle handle)
Unload plugins.
Definition: rrp_api.cpp:116
void terminateWork(RRPluginHandle handle)
Terminate any work that is in progress in a plugin. If the plugins worker is executed in a thread...
Definition: rrp_api.cpp:349
RRParameterHandle getPluginParameter(RRPluginHandle handle, const char *parameterName)
Get a parameter handle to a parameter.
Definition: rrp_api.cpp:218
libRoadRunner Plugins C API 2012-2013
bool assignOnProgressEvent(RRPluginHandle handle, PluginEvent cb, void *userData1, void *userData2)
Assign event function fired as a plugin progresses.
Definition: rrp_api.cpp:301
char * getPluginNames(RRPluginManagerHandle handle)
Function to retrieve the names of currently loaded plugins.
Definition: rrp_api.cpp:176
bool executePluginEx(RRPluginHandle handle, bool inAThread)
The executePluginEx is similar to the executePlugin function, except it takes two extra arguments...
Definition: rrp_api.cpp:285
char * getPluginStatus(RRPluginHandle handle)
Get some status of a plugin. See the plugins documentation on what to expect.
Definition: rrp_api.cpp:264
void * RRPluginHandle
Void pointer to a Plugin instance.
Definition: rrp_types.h:60
RRPluginManagerHandle createPluginManager(const char *pluginDir)
Create a new instance of a plugin manager.
Definition: rrp_api.cpp:27
char * getLastPluginError()
Return last API error.
Definition: rrp_api.cpp:419
bool isBeingTerminated(RRPluginHandle handle)
Check if the work of a plugin is currently being terminated.
Definition: rrp_api.cpp:341
char * getListOfPluginParameterNames(RRPluginHandle handle)
Get a list of a plugin parameter names, as a string. Space being the delimiter.
Definition: rrp_api.cpp:210
void * RRPluginManagerHandle
Void pointer to a PluginManager instance.
Definition: rrp_types.h:57
RRPluginHandle getCurrentPlugin(RRPluginManagerHandle handle)
getCurrentPlugin retrieves the "current" plugin in the plugin managers internal list of plugins...
Definition: rrp_api.cpp:84
char * getPluginResult(RRPluginHandle handle)
Returns a plugins result, as a string. See the plugins documentation on what to expect.
Definition: rrp_api.cpp:317
bool getRRCDataElementF(RRCDataPtr rrcData, int r, int c, double *value)
Retrieves an element at a given row and column from a RRCData struct type variable.
Definition: rrp_api.cpp:409
void * RRParameterHandle
Void pointer to a Parameter instance.
Definition: rrp_types.h:63
RRPluginHandle loadPlugin(RRPluginManagerHandle handle, const char *pluginName)
Load a particular plugin.
Definition: rrp_api.cpp:92
char * getPluginLibraryNames(RRPluginManagerHandle handle)
Function to retrieve the library name of currently loaded plugins.
Definition: rrp_api.cpp:185
unsigned char * getPluginManualAsPDF(RRPluginHandle handle)
Get Plugin manual as PDF. A plugin may embedd a help manual as a PDF. This function return such as a ...
Definition: rrp_api.cpp:256
bool assignRoadRunnerInstance(RRPluginHandle pHandle, RRHandle rrHandle)
Assign a roadrunner instance handle for the plugin to use. A plugin may use an externally created roa...
Definition: rrp_api.cpp:272
RRPluginHandle getPreviousPlugin(RRPluginManagerHandle handle)
getPreviousPlugin retrieves the "previous" plugin in the plugin managers internal list of plugins...
Definition: rrp_api.cpp:76
RRPluginHandle getNextPlugin(RRPluginManagerHandle handle)
getNextPlugin retrieves the "next" plugin in the plugin managers internal list of plugins...
Definition: rrp_api.cpp:68
RRCDataPtr createRRCData(RRDataHandle rrDataHandle)
Create a RoadRunner C data structure (RRCDataPtr) from RoadRunner data.
Definition: rrp_api.cpp:381
Plugins API Parameters Header.
bool loadPlugins(RRPluginManagerHandle handle)
Load plugins. The function will look in the default plugin folder for plugins, and load them...
Definition: rrp_api.cpp:108
bool assignOnStartedEvent(RRPluginHandle handle, PluginEvent cb, void *userData1, void *userData2)
Assign event function fired when a plugin starts its work.
Definition: rrp_api.cpp:293
char * getPluginPropertiesAsXML(RRPluginHandle handle)
Get a Plugins Parameterse as an xml document. The string returned from this function is formated as x...
Definition: rrp_api.cpp:429
int getRRCDataNumRows(RRCDataPtr rrData)
Retrieve the number of rows in the given RoadRunner C numberical data (returned from simulate(RRHandl...
Definition: rrp_api.cpp:389
bool freePluginManager(RRPluginManagerHandle handle)
Free the plugin manager. A call to this function will also unload any loaded plugins.
Definition: rrp_api.cpp:49
bool assignOnFinishedEvent(RRPluginHandle handle, PluginEvent cb, void *userData1, void *userData2)
Assign event function fired when a plugin finishes its work.
Definition: rrp_api.cpp:309
bool unLoadPlugin(RRPluginManagerHandle handle, RRPluginHandle plugin)
unload a particular plugin
Definition: rrp_api.cpp:124
RRParametersHandle getPluginParameters(RRPluginHandle handle)
Get a handle to a plugins parameters.
Definition: rrp_api.cpp:202
bool wasTerminated(RRPluginHandle handle)
wasTerminated. query a plugin if work was terminated before completion
Definition: rrp_api.cpp:357
char * getPluginInfo(RRPluginHandle handle)
Return some information about a Plugin.
Definition: rrp_api.cpp:240
RRHandle getRRHandleFromPlugin(RRPluginHandle handle)
Get roadrunner instance handle from plugin.
Definition: rrp_api.cpp:168
long getPluginSharedLibHandle(RRPluginManagerHandle handle, RRPluginHandle pluginHandle)
Get a handle to a plugins shared library.
RRPluginHandle getPlugin(RRPluginManagerHandle handle, const char *pluginName)
GetPluginHandle.
Definition: rrp_api.cpp:149
char * getPluginName(RRPluginHandle handle)
Get the name of a Plugin.
Definition: rrp_api.cpp:194