Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / examples / Kokyu_dsrt_schedulers / MIF_Scheduler.h
blob987ae99dca67e1985e25cd28e2e1b97720c7172c
1 #ifndef MIF_SCHEDULER_H
2 #define MIF_SCHEDULER_H
4 #include "tao/RTScheduling/RTScheduler.h"
5 #include "tao/CodecFactory/CodecFactory.h"
6 #include "MIF_SchedulingC.h"
7 #include "tao/LocalObject.h"
8 #include "Kokyu/Kokyu_dsrt.h"
9 #include "Kokyu_dsrt_schedulers_export.h"
11 struct MIF_Scheduler_Traits
13 typedef RTScheduling::Current::IdType Guid_t;
15 struct _QoSDescriptor_t
17 typedef long Importance_t;
18 Importance_t importance_;
21 typedef _QoSDescriptor_t QoSDescriptor_t;
23 typedef Kokyu::MIF_Comparator<QoSDescriptor_t> QoSComparator_t;
25 class _Guid_Hash
27 public:
28 u_long operator () (const Guid_t& id)
30 return ACE::hash_pjw ((const char *) id.get_buffer (),
31 id.length ());
35 typedef _Guid_Hash Guid_Hash;
38 class Kokyu_DSRT_Schedulers_Export MIF_Sched_Param_Policy:
39 public MIF_Scheduling::SchedulingParameterPolicy,
40 public ::CORBA::LocalObject
42 public:
43 MIF_Sched_Param_Policy ();
44 MIF_Sched_Param_Policy (const MIF_Sched_Param_Policy &rhs);
46 MIF_Scheduling::SchedulingParameter value ();
48 void value (const MIF_Scheduling::SchedulingParameter & value);
50 virtual CORBA::Policy_ptr copy ();
52 virtual CORBA::PolicyType policy_type ();
54 virtual void destroy ();
56 private:
57 MIF_Scheduling::SchedulingParameter value_;
60 class Kokyu_DSRT_Schedulers_Export MIF_Scheduler:
61 public MIF_Scheduling::Scheduler,
62 public ::CORBA::LocalObject
64 public:
65 MIF_Scheduler (CORBA::ORB_ptr orb,
66 Kokyu::DSRT_Dispatcher_Impl_t,
67 int ace_sched_policy,
68 int ace_sched_scope);
70 ~MIF_Scheduler ();
73 virtual MIF_Scheduling::SchedulingParameterPolicy_ptr
74 create_scheduling_parameter (const MIF_Scheduling::SchedulingParameter & value);
76 void shutdown ();
78 virtual void begin_new_scheduling_segment (const RTScheduling::Current::IdType & guid,
79 const char * name,
80 CORBA::Policy_ptr sched_param,
81 CORBA::Policy_ptr implicit_sched_param);
83 virtual void begin_nested_scheduling_segment (const RTScheduling::Current::IdType & guid,
84 const char * name,
85 CORBA::Policy_ptr sched_param,
86 CORBA::Policy_ptr implicit_sched_param);
88 virtual void update_scheduling_segment (const RTScheduling::Current::IdType & guid,
89 const char * name,
90 CORBA::Policy_ptr sched_param,
91 CORBA::Policy_ptr implicit_sched_param);
93 virtual void end_scheduling_segment (const RTScheduling::Current::IdType & guid,
94 const char * name);
96 virtual void end_nested_scheduling_segment (const RTScheduling::Current::IdType & guid,
97 const char * name,
98 CORBA::Policy_ptr outer_sched_param);
100 virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri);
102 virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri,
103 RTScheduling::Current::IdType_out guid,
104 CORBA::String_out name,
105 CORBA::Policy_out sched_param,
106 CORBA::Policy_out implicit_sched_param);
108 virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri);
110 virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri);
112 virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri);
114 virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri);
116 virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri);
118 virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri);
120 virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri);
122 virtual void cancel (const RTScheduling::Current::IdType & guid);
124 virtual CORBA::PolicyList * scheduling_policies ();
126 virtual void scheduling_policies (const CORBA::PolicyList & scheduling_policies);
128 virtual CORBA::PolicyList * poa_policies ();
130 virtual char * scheduling_discipline_name ();
132 virtual RTScheduling::ResourceManager_ptr create_resource_manager (const char * name,
133 CORBA::Policy_ptr scheduling_parameter);
135 virtual void set_scheduling_parameter (PortableServer::Servant & resource,
136 const char * name,
137 CORBA::Policy_ptr scheduling_parameter);
139 private:
140 CORBA::ORB_var orb_;
141 IOP::Codec_var codec_;
142 RTScheduling::Current_var current_;
143 Kokyu::DSRT_Dispatcher_Factory<MIF_Scheduler_Traits>::DSRT_Dispatcher_Auto_Ptr
144 kokyu_dispatcher_;
145 Kokyu::DSRT_Dispatcher_Impl_t disp_impl_type_;
146 int ace_sched_policy_;
147 int ace_sched_scope_;
150 #endif //MIF_SCHEDULER_H