itom
|
Base class for DataIOThreadCtrl and ActuatorThreadCtrl. More...
#include <pluginThreadCtrl.h>
Public Member Functions | |
PluginThreadCtrl () | |
default constructor. No plugin instance is currently under control. | |
PluginThreadCtrl (const ito::ParamBase &pluginParameter, ito::RetVal *retval=NULL) | |
Creates the control object for a plugin instance. | |
PluginThreadCtrl (ito::AddInBase *plugin, ito::RetVal *retval=NULL) | |
Creates the control object for a plugin instance. | |
PluginThreadCtrl (const PluginThreadCtrl &other) | |
copy constructor. The reference counter of the covered plugin by other will be incremented another time. | |
virtual | ~PluginThreadCtrl () |
destructor. Decrements the reference counter of the covered plugin and deletes it, if it drops to zero. | |
PluginThreadCtrl & | operator= (const PluginThreadCtrl &other) |
assignment operator. Gets control over the plugin currently covered by other. Decrements the reference counter of the former plugin and increments it of the plugin controlled by other. | |
ito::RetVal | getParam (ito::Param &val, int timeOutMS=PLUGINWAIT) |
ito::RetVal | setParam (ito::ParamBase val, int timeOutMS=PLUGINWAIT) |
ito::RetVal | waitForSemaphore (int timeOutMS=PLUGINWAIT) |
Protected Attributes | |
ito::AddInBase * | m_pPlugin |
ItomSharedSemaphoreLocker | m_semaphoreLocker |
Base class for DataIOThreadCtrl and ActuatorThreadCtrl.
This base class only provides access to setParam and getParam of the covered plugin in order to get or set internal parameters of the plugin. This is common for actuators and dataIO instances.
ito::PluginThreadCtrl::PluginThreadCtrl | ( | const ito::ParamBase & | pluginParameter, |
ito::RetVal * | retval = NULL ) |
Creates the control object for a plugin instance.
This implementation gets the controlled instance from a ito::ParamBase object of param type ito::ParamBase::HWRef. Use this version, if the controlled plugin is passed to an algorithm or other plugin via a vector of mandatory or optional parameters in terms of ito::ParamBase objects.
This constructor increments the reference of the controlled plugin such that the plugin is not deleted until the reference has been decremented in the destructor of this class.
pluginParameter | is a plugin parameter of type ito::ParamBase::HWRef. |
retval | is an optional pointer to ito::RetVal. An error is set to this retval if the given plugin is no valid dataIO plugin instance. |
ito::PluginThreadCtrl::PluginThreadCtrl | ( | ito::AddInBase * | plugin, |
ito::RetVal * | retval = NULL ) |
Creates the control object for a plugin instance.
This implementation gets the controlled instance from the real pointer to a ito::AddInBase instance.
This constructor increments the reference of the controlled plugin such that the plugin is not deleted until the reference has been decremented in the destructor of this class.
plugin | is the pointer to the controlled plugin. |
retval | is an optional pointer to ito::RetVal. An error is set to this retval if the given plugin is no valid plugin instance. |
|
virtual |
destructor. Decrements the reference counter of the covered plugin and deletes it, if it drops to zero.
\detail The destructor
ito::RetVal ito::PluginThreadCtrl::getParam | ( | ito::Param & | val, |
int | timeOutMS = PLUGINWAIT ) |
Get a parameter of the plugin
\detail Get any parameter of the camera defined by val.name. val must be initialised and name must be correct. After correct execution, val has the correct value.
[in|out] | val Initialised tParam (correct name | in) | |
[in] | timeOutMS | TimeOut for the semaphore-wait |
ito::RetVal ito::PluginThreadCtrl::setParam | ( | ito::ParamBase | val, |
int | timeOutMS = PLUGINWAIT ) |
Set a parameter of the plugin
\detail Get the parameter of the plugin defined by val.name to the value of val.
[in] | val | Initialised tParam (correct name | value) |
[in] | timeOutMS | TimeOut for the semaphore-wait |
ito::RetVal ito::PluginThreadCtrl::waitForSemaphore | ( | int | timeOutMS = PLUGINWAIT | ) |
Wait until plugin thread has finished the last command
\detail After the invoke-command this thread must wait / be synchronize with the plugin-thread. Therefore the wait-Function of m_semaphoreLocker is called. If the plugin do not answer within timeOutMS and the pMyCamera is not alive anymore, the function returns a timeout.
[in] | timeOutMS | timeout for the wait. -1: endless wait until the plugin finished the last invocation or it is not 'alive' anymore, 0: no wait (this method does nothing), >0: time in ms |
|
protected |
Handle to the plugin
|
protected |
Handle to the semaphore needed for thread save communication. Allocated in constructor, deleted in destructor