Content-type: text/html
typedef void (*RTEvent_fp)(void *this, void *argp);
RTEvent *RTEvent_Constructor(const char *name, RTEvent_fp fp, void *this, void * arg);
RTEvent *RTEvent_Clone(RTEvent *evp);
void RTEvent_Free(RTEvent *evp);
RTEvent *RTEvent_Wait_For_Event(RTEventQueue evq);
void RTEvent_Consume(RTEvent *evp);
RTClockCount RTEvent_Enqueued(RTEvent *evp);
RTClockCount RTEvent_Stamped(RTEvent *evp);
The Constructor creates a named RTEvent which will call the RTEvent_fp with two arguments. Both arguments are type void * which may be any dereferencable pointer and may info fact be an RTRefCnt_Object pointer. When used with RTReactiveResponse, the RTEvent_fp will have storage management of its reference counted arguments handled automatically for the duration of the callback. RTEvent_Clone produces a copy of an event. RTEvent_Free frees the storage / references associated with an RTEvent. Event_fp will own a reference for the duration of its call.
The usual method for an event sink to get an RTEventQueue is by obtaining one from an RTTask. The RTEvent_Wait_For_Event and RTEvent_Consume(RTEvent *evp) allow an application RTTask to block and process events in a canonical way with the implementation details hidden within this class.
The RTClockCount RTEvent_Enqueued(RTEvent *evp) and RTClockCount RTEvent_Stamped(RTEvent *evp) methods allow an application to obtain information about event timing from an opaque event.
RTEvent is a core Chronolytix function.