itom  4.1.0
ito::AddInManagerPrivate Class Reference
Inheritance diagram for ito::AddInManagerPrivate:

Public Member Functions

 AddInManagerPrivate (AddInManager *addInMgr)
 
template<typename _Tp >
const ito::RetVal initAddInActuatorOrDataIO (bool actuatorNotDataIO, const int pluginNum, const QString &name, _Tp **addIn, QVector< ito::ParamBase > *paramsMand, QVector< ito::ParamBase > *paramsOpt, bool autoLoadPluginParams, ItomSharedSemaphore *aimWait)
 

Protected Member Functions

void setItomProperties (void *propPtr)
 
RetVal initDockWidget (const ito::AddInBase *addIn)
 
RetVal loadAddIn (QString &filename)
 
RetVal loadAddInDataIO (QObject *plugin, ito::PluginLoadStatus &pluginLoadStatus)
 
RetVal loadAddInActuator (QObject *plugin, ito::PluginLoadStatus &pluginLoadStatus)
 
RetVal loadAddInAlgo (QObject *plugin, ito::PluginLoadStatus &pluginLoadStatus)
 
RetVal registerPluginAsDeadPlugin (ito::AddInBase *addIn)
 

Protected Attributes

AddInManager *const q_ptr
 

Private Slots

RetVal closeDeadPlugins ()
 
void propertiesChanged ()
 

Private Member Functions

 Q_DECLARE_PUBLIC (AddInManager)
 
int getItemNum (const void *item)
 
int getPluginNum (const QString &name, ito::AddInInterfaceBase *&addIn)
 
const RetVal saveParamVals (ito::AddInBase *plugin)
 
const RetVal loadParamVals (ito::AddInBase *plugin)
 
void incRefParamPlugins (ito::AddInBase *ai, QVector< ito::ParamBase > *paramsMand, QVector< ito::ParamBase > *paramsOpt)
 
ito::RetVal decRefParamPlugins (ito::AddInBase *ai)
 
const RetVal decRef (ito::AddInBase **plugin)
 
const RetVal closeAddIn (AddInBase *addIn, ItomSharedSemaphore *aimWait=NULL)
 
template<typename _Tp >
const RetVal initAddInActuatorOrDataIO (bool actuatorNotDataIO, const int pluginNum, const QString &name, _Tp **addIn, QVector< ito::ParamBase > *paramsMand, QVector< ito::ParamBase > *paramsOpt, bool autoLoadPluginParams, ItomSharedSemaphore *aimWait=NULL)
 
const RetVal initAddInAlgo (const int pluginNum, const QString &name, ito::AddInAlgo **addIn, QVector< ito::ParamBase > *paramsMand, QVector< ito::ParamBase > *paramsOpt, bool autoLoadPluginParams, ItomSharedSemaphore *aimWait=NULL)
 

Private Attributes

QVector< QTranslator * > m_Translator
 
QList< QObject * > m_addInListDataIO
 
QList< QObject * > m_addInListAct
 
QList< QObject * > m_addInListAlgo
 
QHash< QString, ito::AddInAlgo::FilterDef * > m_filterList
 
QMultiHash< QString, ito::AddInAlgo::FilterDef * > m_filterListInterfaceTag
 
QHash< QString, ito::AddInAlgo::AlgoWidgetDef * > m_algoWidgetList
 
QHash< void *, ito::FilterParams * > filterParamHash
 
QList< PluginLoadStatusm_pluginLoadStatus
 
QObject * m_pMainWindow
 
QObject * m_pMainApplication
 
AlgoInterfaceValidatorm_algoInterfaceValidator
 
PlugInModelm_plugInModel
 
QCoreApplication * m_pQCoreApp
 
QList< QPointer< ito::AddInBase > > m_deadPlugins
 
QTimer m_deadPluginTimer
 
int m_timeOutInitClose
 
int m_timeOutGeneral
 

Member Function Documentation

const ito::RetVal ito::AddInManagerPrivate::closeAddIn ( AddInBase addIn,
ItomSharedSemaphore aimWait = NULL 
)
private

closeAddIn close an instance of an actuator addIn object

Parameters
[in]addInthe addIn to close
Returns
on success ito::retOk, ito::retError otherwise

At first the close method of the plugin class is invoked. Then the closeInst method of the addInInterfaceBase is called.

RetVal ito::AddInManagerPrivate::closeDeadPlugins ( )
privateslot
Returns
RetVal
const ito::RetVal ito::AddInManagerPrivate::decRef ( ito::AddInBase **  addIn)
private

decRef decrement reference counter of addin and close it if necessary

Parameters
[in]addInthe addIn to increment reference
Returns
on success ito::retOk, ito::retError otherwise

The method decrements the reference counter of the addin.

ito::RetVal ito::AddInManagerPrivate::decRefParamPlugins ( ito::AddInBase ai)
private

decrements the reference counter of arguments passed to a plugin if necessary

Parameters
[in]aiAddIn to which the parameters are passed
[in]paramsMandmandatory argument parameters
[in]paramsOptoptional argument parameters

This function decrements the reference counter of plugins passed to other plugins as parameters, to enable a closing of the passed plugins when they are no longer used by any other plugin.

void ito::AddInManagerPrivate::incRefParamPlugins ( ito::AddInBase ai,
QVector< ito::ParamBase > *  paramsMand,
QVector< ito::ParamBase > *  paramsOpt 
)
private

increments the reference counter of arguments passed to a plugin if necessary

Parameters
[in]aiAddIn to which the parameters are passed
[in]paramsMandmandatory argument parameters
[in]paramsOptoptional argument parameters

This function increments the reference counter of plugins passed to other plugins as parameters, to avoid the passed plugins are closed while they are still in use by the other plugin.

template<typename _Tp >
const ito::RetVal ito::AddInManagerPrivate::initAddInActuatorOrDataIO ( bool  actuatorNotDataIO,
const int  pluginNum,
const QString &  name,
_Tp **  addIn,
QVector< ito::ParamBase > *  paramsMand,
QVector< ito::ParamBase > *  paramsOpt,
bool  autoLoadPluginParams,
ItomSharedSemaphore aimWait 
)

initAddIn initialize new instance of a dataIO addIn class

Parameters
[in]actuatorNotDataIOtrue if an actuator plugin should be initialized, else false
[in]pluginNumnumber of the plugin in the plugin list, retrieved with getInitParams
[in]namename of the plugin to be initialized, this just a check that number and name correspond, principally it should not be necessary to pass the name
[out]addInpointer to the new instance of the plugin class
[in]paramsMandmandatory initialisation parameters which are required by the initialisation. As this vector should(must) be retrieved from the plugin previously with the getInitParams method it should always be filled with meaningful values
[in]paramsOptmandatory initialisation parameters which may optionally be passed to the initialisation. As this vector should(must) be retrieved from the plugin previously with the getInitParams method it should always be filled with meaningful values
[in,out]aimWaitwait condition for calls from other threads. See also ItomSharedSemaphore
Returns
on success ito::retOk, ito::retError otherwise

A new instance from the addIn class is created then the newly created object is moved into a new thread. Afterwards the classes init method is invoked with the passed mandatory and optional parameters. As a last step the plugins parameters are loaded from the plugins parameters xml file loadParamVals.

const ito::RetVal ito::AddInManagerPrivate::initAddInAlgo ( const int  pluginNum,
const QString &  name,
ito::AddInAlgo **  addIn,
QVector< ito::ParamBase > *  paramsMand,
QVector< ito::ParamBase > *  paramsOpt,
bool  autoLoadPluginParams,
ItomSharedSemaphore aimWait = NULL 
)
private

initAddInAlgo initialize new instance of a algo addIn class

Parameters
[in]pluginNumnumber of the plugin in the plugin list, retrieved with getInitParams
[in]namename of the plugin to be initialized, this just a check that number and name correspond, principally it should not be necessary to pass the name
[out]addInpointer to the new instance of the plugin class
[in]paramsMandmandatory initialisation parameters which are required by the initialisation. As this vector should(must) be retrieved from the plugin previously with the getInitParams method it should always be filled with meaningful values
[in]paramsOptmandatory initialisation parameters which may optionally be passed to the initialisation. As this vector should(must) be retrieved from the plugin previously with the getInitParams method it should always be filled with meaningful values
Returns
on success ito::retOk, ito::retError otherwise

new instance from the addIn class is created. In contrast to the dataIO and actuator plugins the new object is not moved to a new thread and no init method is called. As a last step the plugins parameters are loaded from the plugins parameters xml file loadParamVals.

ito::RetVal ito::AddInManagerPrivate::initDockWidget ( const ito::AddInBase addIn)
protected

initAddIn initialize new instance of a dataIO addIn class

Parameters
[in]addInpointer to newly initialized pluginIn
Returns
on success ito::retOk

checks if addIn has a docking widget and if so, registers this docking widget to mainWindow

RetVal ito::AddInManagerPrivate::loadAddIn ( QString &  filename)
protected
Parameters
filename
Returns
RetVal
RetVal ito::AddInManagerPrivate::loadAddInActuator ( QObject *  plugin,
ito::PluginLoadStatus pluginLoadStatus 
)
protected
Parameters
plugin
pluginLoadStatus
Returns
RetVal
RetVal ito::AddInManagerPrivate::loadAddInAlgo ( QObject *  plugin,
ito::PluginLoadStatus pluginLoadStatus 
)
protected
Parameters
plugin
pluginLoadStatus
Returns
RetVal
RetVal ito::AddInManagerPrivate::loadAddInDataIO ( QObject *  plugin,
ito::PluginLoadStatus pluginLoadStatus 
)
protected
Parameters
plugin
pluginLoadStatus
Returns
RetVal
const ito::RetVal ito::AddInManagerPrivate::loadParamVals ( ito::AddInBase plugin)
private

loadParamVals loads the plugins parameter values from the plugin parameter xml file

Parameters
[in]pluginplugin for which the parameter should be loaded

A xml file with the same name as the plugin library in the plugin directory is used to load the plugin parameters. The xml file is checked for the current plugin-file version and type when opened. The parameters are set using the invokeMethod function on the plugins' setParam method.

RetVal ito::AddInManagerPrivate::registerPluginAsDeadPlugin ( ito::AddInBase addIn)
protected
Parameters
addIn
Returns
RetVal
const ito::RetVal ito::AddInManagerPrivate::saveParamVals ( ito::AddInBase plugin)
private

saveParamVals saves the plugins parameter values to the plugin parameter xml file

Parameters
[in]pluginplugin for which the parameter should be saved

A xml file with the same name as the plugin library in the plugin directory is used to save the plugin parameters. The xml file is checked for the current plugin-file version and type when opened. The parameters are stored underneath the unique ID of the instance currently closed. This enables to have a several parameter sets for one plugin. Each parameter is stored with its name, type and value. The type may be either number or string.


The documentation for this class was generated from the following files: