00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _strict_policy_delegate_impl_hh
00019 #define _strict_policy_delegate_impl_hh
00020
00021 #include "DelegateS.h"
00022 #include "DelegateMixin.hh"
00023
00024
00025
00026
00027
00028
00029
00030
00031 class StrictPolicyDelegateImpl :
00032 public virtual DelegateMixin<BrokerPolicies::StrictPolicy,
00033 BrokerPolicies::StrictPolicy_var>,
00034 public virtual POA_BrokerDelegates::StrictPolicyDelegate
00035 {
00036
00037 public:
00038
00039
00040
00041
00042 StrictPolicyDelegateImpl(void)
00043 {
00044 };
00045
00046
00047
00048
00049 virtual ~StrictPolicyDelegateImpl(void)
00050 {
00051 };
00052
00053
00054 virtual char *Name(void)
00055 throw (CORBA::SystemException)
00056 {
00057 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00058 {
00059 throw CORBA::BAD_INV_ORDER();
00060 }
00061 return this->dm_RemoteObject->Name();
00062 };
00063
00064
00065 virtual void AddTask(Broker::Task_ptr new_task,
00066 const Broker::ScheduleParameters &sp)
00067 throw (CORBA::SystemException,
00068 Broker::DuplicateScheduleParameter,
00069 Broker::InvalidScheduleParameter,
00070 Broker::MissingScheduleParameter)
00071 {
00072 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00073 {
00074 throw CORBA::BAD_INV_ORDER();
00075 }
00076 this->dm_RemoteObject->AddTask(new_task, sp);
00077 };
00078
00079
00080 virtual void RemoveTask(Broker::Task_ptr added_task)
00081 throw (CORBA::SystemException)
00082 {
00083 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00084 {
00085 throw CORBA::BAD_INV_ORDER();
00086 }
00087 this->dm_RemoteObject->RemoveTask(added_task);
00088 };
00089
00090
00091 virtual void Activate(const Broker::TaskList &tasks)
00092 throw (CORBA::SystemException)
00093 {
00094 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00095 {
00096 throw CORBA::BAD_INV_ORDER();
00097 }
00098 this->dm_RemoteObject->Activate(tasks);
00099 };
00100
00101
00102 virtual void Deactivate(void)
00103 throw (CORBA::SystemException)
00104 {
00105 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00106 {
00107 throw CORBA::BAD_INV_ORDER();
00108 }
00109 this->dm_RemoteObject->Deactivate();
00110 };
00111
00112
00113 virtual Broker::CPUReserve ChangeTaskCPU(Broker::RealTimeTask_ptr task,
00114 const Broker::CPUReserve &advice)
00115 throw (CORBA::SystemException, Broker::InvalidState)
00116 {
00117 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00118 {
00119 throw CORBA::BAD_INV_ORDER();
00120 }
00121 return this->dm_RemoteObject->ChangeTaskCPU(task, advice);
00122 };
00123
00124
00125 virtual CORBA::Float GetMaxCPUAllocation(void)
00126 throw (CORBA::SystemException)
00127 {
00128 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00129 {
00130 throw CORBA::BAD_INV_ORDER();
00131 }
00132 return this->dm_RemoteObject->GetMaxCPUAllocation();
00133 };
00134
00135
00136 virtual void SetMaxCPUAllocation(CORBA::Float amount)
00137 throw (CORBA::SystemException)
00138 {
00139 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00140 {
00141 throw CORBA::BAD_INV_ORDER();
00142 }
00143 this->dm_RemoteObject->SetMaxCPUAllocation(amount);
00144 };
00145
00146
00147 virtual Broker::TaskList *GetTaskList(void)
00148 throw (CORBA::SystemException)
00149 {
00150 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00151 {
00152 throw CORBA::BAD_INV_ORDER();
00153 }
00154 return this->dm_RemoteObject->GetTaskList();
00155 };
00156
00157
00158 virtual void SetTaskPriority(Broker::Task_ptr task, CORBA::Short priority)
00159 throw (CORBA::SystemException)
00160 {
00161 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00162 {
00163 throw CORBA::BAD_INV_ORDER();
00164 }
00165 this->dm_RemoteObject->SetTaskPriority(task, priority);
00166 };
00167
00168
00169 virtual CORBA::Short GetTaskPriority(Broker::Task_ptr task)
00170 throw (CORBA::SystemException)
00171 {
00172 if( CORBA::is_nil(this->dm_RemoteObject.in()) )
00173 {
00174 throw CORBA::BAD_INV_ORDER();
00175 }
00176 return this->dm_RemoteObject->GetTaskPriority(task);
00177 };
00178
00179 };
00180
00181 #endif