INOS
CINOSTaskExCmdBase Class Referenceabstract

#include <cinostaskextmpl.h>

Inheritance diagram for CINOSTaskExCmdBase:

Public Types

typedef bool(CINOSTaskEx::* tPreDispatchFunction) (CINOSTaskExMsg *apMsg)
 Type of pre-dispatch functions. Functions of this type can be used as a callback in SetPreDispatcher.
 
typedef void(CINOSTaskEx::* tOnMsgDoneFunction) (CINOSTaskExMsg *apMsg, CINOSTaskExDef::ERplId aRplId, tMcAppError aAppError)
 Type of OnMsgDone functions. Functions of this type can be used as a callback in SetOnMsgDone.
 

Public Member Functions

virtual void SetPreDispatcher (const CINOSTaskExCmdHookBase *apPreDispatchHook)
 Sets the pre dispatch callback which is called before a message is of this command is dispatched.
 
virtual void SetOnMsgDone (const CINOSTaskExCmdHookBase *apOnMsgDoneHook)
 Sets the OnMsgDone callback which is called when MsgDone is called on a message of this command.
 
virtual uint32 AddCommand (bool abDeleteOnRemove=false)
 Adds this command to the module it belongs to. And makes it therefore callable. This function also checks if the parameter definitions match the types declared in the template parameters.
 
virtual uint32 AddCommand (uint64 aChar, uint16 aKeyLevel, bool abRegisterInco=true, bool abDeleteOnRemove=false)
 Adds this command to the module it belongs to. And makes it therefore callable. This function also checks if the parameter definitions match the types declared in the template parameters.
 
CINOSTaskExMsgCreateMsg (CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
 Create a message of this command. Can be used for manual, customized call.
 
const charGetOption () const
 Returns the option string of this command.
 
const charGetName ()
 Returns the name of this command.
 
void SetName (const char *apName)
 Returns the name of this command.
 
CINOSTaskExMsgGetMsg ()
 Returns the message of this command.
 
void SetTask (CINOSTaskEx *apTask)
 
void AddParam (const char *apName, real64 arValue, real64 arMin, real64 arMax, const char *apUnit="", uint32 auChar=0, uint32 auFlags=0)
 Adds a real64 param description. This function may only be used if the param description has not be provided in the constructor. The funcion needs to be called in the same order as the template type definition.
 
void AddParam (const char *apName, const char *apValue, const char *apComboData=nullptr, uint32 auFlags=0)
 Adds a string (char*) param description. This function may only be used if the param description has not be provided in the constructor. The funcion needs to be called in the same order as the template type definition.
 
void AddParam (const char *apName, bool abValue, uint32 auFlags=0)
 Adds a bool param description. This function may only be used if the param description has not be provided in the constructor. The funcion needs to be called in the same order as the template type definition.
 
void SetAllowedStates (uint32 auStateBitmap)
 Sets the states in which this command is allowed to be called.
 
int operator< (CINOSTaskExCmdBase &aTaskExMsg)
 binary tree operators
 
int operator== (CINOSTaskExCmdBase &aTaskExMsg)
 
int operator< (const char *aName)
 
int operator== (const char *aName)
 
virtual ~CINOSTaskExCmdBase ()
 Destructor.
 
void Claim ()
 Claims the object of this command. This ensures that in case this command.
 
void Release (CINOSTaskExMsg *apMsg=nullptr)
 Releases the object of this command. This ensures that in case this command.
 

Protected Member Functions

virtual void Dispatch (CINOSTaskExMsg *apMsg)=0
 Dispatches a message if this command. Used by CINOSTaskEx.
 
virtual void DispatchTmd (CINOSTaskExMsg *apMsg)=0
 Dispatches a timed message if this command. Used by CINOSTaskEx.
 
bool PreDispatch (CINOSTaskExMsg *apMsg)
 Function is called by the module (CINOSTaskEx) before the message of this command is dispatched.
 
void OnMsgDone (CINOSTaskExMsg *apMsg, CINOSTaskExDef::ERplId aRplId, tMcAppError aAppError)
 Function is called by the module (CINOSTaskEx) when MsgDone is called on a message of this command.
 
 CINOSTaskExCmdBase (const char *apName, CINOSTaskEx *apTask, uint32 auStateBitmap, const char *apOption, uint64 auCharacteristics, uint16 auKeyLevel, bool abRegisterInco)
 Constructor (base constructor is protected, as this class is abstract)
 
bool CheckParams (size_t count,...)
 Checks if thie added parameters match the template definition.
 
virtual void DeleteCommand ()
 Deletes the object of this command, dispatch if called from.
 

Protected Attributes

CINOSTaskExm_pTask
 Task of this command.
 
tPreDispatchFunction m_pPreDispatchFunction = nullptr
 Function that is called before messages of this command are dispatched.
 
tOnMsgDoneFunction m_pMsgDoneFunction = nullptr
 Function that is called when MsgDone is called on messages of this command.
 
uint64 m_uCharacteristics = 0
 Characteristics of the INCO registration of this commands.
 
uint64 m_uIsStructureBitmap = 0
 Bitmap that defines if the parameter corresponding to the bit number is a structure.
 
uint16 m_uKeyLevel = cKeyLevelMin
 Key level of the INCO registration of this commands.
 
bool m_bRegisterInco = true
 Defines if this command is registered to the INCO tree if not.
 
CINOSTaskExMsg m_CommandMsg
 Prototype message for this command.
 
CINOSTaskExMsgm_pRegisterMsg = nullptr
 Register message for this command (in the task ex for INCO tree)
 
uint32 m_uAllowedStates
 Bitmap of states in which this command is allowed to be called.
 
const charm_pOption = nullptr
 Option(s) of the module which are required for this command to be added.
 
std::atomic_ulong m_uReferenceCount
 Reference count for dynamically created and added objects. If count is 0 the.
 

Friends

class CINOSTaskEx
 

Detailed Description

Abstract base class for all CINOSTaskEx command templates (TINOSTaskExCmd etc.)

Member Typedef Documentation

◆ tOnMsgDoneFunction

typedef void(CINOSTaskEx::* CINOSTaskExCmdBase::tOnMsgDoneFunction) (CINOSTaskExMsg *apMsg, CINOSTaskExDef::ERplId aRplId, tMcAppError aAppError)

Type of OnMsgDone functions. Functions of this type can be used as a callback in SetOnMsgDone.

Parameters
apMsgCINOSTaskExMsg* the message that MsgDone was called on.
apMsgaRplId CINOSTaskExDef::ERplId reply id provided to MsgDone.
apMsgaAppError tMcAppError error code provided to MsgDone.

◆ tPreDispatchFunction

typedef bool(CINOSTaskEx::* CINOSTaskExCmdBase::tPreDispatchFunction) (CINOSTaskExMsg *apMsg)

Type of pre-dispatch functions. Functions of this type can be used as a callback in SetPreDispatcher.

Parameters
apMsgCINOSTaskExMsg* the message that is about to be dispatched.

Member Function Documentation

◆ AddCommand() [1/2]

virtual uint32 CINOSTaskExCmdBase::AddCommand ( bool  abDeleteOnRemove = false)
inlinevirtual

Adds this command to the module it belongs to. And makes it therefore callable. This function also checks if the parameter definitions match the types declared in the template parameters.

Parameters
Deletethe command object after command is removed from the task ex.

Reimplemented in TINOSTaskExCmdBaseParam< ObjectType, ParamType >, TINOSTaskExCmdBaseParam< CINOSMcModule, ParamType... >, TINOSTaskExCmdBaseParam< CINOSMcRobot, ParamType... >, and TINOSTaskExCmdBaseParam< ObjectType, ParamType... >.

◆ AddCommand() [2/2]

virtual uint32 CINOSTaskExCmdBase::AddCommand ( uint64  aChar,
uint16  aKeyLevel,
bool  abRegisterInco = true,
bool  abDeleteOnRemove = false 
)
inlinevirtual

Adds this command to the module it belongs to. And makes it therefore callable. This function also checks if the parameter definitions match the types declared in the template parameters.

Parameters
Characteristicsuint32 characteristics of the INCO item of the command.
aKeyLeveluint16 key level of the INCO item of the parameter.
abRegisterIncobool defines if the command should be registered to the inco tree.
Deletethe command object after command is removed from the task ex.

Reimplemented in TINOSTaskExCmdBaseParam< ObjectType, ParamType >, TINOSTaskExCmdBaseParam< CINOSMcModule, ParamType... >, TINOSTaskExCmdBaseParam< CINOSMcRobot, ParamType... >, and TINOSTaskExCmdBaseParam< ObjectType, ParamType... >.

◆ AddParam() [1/3]

void CINOSTaskExCmdBase::AddParam ( const char apName,
bool  abValue,
uint32  auFlags = 0 
)
inline

Adds a bool param description. This function may only be used if the param description has not be provided in the constructor. The funcion needs to be called in the same order as the template type definition.

Parameters
apNameconst char* name of the parameter
abValuebool initial default value of the parameter
auFlagsuint32 flags of the INCO item of the parameter

◆ AddParam() [2/3]

void CINOSTaskExCmdBase::AddParam ( const char apName,
const char apValue,
const char apComboData = nullptr,
uint32  auFlags = 0 
)
inline

Adds a string (char*) param description. This function may only be used if the param description has not be provided in the constructor. The funcion needs to be called in the same order as the template type definition.

Parameters
apNameconst char* name of the parameter
apValueconst char* initial default value of the parameter
apComboDataconst char* combo data of the parameter
auFlagsuint32 flags of the INCO item of the parameter

◆ AddParam() [3/3]

void CINOSTaskExCmdBase::AddParam ( const char apName,
real64  arValue,
real64  arMin,
real64  arMax,
const char apUnit = "",
uint32  auChar = 0,
uint32  auFlags = 0 
)
inline

Adds a real64 param description. This function may only be used if the param description has not be provided in the constructor. The funcion needs to be called in the same order as the template type definition.

Parameters
apNameconst char* name of the parameter
arValuereal64 initial default value of the parameter
arMinreal64 minimal value of the parameter
arMaxreal64 maximal value of the parameter
apUnitconst char* unit of the parameter
auCharuint32 characteristics of the INCO item of the parameter
auFlagsuint32 flags of the INCO item of the parameter

◆ CreateMsg()

CINOSTaskExMsg * CINOSTaskExCmdBase::CreateMsg ( CINOSSync apSync = DF_INOS_SYNCHRONOUS)
inline

Create a message of this command. Can be used for manual, customized call.

Parameters
apSyncCINOSSync* sync type or sync object

◆ Dispatch()

◆ DispatchTmd()

◆ GetMsg()

CINOSTaskExMsg & CINOSTaskExCmdBase::GetMsg ( )
inline

Returns the message of this command.

Returns
Message of the command.

◆ GetName()

const char * CINOSTaskExCmdBase::GetName ( )
inline

Returns the name of this command.

Returns
Name of the command.

◆ GetOption()

const char * CINOSTaskExCmdBase::GetOption ( ) const
inline

Returns the option string of this command.

Returns
Option(s) of the module which are required for this command to be added at startup.

◆ OnMsgDone()

void CINOSTaskExCmdBase::OnMsgDone ( CINOSTaskExMsg apMsg,
CINOSTaskExDef::ERplId  aRplId,
tMcAppError  aAppError 
)
inlineprotected

Function is called by the module (CINOSTaskEx) when MsgDone is called on a message of this command.

Parameters
apMsgCINOSTaskExMsg* message that MsgDone is called on.
aRplIdCINOSTaskExDef::ERplId reply id of the MsgDone.
aAppErrortMcAppError error code of the MsgDone.

◆ PreDispatch()

bool CINOSTaskExCmdBase::PreDispatch ( CINOSTaskExMsg apMsg)
inlineprotected

Function is called by the module (CINOSTaskEx) before the message of this command is dispatched.

Parameters
apMsgCINOSTaskExMsg* message that is to be dispatched.
Returns
If the return value is true the message will be dispatched otherwise the message will be ignored.

◆ SetAllowedStates()

void CINOSTaskExCmdBase::SetAllowedStates ( uint32  auStateBitmap)
inline

Sets the states in which this command is allowed to be called.

Parameters
auStateBitmapuint32 Bitmap of the allowed states, each bit represents if the according state. 1 = allowed, 0 = not-allowed.

◆ SetName()

void CINOSTaskExCmdBase::SetName ( const char apName)
inline

Returns the name of this command.

Returns
Name of the command.

◆ SetOnMsgDone()

virtual void CINOSTaskExCmdBase::SetOnMsgDone ( const CINOSTaskExCmdHookBase apOnMsgDoneHook)
inlinevirtual

Sets the OnMsgDone callback which is called when MsgDone is called on a message of this command.

Parameters
aOnMsgDoneFunctiontOnMsgDoneFunction function that will be called on MsgDone.

◆ SetPreDispatcher()

virtual void CINOSTaskExCmdBase::SetPreDispatcher ( const CINOSTaskExCmdHookBase apPreDispatchHook)
inlinevirtual

Sets the pre dispatch callback which is called before a message is of this command is dispatched.

Parameters
aOnMsgDoneFunctiontOnMsgDoneFunction that will be called before dispatching.

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