Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / examples / Kokyu_dsrt_schedulers / FP_Scheduler.h
blob173ad5460a13db0af37730579d5d4329a72f5e57
1 #ifndef FIXED_PRIORITY_SCHEDULER_H
2 #define FIXED_PRIORITY_SCHEDULER_H
4 #include "tao/RTScheduling/RTScheduler.h"
5 #include "tao/CodecFactory/CodecFactory.h"
6 #include "tao/LocalObject.h"
7 #include "FP_SchedulingC.h"
8 #include "Kokyu/Kokyu_dsrt.h"
9 #include "Kokyu_dsrt_schedulers_export.h"
11 struct FP_Scheduler_Traits
13 typedef RTScheduling::Current::IdType Guid_t;
15 struct _QoSDescriptor_t
17 typedef long Priority_t;
18 Priority_t priority_;
21 typedef _QoSDescriptor_t QoSDescriptor_t;
23 typedef Kokyu::Fixed_Priority_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 FP_Segment_Sched_Param_Policy:
39 public FP_Scheduling::SegmentSchedulingParameterPolicy,
40 public ::CORBA::LocalObject
42 public:
43 FP_Segment_Sched_Param_Policy ();
44 FP_Segment_Sched_Param_Policy (const FP_Segment_Sched_Param_Policy &rhs);
46 FP_Scheduling::SegmentSchedulingParameter value (
49 void value (
50 const FP_Scheduling::SegmentSchedulingParameter & value
53 virtual CORBA::Policy_ptr copy ();
55 virtual CORBA::PolicyType policy_type (void);
57 virtual void destroy ();
59 private:
60 FP_Scheduling::SegmentSchedulingParameter value_;
63 class Kokyu_DSRT_Schedulers_Export Fixed_Priority_Scheduler:
64 public FP_Scheduling::FP_Scheduler,
65 public ::CORBA::LocalObject
67 public:
69 Fixed_Priority_Scheduler (CORBA::ORB_ptr orb,
70 Kokyu::DSRT_Dispatcher_Impl_t,
71 int ace_sched_policy,
72 int ace_sched_scope);
74 ~Fixed_Priority_Scheduler (void);
76 void shutdown (void);
78 virtual FP_Scheduling::SegmentSchedulingParameterPolicy_ptr
79 create_segment_scheduling_parameter (
80 const FP_Scheduling::SegmentSchedulingParameter & value
83 virtual void begin_new_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 begin_nested_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 update_scheduling_segment (const RTScheduling::Current::IdType & guid,
94 const char * name,
95 CORBA::Policy_ptr sched_param,
96 CORBA::Policy_ptr implicit_sched_param);
98 virtual void end_scheduling_segment (const RTScheduling::Current::IdType & guid,
99 const char * name);
101 virtual void end_nested_scheduling_segment (const RTScheduling::Current::IdType & guid,
102 const char * name,
103 CORBA::Policy_ptr outer_sched_param);
105 virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri);
107 virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri,
108 RTScheduling::Current::IdType_out guid,
109 CORBA::String_out name,
110 CORBA::Policy_out sched_param,
111 CORBA::Policy_out implicit_sched_param);
113 virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri);
115 virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr ri);
117 virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri);
119 virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri);
121 virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri);
123 virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri);
125 virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri);
127 virtual void cancel (const RTScheduling::Current::IdType & guid);
129 virtual CORBA::PolicyList * scheduling_policies (void);
131 virtual void scheduling_policies (const CORBA::PolicyList & scheduling_policies);
133 virtual CORBA::PolicyList * poa_policies (void);
135 virtual char * scheduling_discipline_name (void);
137 virtual RTScheduling::ResourceManager_ptr create_resource_manager (const char * name,
138 CORBA::Policy_ptr scheduling_parameter);
140 virtual void set_scheduling_parameter (PortableServer::Servant & resource,
141 const char * name,
142 CORBA::Policy_ptr scheduling_parameter);
144 private:
145 CORBA::ORB_var orb_;
146 IOP::Codec_var codec_;
147 RTScheduling::Current_var current_;
148 Kokyu::DSRT_Dispatcher_Factory<FP_Scheduler_Traits>::DSRT_Dispatcher_Auto_Ptr
149 kokyu_dispatcher_;
150 Kokyu::DSRT_Dispatcher_Impl_t disp_impl_type_;
151 int ace_sched_policy_;
152 int ace_sched_scope_;
155 #endif //FIXED_PRIORITY_SCHEDULER_H