INOS
CINOSMcSyncMsg Class Reference

#include <cinostaskex.h>

Inheritance diagram for CINOSMcSyncMsg:

Public Member Functions

virtual void Signal ()
 Put object into the signaled state.
 
- Public Member Functions inherited from CINOSSync
 CINOSSync (const char *aName=0, uint32 aInitialCount=0, bool aManual=false)
 
virtual ~CINOSSync ()
 Destroy sync object.
 
virtual const charGetName ()
 Get name of sync object.
 
virtual uint32 Wait (uint32 aTimeout=0xFFFFFFFF)
 wait for signaled state for max. aTimeout usec
 
virtual void SignalEx (CINOSTaskExMsg *apMsg, uint32 auRplId, uint32 auAppError)
 
virtual bool MsgEvent (CINOSTaskExMsg *apMsg)
 
virtual void Reset ()
 Reset object state.
 
volatile uint32 * GetLockAdr ()
 Return pointer to core locking structure.
 
virtual bool UsesPolling () const
 
bool IsSame (CINOSSync *i_pSync)
 
int operator< (const CINOSSync &aSync) const
 
int operator== (const CINOSSync &aSync) const
 
int operator< (const char *aName) const
 
int operator== (const char *aName) const
 

Static Public Member Functions

static CINOSMcSyncMsgCreate (CINOSTaskEx &aTask, CINOSTaskExMsg *apMsg)
 

Additional Inherited Members

- Protected Member Functions inherited from CINOSSync
virtual bool Signaled (CINOSSync *&aChild)
 
virtual CINOSSyncNode * GetNode ()
 
virtual void SetNode (CINOSSyncNode *aNode)
 
void SignalAndUnlock (uint32 auMsr)
 Put object into the signaled state and release the core lock.
 
- Protected Attributes inherited from CINOSSync
const charm_pName
 name of sync object
 
uint32 m_uCount
 signaled count of object
 
bool m_bManual
 manual object yes/no
 
tTaskId m_idFstWaiting
 id of first task waiting for the sync object
 
tTaskId m_idLstWaiting
 id of last task waiting for the sync object
 
SINOSCoreLock m_Lock
 core lock
 
CINOSSyncNode * m_pNode
 pointer to object node (if any)
 

Detailed Description

Helper sync object that sends an arbitrary message (CINOSTaskExMsg) to the specified task.

A typical use case is when executing axis functions which may take rather long and the CINOSTaskEx should not be blocked so that other task messages can be executed. In that case, the axis function should be executed asynchronously. Still, the function may need to react upon the axis function completion, e.g. to set an internal state accordingly. That's where this class is very handy: it can be passed to such an axis command and, by the time the axis command completes, it'll put an arbitrary CINOSTaskExMsg to the specified CINOSTaskEx. That CINOSTaskExMsg may then trigger another internal function which can perform the 'post processing stuff'. Here's an example:

CINOSTaskExMsg* pUsrMsg = new CINOSTaskExMsg(CINOSTaskEx::eMsgUser,
        eUsrJoyDisAxisStopped);
pUsrMsg->AddParam((uint32) apMsg);
pUsrMsg->AddParam(name);
pAxis->Stop(axis->GetJoyParam(), CINOSMcSyncMsg::Create(*this, pUsrMsg));

Objects of this type will delete themselves when CINOSMcSyncMsg::Signal is called, therefore, don't create them on the stack.

Member Function Documentation

◆ Create()

static CINOSMcSyncMsg * CINOSMcSyncMsg::Create ( CINOSTaskEx aTask,
CINOSTaskExMsg apMsg 
)
static

Factory method. Objects of this type must always be created by this factory. It ensures that the objects are created on the heap, which is important because objects of this type delete themselves when Signal was called.

Parameters
apMsgThe message that'll be put into the queue of aTask upon Signal() will be called. Important: Ownership of this message object will be given to this object! The caller of this class mustn't use apMsg afterwards anymore!

◆ Signal()

virtual void CINOSMcSyncMsg::Signal ( )
virtual

Put object into the signaled state.

Reimplemented from CINOSSync.


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