INOS
|
#include <cinostaskex.h>
Public Member Functions | |
virtual void | Signal () |
Put object into the signaled state. | |
![]() | |
CINOSSync (const char *aName=0, uint32 aInitialCount=0, bool aManual=false) | |
virtual | ~CINOSSync () |
Destroy sync object. | |
virtual const char * | GetName () |
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 CINOSMcSyncMsg * | Create (CINOSTaskEx &aTask, CINOSTaskExMsg *apMsg) |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
const char * | m_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) | |
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.
|
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.
apMsg | The 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! |
Put object into the signaled state.
Reimplemented from CINOSSync.