#include <pres_ent.h>
Inheritance diagram for OpalPresentityWithCommandThread:
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 |
typedef std::queue<OpalPresentityCommand *> OpalPresentityWithCommandThread::CommandQueue [protected] |
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.
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
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] |
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] |