libRoadRunner Plugin C++ API  1.0.0
 All Classes Files Functions Variables Friends Pages
rrPlugin.h
Go to the documentation of this file.
1 
41 #ifndef rrPluginH
42 #define rrPluginH
43 #include <sstream>
44 #include <string>
45 #include "rrPluginsAPIExporter.h"
46 #include "rrPluginsAPISettings.h"
47 #include "rrCapabilities.h"
48 
49 namespace rr
50 {
51 class RoadRunner;
52 }
53 
54 namespace rrp
55 {
56 using namespace rr;
57 using std::string;
58 class PluginManager;
59 
63 typedef void (event_cc *PluginEvent)(void* data1, void* data2);
64 
94 class PLUGINS_API_DECLSPEC Plugin
95 {
96  friend PluginManager;
97  public:
101  Plugin( const string& name = gEmptyString,
102  const string& cat = gNoneString,
103  RoadRunner* aRR = NULL,
104  const string& language = gNoneString,
105  const PluginManager* pm = NULL);
106 
110  virtual ~Plugin();
111 
115  string getName();
116 
120  string getLibraryName();
121 
125  string getAuthor();
126 
130  string getCategory();
131 
135  string getVersion();
136 
140  string getCopyright();
141 
142 
146  RoadRunner* getRoadRunnerInstance();
147 
148 
152  virtual string getInfo();
153 
157  virtual string getExtendedInfo();
158 
162  virtual unsigned char* getManualAsPDF() const;
163 
167  virtual unsigned int getPDFManualByteSize();
168 
172  Parameters* getParameters(); //Each capability has a set of parameters
173 
177  StringList getParameterNames(); //Each capability has a set of parameters
178 
182  string getPluginPropertiesAsXML();
183 
187  PluginParameter* getParameter(const string& param, const string& capability = "");
188 
192  PluginParameter* getParameter(const string& param, Capability& capability);
193 
197  bool setParameter(const string& nameOf, const char* value);
198 
202  bool setParameter(const string& nameOf, const char* value, Capability& capability);
203 
204 
209  void terminate();
210 
214  bool isBeingTerminated();
215 
217  bool wasTerminated();
218 
220  virtual bool isWorking();
221 
223  bool assignRoadRunnerInstance(RoadRunner* rr);
224 
228  virtual bool assignOnStartedEvent(PluginEvent pluginStarted, void* userData1 = NULL, void* userData2 = NULL);
229 
233  virtual bool assignOnProgressEvent(PluginEvent pluginsProgress, void* userData1 = NULL, void* userData2 = NULL);
234 
238  virtual bool assignOnFinishedEvent(PluginEvent pluginsFinished, void* userData1 = NULL, void* userData2 = NULL);
239 
243  virtual string getResult();
244 
248  virtual bool resetPlugin();
249 
253  virtual bool assignInput(void* data);
254 
258  virtual string getStatus();
259 
263  virtual string getImplementationLanguage() = 0;
264 
268  virtual bool execute(bool inAThread = false) = 0;
269 
270  protected:
271  string mName;
272 
274  string mLibraryName;
275 
277  string mAuthor;
278 
280  string mCategory;
281 
283  string mVersion;
284 
286  string mCopyright;
287 
290 
293 
296 
301  RoadRunner *mRR;
302 
308 
312  void setLibraryName(const string& libName);
313 
317  PluginEvent mWorkStartedEvent;
318 
322  PluginEvent mWorkProgressEvent;
323 
327  PluginEvent mWorkFinishedEvent;
328 
333 
338 
343 
348 
353 
358 
364 
370  void *mClientData;
371 
372 };
373 
374 }
375 
376 #endif
bool mIsWorking
Boolean flag indicating if the plugin is working.
Definition: rrPlugin.h:295
Definition: rrPlugin.h:94
void * mWorkFinishedData2
Definition: rrPlugin.h:357
void * mWorkStartedData2
Definition: rrPlugin.h:337
void * mWorkProgressData1
Definition: rrPlugin.h:342
const PluginManager * mPM
Definition: rrPlugin.h:307
PluginEvent mWorkStartedEvent
Definition: rrPlugin.h:317
string mCopyright
Plugin copyright language.
Definition: rrPlugin.h:286
bool mTerminate
Boolean flag indicating if a user wants to terminate the work in a plugin.
Definition: rrPlugin.h:292
Definition: rrCapabilities.h:57
string mName
Name of Plugin.
Definition: rrPlugin.h:271
Capabilities mCapabilities
Definition: rrPlugin.h:363
string mAuthor
Name of plugin author(s)
Definition: rrPlugin.h:277
void * mWorkFinishedData1
Definition: rrPlugin.h:352
PluginEvent mWorkProgressEvent
Definition: rrPlugin.h:322
string mVersion
Plugin version.
Definition: rrPlugin.h:283
Definition: rrPluginParameter.h:58
string mLibraryName
Name of compiled shared library implementing the Plugin.
Definition: rrPlugin.h:274
void * mWorkStartedData1
Definition: rrPlugin.h:332
Container for Capabilities.
string mImplementationLanguage
Plugin implementation language.
Definition: rrPlugin.h:289
Definition: rrPluginManager.h:79
PluginEvent mWorkFinishedEvent
Definition: rrPlugin.h:327
Definition: rrParameters.h:63
void * mWorkProgressData2
Definition: rrPlugin.h:347
string mCategory
Plugin category.
Definition: rrPlugin.h:280
Definition: rrCapability.h:56
RoadRunner * mRR
Definition: rrPlugin.h:301
void * mClientData
Definition: rrPlugin.h:370