3 * @file Dispatcher_Task.h
5 * @author Venkita Subramonian (venkita@cs.wustl.edu)
7 * Based on previous work by Tim Harrison (harrison@cs.wustl.edu),
8 * Chris Gill, Carlos O'Ryan and other members of the DOC group.
11 #ifndef DISPATCHER_TASK_H
12 #define DISPATCHER_TASK_H
13 #include /**/ "ace/pre.h"
15 #include "ace/Lock_Adapter_T.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "Kokyu_defs.h"
25 class Dispatch_Queue_Item
: public ACE_Message_Block
29 const Dispatch_Command
* cmd
,
30 const QoSDescriptor
& qos_info
,
31 ACE_Allocator
* mb_allocator
=0);
34 const Dispatch_Command
* cmd
,
35 const QoSDescriptor
& qos_info
,
36 ACE_Data_Block
* data_block
,
38 ACE_Allocator
* mb_allocator
=0);
40 Dispatch_Command
* command ();
43 void init_i(const QoSDescriptor
&);
46 const Dispatch_Command
* command_
;
47 QoSDescriptor qos_info_
;
51 * @class Dispatcher_Task
53 * @brief Implement the dispatching queues for FIFO and Priority
56 class Dispatcher_Task
: public ACE_Task
<ACE_SYNCH
>
60 Dispatcher_Task (const ConfigInfo
& config_info
,
61 ACE_Thread_Manager
* thr_manager
= 0);
67 int enqueue (const Dispatch_Command
* cmd
,
68 const QoSDescriptor
& qos_info
);
70 /// Process the events in the queue.
73 const ConfigInfo
& get_curr_config_info() const;
74 Priority_t
preemption_priority() const;
77 static int get_native_prio();
80 ConfigInfo curr_config_info_
;
82 ACE_Allocator
*allocator_
;
85 /// Helper data structure to minimize memory allocations...
86 ACE_Locked_Data_Block
<ACE_Lock_Adapter
<ACE_SYNCH_MUTEX
> > data_block_
;
89 ACE_Message_Queue
<ACE_SYNCH
>* the_queue_
;
91 ACE_Deadline_Message_Strategy deadline_msg_strategy_
;
92 ACE_Laxity_Message_Strategy laxity_msg_strategy_
;
96 #if defined (__ACE_INLINE__)
97 #include "Dispatcher_Task.inl"
98 #endif /* __ACE_INLINE__ */
100 #include /**/ "ace/post.h"
101 #endif /* DISPATCHER_TASK_H */