ICDPlugin: $title

ICDPlugin ICD_PLUGIN_API_VERSION 8
#include "icdplugin.h"
#include "icdhandler.h"
#include "icddictionary.h"
#define PLUGIN_NAME "dummyPlugin"
class squareAction : public ICDPluginAction
{
public:
squareAction(unsigned int id,std::string name,ICDPluginAction *parent = NULL);
public:
std::string help();
bool execute(ICDDictionary , ICDDictionary * );
};
class dummyPluginObject: public ICDPluginObject
{
public:
dummyPluginObject();
~dummyPluginObject() {}
std::string getVersion();
bool consumeICDEvent(unsigned int req_id, unsigned long event_number);
void onPluginAction(unsigned int);
void onSetICDHandler(ICDHandler *) {}
inline void start() {}
inline void stop() {}
};
Generated on Mon Feb 6 2023 08:56:43 for ICDPlugin by doxygen 1.8.14


ICDPlugin: $title

static dummyPluginObject *plugin = NULL;
extern "C" {
ICDPluginObject *onCreate() {
plugin = new dummyPluginObject();
return plugin;
}
void onDestroy() {
if (plugin ) delete plugin;
}
}
squareAction::squareAction(unsigned int id,std::string name,ICDPluginAction *parent)
:ICDPluginAction(id,name,ACTION_TYPE_NORMAL,ACTION_KIND_PYTHON_ONLY,parent) {}
std::string squareAction::help() {
ICDDictionary inputs, outputs;
inputs.set("in[as Long]",0L);
inputs.set("in[as Double]",0.);
outputs.set("out[as Long]",0L);
outputs.set("out[as Double]",0.);
outputs.set("[error]","");
std::string help = getHelpFromDictionaries(inputs,outputs,"calculates square");
return help;
}
bool squareAction::execute(ICDDictionary inputs, ICDDictionary *outputs ) {
bool ret = false;
double dval;
long lval;
if ( inputs.get("in",&lval) )
{
outputs->set("out", lval*lval);
ret = true;
}
else if ( inputs.get("in",&dval) )
{
outputs->set("out", dval*dval);
ret = true;
} else {
outputs->set("error","input value 'in' not as (double or long)");
}
return ret;
}
dummyPluginObject::dummyPluginObject():ICDPluginObject(PLUGIN_NAME) {
ICDPluginAction *square_action = new squareAction(1,"Square");
ICDPluginAction *no_action = new ICDPluginAction(2,"Welcome",ACTION_TYPE_NORMAL,ACTION_KIND_BOTH);
this->_action_vector.push_back(square_action);
this->_action_vector.push_back(no_action);
}
std::string dummyPluginObject::getVersion() {
return std::string("1.0.0.0");
}
void dummyPluginObject::onPluginAction(unsigned int id) {
if ( id == 1 ) { ... }
}
bool dummyPluginObject::consumeICDEvent(unsigned int req_id,unsigned long event_number) {
return true;
}


ICDPlugin: Class List

Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
C ICDPluginAction | The ICDPluginAction struct used to export action informations toward the platform simulator
C ICDPluginHandlerInterface |
C ICDPluginObject | The ICDPluginObject class It is used to customize the platform simulator with external actions on a specific ICDHandler
C ICDUiObjectAutoIncrement |


ICDPlugin: ICDPluginAction Class Reference

Public Member Functions | Public Attributes | Protected Attributes | List of all members
ICDPluginAction Class Reference

The ICDPluginAction struct used to export action informations toward the platform simulator. More...

Public Member Functions

ICDPluginAction (unsigned int id, std::string name, ICDPluginActionType type=ACTION_TYPE_NORMAL, ICDPluginActionKind kind=ACTION_KIND_BOTH, ICDPluginAction *parent=NULL)
ICDPluginAction::ICDPluginAction. More...
std::string | getName ()
ICDPluginAction::getName. More...
unsigned int | getId ()
ICDPluginAction::getId. More...
void | setChecked (bool)
ICDPluginAction::setChecked. More...
bool | getChecked ()
ICDPluginAction::getChecked. More...
ICDPluginActionType getActionType ()
ICDPluginAction::getActionType. More...
ICDPluginActionKind getActionKind ()
ICDPluginAction::getActionKind. More...
virtual std::string | help ()
virtual bool | execute (ICDDictionary, ICDDictionary *)
ICDPluginAction::execute a function/callback using a dictionary as input/output. More...
std::string | getHelpFromDictionaries (ICDDictionary in, ICDDictionary out, std::string description=std::string())
ICDPluginAction::getHelpFromDictionaries. More...

Public Attributes

std::vector< ICDPluginAction * > sub_action_vector

Protected Attributes

unsigned int | _id
std::string | _name
bool | _checked
ICDPluginActionType | _type
ICDPluginActionKind | _kind
ICDPluginAction * | _parent

Detailed Description

The ICDPluginAction struct used to export action informations toward the platform simulator.

Constructor & Destructor Documentation

◆ ICDPluginAction()

ICDPluginAction::ICDPluginAction | ( | unsigned int | id,
 |  | std::string | name,
 |  | ICDPluginActionType | type = ACTION_TYPE_NORMAL,
 |  | ICDPluginActionKind | kind = ACTION_KIND_BOTH,
 |  | ICDPluginAction * | parent = NULL
 | ) |  |

ICDPluginAction::ICDPluginAction.

Parameters
id | the unique identifier used to call associated callback method
name | the string rapresentation of Plugin Action ( eventually exposed in a GUI Menu of in a python list )
type | the type of Plugin Action ( default is ACTION_TYPE_NORMAL )
kind | the type of Plugin Action ( default is ACTION_KIND_BOTH )
parent | parent is specified when it is used a sub menu item

Member Function Documentation

◆ execute()

bool ICDPluginAction::execute | ( | ICDDictionary | in,
 |  | ICDDictionary * | out
 | ) |  |
virtual

ICDPluginAction::execute a function/callback using a dictionary as input/output.

execute a callback

Parameters
in | : a dictionary composed of collections of pairs ( key/value ) when values shall be one of ( boolean, int, double, string )
out | : pointer to a dictionary composed of collections of pairs ( key/value ) when values shall be one of ( boolean, int, double, string )
Returns
a boolean value : true if callback it is executed successfuly, false otherwise

◆ getActionKind()

ICDPluginActionKind ICDPluginAction::getActionKind ( )

ICDPluginAction::getActionKind.

return the action kind

Returns
the action kind

◆ getActionType()

ICDPluginActionType ICDPluginAction::getActionType ( )

ICDPluginAction::getActionType.

return the action type

Returns
the action type

◆ getChecked()

bool ICDPluginAction::getChecked ( )

ICDPluginAction::getChecked.

get checked value ( usefull only for ACTION_TYPE_CHECKABLE )

Returns
true if checked for ACTION_TYPE_CHECKABLE action, false otherwise

◆ getHelpFromDictionaries()

std::string ICDPluginAction::getHelpFromDictionaries | ( | ICDDictionary | in,
 |  | ICDDictionary | out,
 |  | std::string | description = std::string()
 | ) |  |

ICDPluginAction::getHelpFromDictionaries.

Parameters
in
out
Returns
string to default help procedure for given action

◆ getId()

unsigned int ICDPluginAction::getId ( )

ICDPluginAction::getId.

return the action id

Returns
the action identifier

◆ getName()

std::string ICDPluginAction::getName ( )

ICDPluginAction::getName.

return the action name

Returns
the action name

◆ setChecked()

void ICDPluginAction::setChecked ( bool val )

ICDPluginAction::setChecked.

set checked value ( usefull only for ACTION_TYPE_CHECKABLE )

Parameters
val

Member Data Documentation

◆ _id

unsigned int ICDPluginAction::_id
protected

the identifier of the plugin action, that shall be used by the plugin class to detect what action perform

◆ _name

std::string ICDPluginAction::_name
protected

the name of the plugin action

The documentation for this class was generated from the following files:
  • include/icdplugin.h
  • src/icdplugin.cpp


ICDPlugin: ICDPluginHandlerInterface Class Reference

ICDPluginHandlerInterface Class Reference

Detailed Description

PROJECT_NUMBER = "ICD_PLUGIN_API_VERSION 8"

The documentation for this class was generated from the following file:
  • include/icdplugin.h


ICDPlugin: ICDPluginObject Class Reference

Public Member Functions | Protected Attributes | List of all members
ICDPluginObject Class Referenceabstract

The ICDPluginObject class It is used to customize the platform simulator with external actions on a specific ICDHandler. More...

Inheritance diagram for ICDPluginObject:

Public Member Functions

ICDPluginObject (std::string)
ICDPluginObject::ICDPluginObject default constructor. More...
virtual | ~ICDPluginObject ()
ICDPluginObject::~ICDPluginObject Default destructor. It also release registrations to the current ICDHandler ( if any ) More...
virtual void | onPluginAction (unsigned int)=0
virtual void | start ()=0
virtual void | stop ()=0
virtual void | onSetICDHandler (ICDHandler *)=0
void | setFileName (std::string)
std::string | getFileName ()
virtual std::string | getVersion ()
void | setICDHandler (ICDHandler *)
ICDPluginObject::setICDHandler. More...
std::string | getName ()
ICDPluginObject::getName. More...
size_t | getPluginActionSize ()
ICDPluginObject::getPluginActionSize. More...
ICDPluginAction * | getPluginAction (unsigned int)
ICDPluginObject::getPluginAction. More...
void | addPluginAction (ICDPluginAction *action)
ICDPluginObject::addPluginAction. More...

Protected Attributes

std::vector< ICDPluginAction * > | _action_vector
std::string | _name
std::string | _filename
ICDHandler * | _icd

Detailed Description

The ICDPluginObject class It is used to customize the platform simulator with external actions on a specific ICDHandler.

Constructor & Destructor Documentation

◆ ICDPluginObject()

ICDPluginObject::ICDPluginObject ( std::string name )

ICDPluginObject::ICDPluginObject default constructor.

the ICDPluginObject constructor

Parameters
name it is the string rapresentation of the plu-in object

◆ ~ICDPluginObject()

ICDPluginObject::~ICDPluginObject ( )
virtual

ICDPluginObject::~ICDPluginObject Default destructor. It also release registrations to the current ICDHandler ( if any )

the ICDPluginObject destructor

Member Function Documentation

◆ addPluginAction()

void ICDPluginObject::addPluginAction ( ICDPluginAction * action )

ICDPluginObject::addPluginAction.

Parameters
action it is pushed back to the availlable action list

◆ getName()

std::string ICDPluginObject::getName ( )

ICDPluginObject::getName.

return the plugin name

Returns
the string rapresentation of plug-in

◆ getPluginAction()

ICDPluginAction * ICDPluginObject::getPluginAction ( unsigned int i )

ICDPluginObject::getPluginAction.

return the action element

Parameters
i
Returns
it returns the ith ICDPluginAction object stored in

◆ getPluginActionSize()

size_t ICDPluginObject::getPluginActionSize ( )

ICDPluginObject::getPluginActionSize.

return the plugin action size

Returns
the number of action recorded in

◆ getVersion()

virtual std::string ICDPluginObject::getVersion ( )
inlinevirtual

virtual return the version

◆ onPluginAction()

virtual void ICDPluginObject::onPluginAction ( unsigned int )
pure virtual

this pure virtual method it is used to perform the action specified by identifier id

◆ setICDHandler()

void ICDPluginObject::setICDHandler ( ICDHandler * icd )

ICDPluginObject::setICDHandler.

assign the ICDHandler object (it will be used to perform ation on)

Parameters
icd pass ICDHandler to the plugin object in order to perform bind operations ( in case of ) and register the plugin to the handler in order to be notified for any pending events

Member Data Documentation

◆ _action_vector

std::vector<ICDPluginAction*> ICDPluginObject::_action_vector
protected

the vector of ICDPluginAction pointer used to store actions

◆ _name

std::string ICDPluginObject::_name
protected

the name attribute of the plugin

The documentation for this class was generated from the following files:
  • include/icdplugin.h
  • src/icdplugin.cpp


ICDPlugin: ICDUiObjectAutoIncrement Class Reference

Public Member Functions | List of all members
ICDUiObjectAutoIncrement Class Reference
Inheritance diagram for ICDUiObjectAutoIncrement:

Public Member Functions

ICDUiObjectAutoIncrement (ICDMessage *m, std::string f_name, unsigned int count=1)
bool | isOk ()
bool | onClock ()
std::string | lastError ()
void | setReservation (bool)
The documentation for this class was generated from the following files:
  • include/icdplugin_extensions.h
  • src/icdplugin_extension.cpp


ICDPlugin: Class Index

Class Index
i
i
ICDPluginHandlerInterface ICDUiObjectAutoIncrement
ICDPluginObject
ICDPluginAction
i


ICDPlugin: Class Hierarchy

Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 12]
C ICDPluginAction | The ICDPluginAction struct used to export action informations toward the platform simulator
C ICDPluginHandlerInterface |
▼C ICDUiObject |
C ICDPluginObject | The ICDPluginObject class It is used to customize the platform simulator with external actions on a specific ICDHandler
C ICDUiObjectAutoIncrement |


ICDPlugin: Class Members

Here is a list of all documented class members with links to the class documentation for each member:
  • _action_vector : ICDPluginObject
  • _id : ICDPluginAction
  • _name : ICDPluginAction , ICDPluginObject
  • addPluginAction() : ICDPluginObject
  • execute() : ICDPluginAction
  • getActionKind() : ICDPluginAction
  • getActionType() : ICDPluginAction
  • getChecked() : ICDPluginAction
  • getHelpFromDictionaries() : ICDPluginAction
  • getId() : ICDPluginAction
  • getName() : ICDPluginAction , ICDPluginObject
  • getPluginAction() : ICDPluginObject
  • getPluginActionSize() : ICDPluginObject
  • getVersion() : ICDPluginObject
  • ICDPluginAction() : ICDPluginAction
  • ICDPluginObject() : ICDPluginObject
  • onPluginAction() : ICDPluginObject
  • setChecked() : ICDPluginAction
  • setICDHandler() : ICDPluginObject
  • ~ICDPluginObject() : ICDPluginObject


ICDPlugin: Class Members - Functions

  • addPluginAction() : ICDPluginObject
  • execute() : ICDPluginAction
  • getActionKind() : ICDPluginAction
  • getActionType() : ICDPluginAction
  • getChecked() : ICDPluginAction
  • getHelpFromDictionaries() : ICDPluginAction
  • getId() : ICDPluginAction
  • getName() : ICDPluginAction , ICDPluginObject
  • getPluginAction() : ICDPluginObject
  • getPluginActionSize() : ICDPluginObject
  • getVersion() : ICDPluginObject
  • ICDPluginAction() : ICDPluginAction
  • ICDPluginObject() : ICDPluginObject
  • onPluginAction() : ICDPluginObject
  • setChecked() : ICDPluginAction
  • setICDHandler() : ICDPluginObject
  • ~ICDPluginObject() : ICDPluginObject


ICDPlugin: Class Members - Variables

  • _action_vector : ICDPluginObject
  • _id : ICDPluginAction
  • _name : ICDPluginAction , ICDPluginObject


ICDPlugin: File List

File List
Here is a list of all documented files with brief descriptions:
[detail level 12]
▼ include |
icdplugin.h | Used to support additional operation on platform simulator
icdplugin_extensions.h |
plugin_global.h |
▼ src |
icdplugin.cpp |


ICDPlugin: include Directory Reference

  • include
include Directory Reference

Files

file | icdplugin.h [code]
Used to support additional operation on platform simulator.
file | plugin_global.h [code]


ICDPlugin: include/icdplugin.h File Reference

  • include
Classes | Macros | Typedefs | Enumerations | Functions
icdplugin.h File Reference

Used to support additional operation on platform simulator. More...

Go to the source code of this file.

Classes

class | ICDPluginHandlerInterface
class | ICDPluginAction
The ICDPluginAction struct used to export action informations toward the platform simulator. More...
class | ICDPluginObject
The ICDPluginObject class It is used to customize the platform simulator with external actions on a specific ICDHandler. More...

Macros

#define | PLUGIN_SYM_CREATOR "onCreate"
#define | PLUGIN_SYM_DESTROYER "onDestroy"
#define | PLUGIN_SYM_APIVERSION "getPluginAPIVersion"
#define | ACTION_PROPERTY_STRING_ID "Identifier"
#define | ICD_PLUGIN_API_VERSION 8

Typedefs

typedef ICDPluginObject * | oncreate_t(void)
typedef void | ondestroy_t(void)
typedef std::string | getapiversion_t(void)

Enumerations

enum | ICDPluginActionKind { ACTION_KIND_BOTH =1, ACTION_KIND_GUI_ONLY, ACTION_KIND_PYTHON_ONLY }
The ICDPluginActionKind enum specifies the scope of plugin. More...
enum | ICDPluginActionType { ACTION_TYPE_NORMAL =1, ACTION_TYPE_MENU, ACTION_TYPE_EX_GROUP, ACTION_TYPE_CHECKABLE }
The ICDPluginActionType enum specifies the type of action. More...

Functions

ICDPluginObject * onCreate ()
Initialise and return the plugin object.
void | onDestroy ()
std::string | getPluginAPIVersion ()

Detailed Description

Used to support additional operation on platform simulator.

By mean of dynamic libraries additional functionalities can be added to the platform simulator. Tipically a plugin it will be used to manage a specific ICD Handler implementation and to perform actions on it. Optionally the plugin can exports some functionalities in order to be evaluable by the user

Date
2017
Author
Federico Paoletti
Copyright
Leonardo Company s.p.a

Enumeration Type Documentation

◆ ICDPluginActionKind

enum ICDPluginActionKind

The ICDPluginActionKind enum specifies the scope of plugin.

Enumerator
ACTION_KIND_BOTH | the action is callable for both Python and Gui interface (an internal operation with no return or graphic rapresentation..)
ACTION_KIND_GUI_ONLY | the action is callable for Gui interface only ( a dialog ? )
ACTION_KIND_PYTHON_ONLY | the action is callable for Python interface only ( a function with a return value ?)

◆ ICDPluginActionType

enum ICDPluginActionType

The ICDPluginActionType enum specifies the type of action.

Enumerator
ACTION_TYPE_NORMAL | the action is a normal item
ACTION_TYPE_MENU | the action is a menu item ( no action associated )
ACTION_TYPE_EX_GROUP | the action is a collection of exclusive items ( no action associated )
ACTION_TYPE_CHECKABLE | the action is a checkable item


ICDPlugin: include/icdplugin_extensions.h Source File

  • include
icdplugin_extensions.h
1 #include "icdplugin.h"
2
3 class ICDUiObjectAutoIncrement: public ICDUiObject {
4 public:
5 ICDUiObjectAutoIncrement(ICDMessage *m, std::string f_name, unsigned int count=1);
6 virtual ~ICDUiObjectAutoIncrement();
7 bool isOk();
8 bool onClock();
9 std::string lastError();
10 void setReservation(bool);
11 private:
12 bool _isOk;
13 ICDMessage *_msg;
14 ICDGenericMessageField *_field;
15 double _field_max,_field_min;
16 std::string _error;
17 unsigned int _counter, _cur_counter;
18 };
icdplugin.h
Used to support additional operation on platform simulator.
ICDUiObjectAutoIncrement
Definition: icdplugin_extensions.h:3


ICDPlugin: include/plugin_global.h File Reference

  • include
Macros
plugin_global.h File Reference

Go to the source code of this file.

Macros

#define PLUGINSHARED_EXPORT Q_DECL_IMPORT

Detailed Description

Date
2017
Author
Federico Paoletti
Copyright
Leonardo Company s.p.a


ICDPlugin: src Directory Reference

  • src
src Directory Reference

Files

file icdplugin.cpp


ICDPlugin: src/icdplugin.cpp File Reference

  • src
Functions
icdplugin.cpp File Reference

Functions

std::string | getPluginAPIVersion ()
std::string | DictionaryToString (ICDDictionary dict)

Detailed Description

Date
2017
Author
Federico Paoletti
Copyright
Leonardo Company s.p.a


ICDPlugin: File Members

Here is a list of all documented file members with links to the documentation:
  • ACTION_KIND_BOTH : icdplugin.h
  • ACTION_KIND_GUI_ONLY : icdplugin.h
  • ACTION_KIND_PYTHON_ONLY : icdplugin.h
  • ACTION_TYPE_CHECKABLE : icdplugin.h
  • ACTION_TYPE_EX_GROUP : icdplugin.h
  • ACTION_TYPE_MENU : icdplugin.h
  • ACTION_TYPE_NORMAL : icdplugin.h
  • ICDPluginActionKind : icdplugin.h
  • ICDPluginActionType : icdplugin.h
  • onCreate() : icdplugin.h


ICDPlugin: File Members

  • onCreate() : icdplugin.h


ICDPlugin: File Members

  • ICDPluginActionKind : icdplugin.h
  • ICDPluginActionType : icdplugin.h


ICDPlugin: File Members

  • ACTION_KIND_BOTH : icdplugin.h
  • ACTION_KIND_GUI_ONLY : icdplugin.h
  • ACTION_KIND_PYTHON_ONLY : icdplugin.h
  • ACTION_TYPE_CHECKABLE : icdplugin.h
  • ACTION_TYPE_EX_GROUP : icdplugin.h
  • ACTION_TYPE_MENU : icdplugin.h
  • ACTION_TYPE_NORMAL : icdplugin.h


ICDPlugin: Member List

ICDPluginAction Member List

This is the complete list of members for ICDPluginAction, including all inherited members.

_checked (defined in ICDPluginAction) | ICDPluginAction | protected
_id | ICDPluginAction | protected
_kind (defined in ICDPluginAction) | ICDPluginAction | protected
_name | ICDPluginAction | protected
_parent (defined in ICDPluginAction) | ICDPluginAction | protected
_type (defined in ICDPluginAction) | ICDPluginAction | protected
execute(ICDDictionary, ICDDictionary *) | ICDPluginAction | virtual
getActionKind() | ICDPluginAction |
getActionType() | ICDPluginAction |
getChecked() | ICDPluginAction |
getHelpFromDictionaries(ICDDictionary in, ICDDictionary out, std::string description=std::string()) | ICDPluginAction |
getId() | ICDPluginAction |
getName() | ICDPluginAction |
help() (defined in ICDPluginAction) | ICDPluginAction | inlinevirtual
ICDPluginAction(unsigned int id, std::string name, ICDPluginActionType type=ACTION_TYPE_NORMAL, ICDPluginActionKind kind=ACTION_KIND_BOTH, ICDPluginAction *parent=NULL) | ICDPluginAction |
setChecked(bool) | ICDPluginAction |
sub_action_vector (defined in ICDPluginAction) | ICDPluginAction |


ICDPlugin: Member List

ICDPluginObject Member List

This is the complete list of members for ICDPluginObject, including all inherited members.

_action_vector | ICDPluginObject | protected
_filename (defined in ICDPluginObject) | ICDPluginObject | protected
_icd (defined in ICDPluginObject) | ICDPluginObject | protected
_name | ICDPluginObject | protected
addPluginAction(ICDPluginAction *action) | ICDPluginObject |
getFileName() (defined in ICDPluginObject) | ICDPluginObject |
getName() | ICDPluginObject |
getPluginAction(unsigned int) | ICDPluginObject |
getPluginActionSize() | ICDPluginObject |
getVersion() | ICDPluginObject | inlinevirtual
ICDPluginObject(std::string) | ICDPluginObject |
onPluginAction(unsigned int)=0 | ICDPluginObject | pure virtual
onSetICDHandler(ICDHandler *)=0 (defined in ICDPluginObject) | ICDPluginObject | pure virtual
setFileName(std::string) (defined in ICDPluginObject) | ICDPluginObject |
setICDHandler(ICDHandler *) | ICDPluginObject |
start()=0 (defined in ICDPluginObject) | ICDPluginObject | pure virtual
stop()=0 (defined in ICDPluginObject) | ICDPluginObject | pure virtual
~ICDPluginObject() | ICDPluginObject | virtual


ICDPlugin: Member List

ICDUiObjectAutoIncrement Member List

This is the complete list of members for ICDUiObjectAutoIncrement, including all inherited members.

ICDUiObjectAutoIncrement(ICDMessage *m, std::string f_name, unsigned int count=1) (defined in ICDUiObjectAutoIncrement) | ICDUiObjectAutoIncrement |
isOk() (defined in ICDUiObjectAutoIncrement) | ICDUiObjectAutoIncrement |
lastError() (defined in ICDUiObjectAutoIncrement) | ICDUiObjectAutoIncrement |
onClock() (defined in ICDUiObjectAutoIncrement) | ICDUiObjectAutoIncrement |
setReservation(bool) (defined in ICDUiObjectAutoIncrement) | ICDUiObjectAutoIncrement |
~ICDUiObjectAutoIncrement() (defined in ICDUiObjectAutoIncrement) | ICDUiObjectAutoIncrement | virtual


ICDPlugin: include/icdplugin.h Source File

  • include
icdplugin.h
Go to the documentation of this file.
1
11 #ifndef ICDPLUGIN_H
12 #define ICDPLUGIN_H
13 #include <string>
14 #include <vector>
15 #include <map>
16 #include <iostream>
17
18 #include "icdhandler.h"
19 #include "icduiobjects.h"
20 #include "icddictionary.h"
21
22 #include "plugin_global.h"
23
24 #include <typeinfo>
25
26 #define PLUGIN_SYM_CREATOR "onCreate"
27 #define PLUGIN_SYM_DESTROYER "onDestroy"
28 #define PLUGIN_SYM_APIVERSION "getPluginAPIVersion"
29
30 #define ACTION_PROPERTY_STRING_ID "Identifier"
31
32 #define ICD_PLUGIN_API_VERSION 8
33
34 //aggiorna il .dox
39 class ICDPluginHandlerInterface {
40
41
42 };
43
44
45 //typedef enum _ICD_plugin_action_kind_ {
46 //} ICDPluginActionKind;
50 enum ICDPluginActionKind {
51 ACTION_KIND_BOTH=1,
52 ACTION_KIND_GUI_ONLY,
53 ACTION_KIND_PYTHON_ONLY
54 };
55
56 //typedef enum _ICD_plugin_action_type_ {
57 //} ICDPluginActionType;
61 enum ICDPluginActionType {
62 ACTION_TYPE_NORMAL=1,
63 ACTION_TYPE_MENU,
64 ACTION_TYPE_EX_GROUP,
65 ACTION_TYPE_CHECKABLE
66 };
67
68
72 class ICDPluginAction {
73 public:
74 ICDPluginAction(unsigned int id,
75 std::string name,
76 ICDPluginActionType type = ACTION_TYPE_NORMAL,
77 ICDPluginActionKind kind = ACTION_KIND_BOTH,
78 ICDPluginAction *parent = NULL);
79 std::string getName();
80 unsigned int getId();
82 void setChecked(bool);
83 bool getChecked();
85 ICDPluginActionType getActionType();
86 ICDPluginActionKind getActionKind();
88 //Python reserved methods
89 public:
90 virtual std::string help() { return std::string(); }
91 virtual bool execute(ICDDictionary , ICDDictionary * );
92 std::string getHelpFromDictionaries(ICDDictionary in, ICDDictionary out, std::string description=std::string());
93 public:
94 std::vector<ICDPluginAction*> sub_action_vector;
95
96 protected:
97 unsigned int _id;
98 std::string _name;
99 bool _checked;
100 ICDPluginActionType _type;
101 ICDPluginActionKind _kind;
102 ICDPluginAction *_parent;
103
104 };
105
111 class ICDPluginObject: public ICDUiObject
112 {
113 private:
114
115 protected:
116 std::vector<ICDPluginAction*> _action_vector;
117 std::string _name;
118 std::string _filename;
119 ICDHandler *_icd;
120
121 public:
122 ICDPluginObject(std::string);
123 virtual ~ICDPluginObject();
124 virtual void onPluginAction(unsigned int) = 0;
125 virtual void start() =0;
126 virtual void stop() =0;
127 virtual void onSetICDHandler(ICDHandler *) = 0;
128
129 void setFileName(std::string);
130 std::string getFileName();
131
132 virtual std::string getVersion() { return std::string(); }
134 void setICDHandler(ICDHandler *);
135 std::string getName();
136 size_t getPluginActionSize();
137 ICDPluginAction *getPluginAction(unsigned int);
138 void addPluginAction(ICDPluginAction* action);
139 };
140
141 extern "C" {
145 ICDPluginObject* onCreate();
146 void onDestroy();
147 std::string getPluginAPIVersion();
148 }
149
150 typedef ICDPluginObject* oncreate_t(void);
151 typedef void ondestroy_t(void);
152 typedef std::string getapiversion_t(void);
153
154
155 #endif // ICDPLUGIN_H
ACTION_KIND_GUI_ONLY
Definition: icdplugin.h:52
ACTION_TYPE_MENU
Definition: icdplugin.h:63
ACTION_TYPE_CHECKABLE
Definition: icdplugin.h:65
ICDPluginAction::getName
std::string getName()
ICDPluginAction::getName.
Definition: icdplugin.cpp:144
ICDPluginAction::ICDPluginAction
ICDPluginAction(unsigned int id, std::string name, ICDPluginActionType type=ACTION_TYPE_NORMAL, ICDPluginActionKind kind=ACTION_KIND_BOTH, ICDPluginAction *parent=NULL)
ICDPluginAction::ICDPluginAction.
Definition: icdplugin.cpp:125
ICDPluginObject::_name
std::string _name
Definition: icdplugin.h:117
ICDPluginObject::setICDHandler
void setICDHandler(ICDHandler *)
ICDPluginObject::setICDHandler.
Definition: icdplugin.cpp:264
ICDPluginAction::execute
virtual bool execute(ICDDictionary, ICDDictionary *)
ICDPluginAction::execute a function/callback using a dictionary as input/output.
Definition: icdplugin.cpp:200
ICDPluginObject::getName
std::string getName()
ICDPluginObject::getName.
Definition: icdplugin.cpp:274
ICDPluginAction::getId
unsigned int getId()
ICDPluginAction::getId.
Definition: icdplugin.cpp:152
ICDPluginAction::getChecked
bool getChecked()
ICDPluginAction::getChecked.
Definition: icdplugin.cpp:174
ICDPluginAction::setChecked
void setChecked(bool)
ICDPluginAction::setChecked.
Definition: icdplugin.cpp:160
ACTION_KIND_BOTH
Definition: icdplugin.h:51
ICDPluginObject::~ICDPluginObject
virtual ~ICDPluginObject()
ICDPluginObject::~ICDPluginObject Default destructor. It also release registrations to the current IC...
Definition: icdplugin.cpp:254
ICDPluginAction::getActionType
ICDPluginActionType getActionType()
ICDPluginAction::getActionType.
Definition: icdplugin.cpp:182
ICDPluginHandlerInterface
Definition: icdplugin.h:39
ICDPluginObject::onPluginAction
virtual void onPluginAction(unsigned int)=0
ICDPluginObject::addPluginAction
void addPluginAction(ICDPluginAction *action)
ICDPluginObject::addPluginAction.
Definition: icdplugin.cpp:310
ICDPluginActionType
ICDPluginActionType
The ICDPluginActionType enum specifies the type of action.
Definition: icdplugin.h:61
ICDPluginObject::getPluginAction
ICDPluginAction * getPluginAction(unsigned int)
ICDPluginObject::getPluginAction.
Definition: icdplugin.cpp:301
ICDPluginAction
The ICDPluginAction struct used to export action informations toward the platform simulator...
Definition: icdplugin.h:72
onCreate
ICDPluginObject * onCreate()
Initialise and return the plugin object.
ICDPluginAction::getActionKind
ICDPluginActionKind getActionKind()
ICDPluginAction::getActionKind.
Definition: icdplugin.cpp:190
plugin_global.h
ACTION_TYPE_NORMAL
Definition: icdplugin.h:62
ICDPluginActionKind
ICDPluginActionKind
The ICDPluginActionKind enum specifies the scope of plugin.
Definition: icdplugin.h:50
ICDPluginAction::getHelpFromDictionaries
std::string getHelpFromDictionaries(ICDDictionary in, ICDDictionary out, std::string description=std::string())
ICDPluginAction::getHelpFromDictionaries.
Definition: icdplugin.cpp:225
ICDPluginObject::getPluginActionSize
size_t getPluginActionSize()
ICDPluginObject::getPluginActionSize.
Definition: icdplugin.cpp:291
ICDPluginAction::_name
std::string _name
Definition: icdplugin.h:98
ICDPluginObject::_action_vector
std::vector< ICDPluginAction * > _action_vector
Definition: icdplugin.h:116
ICDPluginAction::_id
unsigned int _id
Definition: icdplugin.h:97
ACTION_KIND_PYTHON_ONLY
Definition: icdplugin.h:53
ICDPluginObject
The ICDPluginObject class It is used to customize the platform simulator with external actions on a s...
Definition: icdplugin.h:111
ACTION_TYPE_EX_GROUP
Definition: icdplugin.h:64
ICDPluginObject::getVersion
virtual std::string getVersion()
Definition: icdplugin.h:132
ICDPluginObject::ICDPluginObject
ICDPluginObject(std::string)
ICDPluginObject::ICDPluginObject default constructor.
Definition: icdplugin.cpp:243


ICDPlugin: Main Page

ICDPlugin Documentation


ICDPlugin: Related Pages

Related Pages
Here is a list of all related documentation pages:
dummyPlugin.h
dummyPlugin.cpp


ICDPlugin: include/plugin_global.h Source File

  • include
plugin_global.h
Go to the documentation of this file.
1
9 #ifndef PLUGIN_GLOBAL_H
10 #define PLUGIN_GLOBAL_H
11 #if defined(PLUGIN_LIBRARY)
12 # define PLUGINSHARED_EXPORT Q_DECL_EXPORT
13 #else
14 # define PLUGINSHARED_EXPORT Q_DECL_IMPORT
15 #endif
16 #include "icdplugin.h"
17
18 #endif // PLUGIN_GLOBAL_H
19
icdplugin.h
Used to support additional operation on platform simulator.