Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / Kokyu / Dispatcher_Task.h
blob55e5cb73e616d5e02de9391165c2651ef2174ff1
1 /* -*- C++ -*- */
2 /**
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.
9 */
11 #ifndef DISPATCHER_TASK_H
12 #define DISPATCHER_TASK_H
13 #include /**/ "ace/pre.h"
14 #include "ace/Task.h"
15 #include "ace/Lock_Adapter_T.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "Kokyu_defs.h"
23 namespace Kokyu
25 class Dispatch_Queue_Item : public ACE_Message_Block
27 public:
28 Dispatch_Queue_Item (
29 const Dispatch_Command* cmd,
30 const QoSDescriptor& qos_info,
31 ACE_Allocator* mb_allocator =0);
33 Dispatch_Queue_Item (
34 const Dispatch_Command* cmd,
35 const QoSDescriptor& qos_info,
36 ACE_Data_Block* data_block,
37 int flags,
38 ACE_Allocator* mb_allocator =0);
40 Dispatch_Command* command ();
42 private:
43 void init_i(const QoSDescriptor&);
45 private:
46 const Dispatch_Command* command_;
47 QoSDescriptor qos_info_;
50 /**
51 * @class Dispatcher_Task
53 * @brief Implement the dispatching queues for FIFO and Priority
54 * dispatching.
56 class Dispatcher_Task : public ACE_Task<ACE_SYNCH>
58 public:
59 /// Constructor
60 Dispatcher_Task (const ConfigInfo& config_info,
61 ACE_Thread_Manager* thr_manager = 0);
64 ~Dispatcher_Task ();
65 int initialize();
67 int enqueue (const Dispatch_Command* cmd,
68 const QoSDescriptor& qos_info);
70 /// Process the events in the queue.
71 int svc ();
73 const ConfigInfo& get_curr_config_info() const;
74 Priority_t preemption_priority() const;
76 private:
77 static int get_native_prio();
79 private:
80 ConfigInfo curr_config_info_;
82 ACE_Allocator *allocator_;
83 int own_allocator_;
85 /// Helper data structure to minimize memory allocations...
86 ACE_Locked_Data_Block<ACE_Lock_Adapter<ACE_SYNCH_MUTEX> > data_block_;
88 /// The queue
89 ACE_Message_Queue<ACE_SYNCH>* the_queue_;
91 ACE_Deadline_Message_Strategy deadline_msg_strategy_;
92 ACE_Laxity_Message_Strategy laxity_msg_strategy_;
94 } //end of namespace
96 #if defined (__ACE_INLINE__)
97 #include "Dispatcher_Task.inl"
98 #endif /* __ACE_INLINE__ */
100 #include /**/ "ace/post.h"
101 #endif /* DISPATCHER_TASK_H */