OpalPresentityWithCommandThread Class Reference

#include <pres_ent.h>

Inheritance diagram for OpalPresentityWithCommandThread:

OpalPresentity

Construction

 ~OpalPresentityWithCommandThread ()
 OpalPresentityWithCommandThread ()
 Construct the presentity class that uses a command thread.

Public Member Functions

Overrides from OpalPresentity
virtual bool SendCommand (OpalPresentityCommand *cmd)
Overrides from OpalPresentity
void StartThread ()
void StopThread ()

Protected Types

typedef std::queue< OpalPresentityCommand * > CommandQueue

Protected Member Functions

void ThreadMain ()

Protected Attributes

CommandQueue m_commandQueue
PMutex m_commandQueueMutex
PAtomicInteger m_commandSequence
PSyncPoint m_commandQueueSync
bool m_threadRunning
PThread * m_thread

Detailed Description

Representation of a presence identity that uses a background thread to process commands.


Member Typedef Documentation

typedef std::queue<OpalPresentityCommand *> OpalPresentityWithCommandThread::CommandQueue [protected]


Constructor & Destructor Documentation

OpalPresentityWithCommandThread::OpalPresentityWithCommandThread (  )  [protected]

Construct the presentity class that uses a command thread.

OpalPresentityWithCommandThread::~OpalPresentityWithCommandThread (  ) 

Destory the presentity class that uses a command thread. Note this will block until the background thread has stopped.


Member Function Documentation

virtual bool OpalPresentityWithCommandThread::SendCommand ( OpalPresentityCommand cmd  )  [virtual]

Lowlevel function to send a command to the presentity handler. All commands are asynchronous. They will usually initiate an action for which an indication (callback) will give a result.

The default implementation queues the command for the background thread to handle.

Returns true if the command was queued. Note that this does not mean the command succeeded, only that the underlying protocol is processing commands, that is the backgrund thread is running

Parameters:
cmd  Command to execute

Reimplemented from OpalPresentity.

void OpalPresentityWithCommandThread::StartThread (  ) 

Start the background thread to handle commands. This is typically called from the concrete classes Open() function.

void OpalPresentityWithCommandThread::StopThread (  ) 

Stop the background thread to handle commands. This is typically called from the concrete classes Close() function. It is also called fro the destructor to be sure the thread has stopped before the object is destroyed.

void OpalPresentityWithCommandThread::ThreadMain (  )  [protected]


Field Documentation

CommandQueue OpalPresentityWithCommandThread::m_commandQueue [protected]

PMutex OpalPresentityWithCommandThread::m_commandQueueMutex [protected]

PSyncPoint OpalPresentityWithCommandThread::m_commandQueueSync [protected]

PAtomicInteger OpalPresentityWithCommandThread::m_commandSequence [protected]

PThread* OpalPresentityWithCommandThread::m_thread [protected]

bool OpalPresentityWithCommandThread::m_threadRunning [protected]


The documentation for this class was generated from the following file:
Generated on Mon Feb 21 20:19:24 2011 for OPAL by  doxygen 1.4.7