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
;
21 typedef _QoSDescriptor_t QoSDescriptor_t
;
23 typedef Kokyu::Fixed_Priority_Comparator
<QoSDescriptor_t
> QoSComparator_t
;
28 u_long
operator () (const Guid_t
& id
)
30 return ACE::hash_pjw ((const char *) id
.get_buffer (),
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
43 FP_Segment_Sched_Param_Policy ();
44 FP_Segment_Sched_Param_Policy (const FP_Segment_Sched_Param_Policy
&rhs
);
46 FP_Scheduling::SegmentSchedulingParameter
value (
50 const FP_Scheduling::SegmentSchedulingParameter
& value
53 virtual CORBA::Policy_ptr
copy ();
55 virtual CORBA::PolicyType
policy_type (void);
57 virtual void destroy ();
60 FP_Scheduling::SegmentSchedulingParameter value_
;
63 class Kokyu_DSRT_Schedulers_Export Fixed_Priority_Scheduler
:
64 public FP_Scheduling::FP_Scheduler
,
65 public ::CORBA::LocalObject
69 Fixed_Priority_Scheduler (CORBA::ORB_ptr orb
,
70 Kokyu::DSRT_Dispatcher_Impl_t
,
74 ~Fixed_Priority_Scheduler (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
,
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
,
90 CORBA::Policy_ptr sched_param
,
91 CORBA::Policy_ptr implicit_sched_param
);
93 virtual void update_scheduling_segment (const RTScheduling::Current::IdType
& guid
,
95 CORBA::Policy_ptr sched_param
,
96 CORBA::Policy_ptr implicit_sched_param
);
98 virtual void end_scheduling_segment (const RTScheduling::Current::IdType
& guid
,
101 virtual void end_nested_scheduling_segment (const RTScheduling::Current::IdType
& guid
,
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
,
142 CORBA::Policy_ptr scheduling_parameter
);
146 IOP::Codec_var codec_
;
147 RTScheduling::Current_var current_
;
148 Kokyu::DSRT_Dispatcher_Factory
<FP_Scheduler_Traits
>::DSRT_Dispatcher_Auto_Ptr
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