#include <QueueTaskBase_T.h>
Inheritance diagram for OpenDDS::DCPS::QueueTaskBase< T >:


Public Member Functions | |
| QueueTaskBase () | |
| Constructor. | |
| virtual | ~QueueTaskBase () |
| Virtual Destructor. | |
| int | add (T &req) |
| virtual int | open (void *=0) |
| Activate the worker threads. | |
| virtual int | svc () |
| The "mainline" executed by the worker thread. | |
| virtual int | close (u_long flag=0) |
| Called when the thread exits. | |
| virtual void | execute (T &req)=0 |
Private Types | |
| typedef ACE_SYNCH_MUTEX | LockType |
| typedef ACE_Guard< LockType > | GuardType |
| typedef ACE_Condition< LockType > | ConditionType |
| typedef ACE_Unbounded_Queue< T > | Queue |
Private Attributes | |
| LockType | lock_ |
| Lock to protect the "state" (all of the data members) of this object. | |
| Queue | queue_ |
| The request queue. | |
| ConditionType | work_available_ |
| bool | shutdown_initiated_ |
| Flag used to initiate a shutdown request to all worker threads. | |
| bool | opened_ |
| Flag used to avoid multiple open() calls. | |
| ACE_thread_t | thr_id_ |
| The id of the thread created by this task. | |
typedef ACE_Condition<LockType> OpenDDS::DCPS::QueueTaskBase< T >::ConditionType [private] |
typedef ACE_Guard<LockType> OpenDDS::DCPS::QueueTaskBase< T >::GuardType [private] |
typedef ACE_SYNCH_MUTEX OpenDDS::DCPS::QueueTaskBase< T >::LockType [private] |
typedef ACE_Unbounded_Queue<T> OpenDDS::DCPS::QueueTaskBase< T >::Queue [private] |
| OpenDDS::DCPS::QueueTaskBase< T >::QueueTaskBase | ( | ) | [inline] |
Constructor.
| virtual OpenDDS::DCPS::QueueTaskBase< T >::~QueueTaskBase | ( | ) | [inline, virtual] |
Virtual Destructor.
| int OpenDDS::DCPS::QueueTaskBase< T >::add | ( | T & | req | ) | [inline] |
Put the request to the request queue. Returns 0 if successful, -1 otherwise (it has been "rejected" or this task is shutdown).
| virtual int OpenDDS::DCPS::QueueTaskBase< T >::close | ( | u_long | flag = 0 |
) | [inline, virtual] |
Called when the thread exits.
| virtual void OpenDDS::DCPS::QueueTaskBase< T >::execute | ( | T & | req | ) | [pure virtual] |
The subclass should implement this function to handle the dequeued request.
Implemented in OpenDDS::DCPS::SimpleTcpReconnectTask.
| virtual int OpenDDS::DCPS::QueueTaskBase< T >::open | ( | void * | = 0 |
) | [inline, virtual] |
Activate the worker threads.
| virtual int OpenDDS::DCPS::QueueTaskBase< T >::svc | ( | ) | [inline, virtual] |
The "mainline" executed by the worker thread.
LockType OpenDDS::DCPS::QueueTaskBase< T >::lock_ [private] |
Lock to protect the "state" (all of the data members) of this object.
bool OpenDDS::DCPS::QueueTaskBase< T >::opened_ [private] |
Flag used to avoid multiple open() calls.
Queue OpenDDS::DCPS::QueueTaskBase< T >::queue_ [private] |
The request queue.
bool OpenDDS::DCPS::QueueTaskBase< T >::shutdown_initiated_ [private] |
Flag used to initiate a shutdown request to all worker threads.
ACE_thread_t OpenDDS::DCPS::QueueTaskBase< T >::thr_id_ [private] |
The id of the thread created by this task.
ConditionType OpenDDS::DCPS::QueueTaskBase< T >::work_available_ [private] |
Condition used to signal the worker threads that they may be able to find a request in the queue_ that needs to be executed. This condition will be signal()'ed each time a request is added to the queue_, and also when this task is shutdown.
1.4.7