Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / examples / Kokyu_dsrt_schedulers / EDF_Scheduler.h
blobf29d4b42b5248db2c823af8ecb660bb1142e3b59
1 #ifndef EDF_SCHEDULER_H
2 #define EDF_SCHEDULER_H
4 #include "tao/RTScheduling/RTScheduler.h"
5 #include "EDF_SchedulingC.h"
6 #include "Kokyu/Kokyu_dsrt.h"
7 #include "Kokyu_dsrt_schedulers_export.h"
8 #include "tao/LocalObject.h"
9 #include "ace/Reactor.h"
10 #include "tao/ORB_Core.h"
12 struct EDF_Scheduler_Traits
14 typedef RTScheduling::Current::IdType Guid_t;
16 typedef TimeBase::TimeT Time_t;
18 struct _QoSDescriptor_t
20 typedef long Importance_t;
22 typedef TimeBase::TimeT Time_t;
24 Importance_t importance_;
25 Time_t deadline_;
26 Time_t period_;
27 int task_id_;
30 typedef _QoSDescriptor_t QoSDescriptor_t;
32 typedef Kokyu::EDF_Comparator<QoSDescriptor_t> QoSComparator_t;
34 class _Guid_Hash
36 public:
37 u_long operator () (const Guid_t& id)
39 return ACE::hash_pjw ((const char *) id.get_buffer (),
40 id.length ());
43 typedef _Guid_Hash Guid_Hash;
46 class Kokyu_DSRT_Schedulers_Export EDF_Sched_Param_Policy:
47 public EDF_Scheduling::SchedulingParameterPolicy,
48 public ::CORBA::LocalObject
50 public:
52 EDF_Scheduling::SchedulingParameter value (void);
54 void value (const EDF_Scheduling::SchedulingParameter & value);
56 private:
57 EDF_Scheduling::SchedulingParameter value_;
60 class Kokyu_DSRT_Schedulers_Export EDF_Scheduler:
61 public EDF_Scheduling::Scheduler,
62 public ::CORBA::LocalObject
64 public:
66 EDF_Scheduler (CORBA::ORB_ptr orb,
67 Kokyu::DSRT_Dispatcher_Impl_t,
68 int ace_sched_policy,
69 int ace_sched_scope);
71 ~EDF_Scheduler (void);
74 virtual EDF_Scheduling::SchedulingParameterPolicy_ptr
75 create_scheduling_parameter (const EDF_Scheduling::SchedulingParameter & value);
77 void shutdown (void);
79 virtual void begin_new_scheduling_segment (const RTScheduling::Current::IdType & guid,
80 const char * name,
81 CORBA::Policy_ptr sched_param,
82 CORBA::Policy_ptr implicit_sched_param);
84 virtual void begin_nested_scheduling_segment (const RTScheduling::Current::IdType & guid,
85 const char * name,
86 CORBA::Policy_ptr sched_param,
87 CORBA::Policy_ptr implicit_sched_param);
89 virtual void update_scheduling_segment (const RTScheduling::Current::IdType & guid,
90 const char * name,
91 CORBA::Policy_ptr sched_param,
92 CORBA::Policy_ptr implicit_sched_param);
94 virtual void end_scheduling_segment (const RTScheduling::Current::IdType & guid,
95 const char * name);
97 virtual void end_nested_scheduling_segment (const RTScheduling::Current::IdType & guid,
98 const char * name,
99 CORBA::Policy_ptr outer_sched_param);
101 virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri);
103 virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri);
105 virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri,
106 RTScheduling::Current::IdType_out guid,
107 CORBA::String_out name,
108 CORBA::Policy_out sched_param,
109 CORBA::Policy_out implicit_sched_param);
111 virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri);
113 virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri);
115 virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri);
117 virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri);
119 virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri);
121 virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri);
123 virtual void cancel (const RTScheduling::Current::IdType & guid);
125 virtual CORBA::PolicyList * scheduling_policies (void);
127 virtual void scheduling_policies (const CORBA::PolicyList & scheduling_policies);
129 virtual CORBA::PolicyList * poa_policies (void);
131 virtual char * scheduling_discipline_name (void);
133 virtual RTScheduling::ResourceManager_ptr create_resource_manager (const char * name,
134 CORBA::Policy_ptr scheduling_parameter);
136 virtual void set_scheduling_parameter (PortableServer::Servant & resource,
137 const char * name,
138 CORBA::Policy_ptr scheduling_parameter);
140 Kokyu::DSRT_Dispatcher_Factory<EDF_Scheduler_Traits>::DSRT_Dispatcher_Auto_Ptr
141 kokyu_dispatcher_;
142 private:
143 CORBA::ORB_var orb_;
144 IOP::Codec_var codec_;
145 RTScheduling::Current_var current_;
146 // Kokyu::DSRT_Dispatcher_Factory<EDF_Scheduler_Traits>::DSRT_Dispatcher_Auto_Ptr
147 // kokyu_dispatcher_;
148 Kokyu::DSRT_Dispatcher_Impl_t disp_impl_type_;
149 int ace_sched_policy_;
150 int ace_sched_scope_;
153 //extern int ID_BEGIN;
155 #endif //EDF_SCHEDULER_H