OpenDDS
Snapshot(2023/04/07-19:43)
|
A simple ACE task that manages a queue of request. More...
#include <QueueTaskBase_T.h>
Public Member Functions | |
QueueTaskBase () | |
virtual | ~QueueTaskBase () |
int | add (const T &req) |
virtual int | open (void *=0) |
Activate the worker threads. More... | |
virtual int | svc () |
The "mainline" executed by the worker thread. More... | |
virtual int | close (u_long flag=0) |
Called when the thread exits. More... | |
bool | is_shutdown_initiated () const |
virtual void | execute (T &req)=0 |
![]() | |
ACE_Task_Base (ACE_Thread_Manager *=0) | |
virtual | ~ACE_Task_Base (void) |
virtual int | module_closed (void) |
virtual int | put (ACE_Message_Block *, ACE_Time_Value *=0) |
virtual int | activate (long flags=THR_NEW_LWP|THR_JOINABLE|THR_INHERIT_SCHED, int n_threads=1, int force_active=0, long priority=ACE_DEFAULT_THREAD_PRIORITY, int grp_id=-1, ACE_Task_Base *task=0, ACE_hthread_t thread_handles[]=0, void *stack[]=0, size_t stack_size[]=0, ACE_thread_t thread_ids[]=0, const char *thr_name[]=0) |
virtual int | wait (void) |
virtual int | suspend (void) |
virtual int | resume (void) |
int | grp_id (void) const |
void | grp_id (int) |
ACE_Thread_Manager * | thr_mgr (void) const |
void | thr_mgr (ACE_Thread_Manager *) |
int | is_reader (void) const |
int | is_writer (void) const |
size_t | thr_count (void) const |
ACE_thread_t | last_thread (void) const |
![]() | |
ACE_Service_Object (ACE_Reactor *=0) | |
virtual | ~ACE_Service_Object (void) |
![]() | |
virtual | ~ACE_Event_Handler (void) |
virtual ACE_HANDLE | get_handle (void) const |
virtual void | set_handle (ACE_HANDLE) |
virtual int | priority (void) const |
virtual void | priority (int priority) |
virtual int | handle_input (ACE_HANDLE fd=ACE_INVALID_HANDLE) |
virtual int | handle_output (ACE_HANDLE fd=ACE_INVALID_HANDLE) |
virtual int | handle_exception (ACE_HANDLE fd=ACE_INVALID_HANDLE) |
virtual int | handle_timeout (const ACE_Time_Value ¤t_time, const void *act=0) |
virtual int | handle_exit (ACE_Process *) |
virtual int | handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask) |
virtual int | handle_signal (int signum, siginfo_t *=0, ucontext_t *=0) |
virtual int | resume_handler (void) |
virtual int | handle_qos (ACE_HANDLE=ACE_INVALID_HANDLE) |
virtual int | handle_group_qos (ACE_HANDLE=ACE_INVALID_HANDLE) |
virtual void | reactor (ACE_Reactor *reactor) |
virtual ACE_Reactor * | reactor (void) const |
virtual ACE_Reactor_Timer_Interface * | reactor_timer_interface (void) const |
virtual Reference_Count | add_reference (void) |
virtual Reference_Count | remove_reference (void) |
Reference_Counting_Policy & | reference_counting_policy (void) |
![]() | |
ACE_Shared_Object (void) | |
virtual | ~ACE_Shared_Object (void) |
virtual int | init (int argc, ACE_TCHAR *argv[]) |
virtual int | fini (void) |
virtual int | info (ACE_TCHAR **info_string, size_t length=0) const |
Private Types | |
typedef ACE_SYNCH_MUTEX | LockType |
typedef ACE_Guard< LockType > | GuardType |
typedef ConditionVariable< LockType > | ConditionVariableType |
typedef ACE_Unbounded_Queue< T > | Queue |
Private Attributes | |
LockType | lock_ |
Lock to protect the "state" (all of the data members) of this object. More... | |
Queue | queue_ |
The request queue. More... | |
ConditionVariableType | work_available_ |
bool | shutdown_initiated_ |
Flag used to initiate a shutdown request to all worker threads. More... | |
bool | opened_ |
Flag used to avoid multiple open() calls. More... | |
ACE_thread_t | thr_id_ |
The id of the thread created by this task. More... | |
A simple ACE task that manages a queue of request.
Definition at line 40 of file QueueTaskBase_T.h.
|
private |
Definition at line 205 of file QueueTaskBase_T.h.
|
private |
Definition at line 204 of file QueueTaskBase_T.h.
|
private |
Definition at line 203 of file QueueTaskBase_T.h.
|
private |
Definition at line 207 of file QueueTaskBase_T.h.
|
inline |
Definition at line 42 of file QueueTaskBase_T.h.
|
inlinevirtual |
Definition at line 51 of file QueueTaskBase_T.h.
|
inline |
Put the request to the request queue. Returns 0 if successful, -1 otherwise (it has been "rejected" or this task is shutdown).
Definition at line 58 of file QueueTaskBase_T.h.
|
inlinevirtual |
Called when the thread exits.
Reimplemented from ACE_Task_Base.
Definition at line 166 of file QueueTaskBase_T.h.
|
pure virtual |
The subclass should implement this function to handle the dequeued request.
Implemented in OpenDDS::DCPS::DataLinkCleanupTask.
Referenced by OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::is_shutdown_initiated(), and OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::svc().
|
inline |
Definition at line 192 of file QueueTaskBase_T.h.
|
inlinevirtual |
Activate the worker threads.
Reimplemented from ACE_Task_Base.
Definition at line 78 of file QueueTaskBase_T.h.
|
inlinevirtual |
The "mainline" executed by the worker thread.
Reimplemented from ACE_Task_Base.
Definition at line 109 of file QueueTaskBase_T.h.
|
mutableprivate |
Lock to protect the "state" (all of the data members) of this object.
Definition at line 210 of file QueueTaskBase_T.h.
Referenced by OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::add(), OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::close(), OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::is_shutdown_initiated(), OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::open(), and OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::svc().
|
private |
Flag used to avoid multiple open() calls.
Definition at line 225 of file QueueTaskBase_T.h.
Referenced by OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::close(), and OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::open().
|
private |
The request queue.
Definition at line 213 of file QueueTaskBase_T.h.
Referenced by OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::add(), and OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::svc().
|
private |
Flag used to initiate a shutdown request to all worker threads.
Definition at line 222 of file QueueTaskBase_T.h.
Referenced by OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::add(), OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::close(), OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::is_shutdown_initiated(), and OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::svc().
|
private |
The id of the thread created by this task.
Definition at line 228 of file QueueTaskBase_T.h.
Referenced by OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::close(), and OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::svc().
|
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.
Definition at line 219 of file QueueTaskBase_T.h.
Referenced by OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::add(), OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::close(), and OpenDDS::DCPS::QueueTaskBase< DataLink_rch >::svc().