sipxportlib  Version 3.3
Public Member Functions | List of all members
OsQueuedEvent Class Reference

Queued events are used to send event notifications using a message queue. More...

#include <OsQueuedEvent.h>

Inheritance diagram for OsQueuedEvent:
Inheritance graph
[legend]
Collaboration diagram for OsQueuedEvent:
Collaboration graph
[legend]

Public Member Functions

 OsQueuedEvent (OsMsgQ &rMsgQ, const intptr_t userData)
 Constructor. More...
 
virtual ~OsQueuedEvent ()
 Destructor. More...
 
virtual OsStatus signal (const intptr_t eventData)
 Set the event data and send an event message to the designated queue. More...
 
virtual OsStatus setUserData (intptr_t userData)
 Set the user data value for this object. More...
 
virtual OsStatus getUserData (intptr_t &rUserData) const
 Return the user data specified when this object was constructed. More...
 
- Public Member Functions inherited from OsNotification
 OsNotification ()
 
virtual ~OsNotification ()
 
virtual void setTimeout (const OsTime &signalTimeout)
 Set timeout to use when signalling if supported by derived class. More...
 

Additional Inherited Members

- Protected Attributes inherited from OsNotification
OsTime mSignalTimeout
 Used by derived classes that support a timeout on signal. More...
 

Detailed Description

Queued events are used to send event notifications using a message queue.

When the corresponding event occurs, the Notifier sends a message the designated message queue. The Listener must wait on the queue to receive the event messages.

Background

First, a little bit of terminology. The task that wishes to be notified when an event occurs is the "Listener" task. The task that signals when a given event occurs is the "Notifier" task. A Notifier informs the Listener that a given event has occurred by sending an "Event Notification".

Expected Usage

The Listener passes an OsQueuedEvent object to the Notifier which includes a message queue identifier for that message queue that will be used for event notifications. When the corresponding event occurs, the Notifier sends a message the designated message queue. The Listener waits on the queue to receive the event notification. This mechanism allows a task to receive notifications for multiple events. The same message queue that is used to receive event notifications may also be used to receive other types of messages.

Constructor & Destructor Documentation

OsQueuedEvent ( OsMsgQ &  rMsgQ,
const intptr_t  userData 
)

Constructor.

~OsQueuedEvent ( )
virtual

Destructor.

Member Function Documentation

OsStatus signal ( const intptr_t  eventData)
virtual

Set the event data and send an event message to the designated queue.

Returns
The result of the message send operation.

Implements OsNotification.

OsStatus setUserData ( intptr_t  userData)
virtual

Set the user data value for this object.

Returns
Always OS_SUCCESS.
OsStatus getUserData ( intptr_t rUserData) const
virtual

Return the user data specified when this object was constructed.

Returns
Always OS_SUCCESS.