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) )
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 {
00069 if( CORBA::is_nil(this->dm_RemoteObject) )
00070 {
00071 throw CORBA::BAD_INV_ORDER();
00072 }
00073 this->dm_RemoteObject->AddTask(new_task, sp);
00074 };
00075
00076
00077 virtual void RemoveTask(Broker::Task_ptr added_task)
00078 throw (CORBA::SystemException)
00079 {
00080 if( CORBA::is_nil(this->dm_RemoteObject) )
00081 {
00082 throw CORBA::BAD_INV_ORDER();
00083 }
00084 this->dm_RemoteObject->RemoveTask(added_task);
00085 };
00086
00087
00088 virtual void Activate(const Broker::TaskList &tasks)
00089 throw (CORBA::SystemException)
00090 {
00091 if( CORBA::is_nil(this->dm_RemoteObject) )
00092 {
00093 throw CORBA::BAD_INV_ORDER();
00094 }
00095 this->dm_RemoteObject->Activate(tasks);
00096 };
00097
00098
00099 virtual void Deactivate(void)
00100 throw (CORBA::SystemException)
00101 {
00102 if( CORBA::is_nil(this->dm_RemoteObject) )
00103 {
00104 throw CORBA::BAD_INV_ORDER();
00105 }
00106 this->dm_RemoteObject->Deactivate();
00107 };
00108
00109
00110 virtual void ChangeTaskCPU(Broker::RealTimeTask_ptr task,
00111 CORBA::ULong ct,
00112 CORBA::ULong status,
00113 CORBA::ULong advice)
00114 throw (CORBA::SystemException, Broker::InvalidState)
00115 {
00116 if( CORBA::is_nil(this->dm_RemoteObject) )
00117 {
00118 throw CORBA::BAD_INV_ORDER();
00119 }
00120 this->dm_RemoteObject->ChangeTaskCPU(task, ct, status, advice);
00121 };
00122
00123
00124 virtual CORBA::Float GetMaxCPUAllocation(void)
00125 throw (CORBA::SystemException)
00126 {
00127 if( CORBA::is_nil(this->dm_RemoteObject) )
00128 {
00129 throw CORBA::BAD_INV_ORDER();
00130 }
00131 return this->dm_RemoteObject->GetMaxCPUAllocation();
00132 };
00133
00134
00135 virtual void SetMaxCPUAllocation(CORBA::Float amount)
00136 throw (CORBA::SystemException)
00137 {
00138 if( CORBA::is_nil(this->dm_RemoteObject) )
00139 {
00140 throw CORBA::BAD_INV_ORDER();
00141 }
00142 this->dm_RemoteObject->SetMaxCPUAllocation(amount);
00143 };
00144
00145
00146 virtual Broker::TaskList *GetTaskList(void)
00147 throw (CORBA::SystemException)
00148 {
00149 if( CORBA::is_nil(this->dm_RemoteObject) )
00150 {
00151 throw CORBA::BAD_INV_ORDER();
00152 }
00153 return this->dm_RemoteObject->GetTaskList();
00154 };
00155
00156
00157 virtual void SetTaskPriority(Broker::Task_ptr task, CORBA::Short priority)
00158 throw (CORBA::SystemException)
00159 {
00160 if( CORBA::is_nil(this->dm_RemoteObject) )
00161 {
00162 throw CORBA::BAD_INV_ORDER();
00163 }
00164 this->dm_RemoteObject->SetTaskPriority(task, priority);
00165 };
00166
00167
00168 virtual CORBA::Short GetTaskPriority(Broker::Task_ptr task)
00169 throw (CORBA::SystemException)
00170 {
00171 if( CORBA::is_nil(this->dm_RemoteObject) )
00172 {
00173 throw CORBA::BAD_INV_ORDER();
00174 }
00175 return this->dm_RemoteObject->GetTaskPriority(task);
00176 };
00177
00178 };
00179
00180 #endif