itom 1.3.0
|
class of the AddIn - Library (DLL) - Interface More...
#include <addInInterface.h>
Public Member Functions | |
AddInInterfaceBase () | |
default constructor | |
int | getType (void) const |
returns addIn type | |
int | getVersion (void) const |
returns addIn version | |
int | getMinItomVer (void) const |
returns minimum required version of main program | |
int | getMaxItomVer (void) const |
returns maximum supported version of main program | |
bool | getCallInitInNewThread (void) const |
returns whether init-method should be called in new thread (default) or still in main thread | |
tAutoLoadPolicy | getAutoLoadPolicy (void) const |
returns true if the plugin allows his own parameter load to be autoloaded by addin manager | |
tAutoSavePolicy | getAutoSavePolicy (void) const |
returns true if the plugin allows his own parameter save to be autoloaded by addin manager | |
const QString | getAuthor (void) const |
returns plugin author | |
const QString | getDescription (void) const |
returns a brief description of the plugin | |
const QString | getDetailDescription (void) const |
returns a detailed description of the plugin | |
const QString | getLicenseInfo (void) const |
returns a detailed description of the plugin license | |
const QString | getAboutInfo (void) const |
returns a detailed description of the plugin compile informations | |
const QString | getFilename (void) const |
returns the plugin's filename | |
const ito::RetVal | setFilename (const QString &name) |
QList< ito::AddInBase * > | getInstList (void) |
returns a list of the actual intantiated classes from this plugin | |
const QList< ito::AddInBase * > | getInstList (void) const |
ito::RetVal | closeInst (ito::AddInBase **addInInst) |
method for closing an instance | |
virtual QVector< ito::Param > * | getInitParamsMand (void) |
returns a vector with the mandatory initialisation parameters | |
virtual QVector< ito::Param > * | getInitParamsOpt (void) |
returns a vector with the optional initialisation parameters | |
virtual ito::RetVal | getAddInInst (ito::AddInBase **addInInst)=0 |
method to instantiate a new class of the plugin | |
void | incRef (ito::AddInBase *addIn) |
increment use reference | |
void | decRef (ito::AddInBase *addIn) |
decrement use reference | |
int | getRef (ito::AddInBase *addIn) |
get reference counter | |
int | getInstCount () |
get number instantiated plugins | |
void | setApiFunctions (void **apiFunctions) |
set api function pointer | |
void | setApiFunctionsGraph (void **apiFunctionsGraph) |
void | setLoader (QPluginLoader *loader) |
QPluginLoader * | getLoader (void) |
bool | event (QEvent *e) |
Public Attributes | |
void ** | m_apiFunctionsBasePtr |
void ** | m_apiFunctionsGraphBasePtr |
Protected Member Functions | |
virtual void | importItomApi (void **apiPtr)=0 |
virtual void | importItomApiGraph (void **apiPtr)=0 |
Protected Attributes | |
int | m_type |
plugin type | |
int | m_version |
plugin version | |
QString | m_filename |
plugin (library) filename on the disc | |
int | m_maxItomVer |
minimum required version of the main program | |
int | m_minItomVer |
maximum supported version of the main program | |
QString | m_author |
the plugin author | |
QString | m_description |
a brief descrition of the plugin | |
QString | m_detaildescription |
a detail descrition of the plugin | |
QString | m_license |
a short license string for the plugin, default value is "LGPL with ITO itom-exception" | |
QString | m_aboutThis |
QList< ito::AddInBase * > | m_InstList |
vector holding a list of the actual instantiated classes of the plugin | |
QVector< ito::Param > | m_initParamsMand |
vector with the mandatory initialisation parameters, please only read this vector within the init-method of AddInBase (afterwards it might have been changed) | |
QVector< ito::Param > | m_initParamsOpt |
vector with the optional initialisation parameters, please only read this vector within the init-method of AddInBase (afterwards it might have been changed) | |
tAutoLoadPolicy | m_autoLoadPolicy |
tAutoSavePolicy | m_autoSavePolicy |
bool | m_callInitInNewThread |
QPluginLoader * | m_loader |
Private Member Functions | |
virtual ito::RetVal | closeThisInst (ito::AddInBase **addInInst)=0 |
< internal function used within the closing process |
class of the AddIn - Library (DLL) - Interface
The measurement program can (and should) be expanded with additional functionality by "plugins". The aim of separating part of the program into plugins is to speed up developement and to reduce complexity for plugin developers. The main program holds the necessary functionality to load and use plugins with either the integrated python interpreter or within c/c++ functions. All plugins are divded into two parts:
The Interface is a small light weight class which is used when loading the dll into the main program. It holds information about the plugin itself, e.g. name, version, parameters and so on. When loading the plugin is tested for compability with the current version of the main program based on the information in the interface class. The AddInXXX class provides the plugin functionality. Instances of this class are only created when the plugin "is used" either by python or within other functions. For a description about the loading, using and unloading process see AddInBase, AddInActuator, AddInDataIO and AddInAlgo. The instantiation of an AddIn class is a two step process. At first the necessary and optional parameter values as well as the plugin's reference number are retrieved from the AddInManager using the getInitParams getInitParams method. Then a new instance is obtained using one of the initAddIn initAddIn methods. Which first create a new instance, move the instance to a new thread and at last call the classes init method
defines the auto-load policy for automatic loading of parameters from xml-file at startup of any instance
defines the auto-save policy for automatic saving of parameters in xml-file at shutdown of any instance
bool ito::AddInInterfaceBase::m_callInitInNewThread [protected] |
true (default): the init-method of addIn will be called after that the plugin-instance has been moved to new thread (my addInManager). false: the init-method is called in main(gui)-thread, and will be moved to new thread afterwards (this should only be chosen, if not otherwise feasible)