Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

StrictPolicyDelegateImpl.hh

Go to the documentation of this file.
00001 /*
00002  * StrictPolicyDelegateImpl.hh
00003  *
00004  * Copyright (c) 2003 The University of Utah and the Flux Group.
00005  * All rights reserved.
00006  *
00007  * This file is licensed under the terms of the GNU Public License.  
00008  * See the file "license.terms" for restrictions on redistribution 
00009  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  */
00011 
00012 /**
00013  * @file StrictPolicyDelegateImpl.hh
00014  *
00015  * Header file for the StrictPolicyDelegateImpl class.
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  * Base class for objects that wish to act as a delegate of a
00026  * BrokerPolicies::StrictPolicy object.
00027  *
00028  * @param T The main object type.
00029  * @param T_var The object's _var type.
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      * Construct a StrictPolicyDelegateImpl object.
00041      */
00042     StrictPolicyDelegateImpl(void)
00043     {
00044     };
00045 
00046     /**
00047      * Deconstruct a StrictPolicyDelegateImpl object.
00048      */
00049     virtual ~StrictPolicyDelegateImpl(void)
00050     {
00051     };
00052 
00053     /** @copydoc Broker::Policy::Name */
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     /** @copydoc Broker::Policy::AddTask */
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     /** @copydoc Broker::Policy::RemoveTask */
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     /** @copydoc Broker::Policy::Activate */
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     /** @copydoc Broker::Policy::Deactivate */
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     /** @copydoc Broker::Policy::ChangeTaskCPU */
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     /** @copydoc BrokerPolicies::StrictPolicy::GetMaxCPUAllocation */
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     /** @copydoc BrokerPolicies::StrictPolicy::SetMaxCPUAllocation */
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     /** @copydoc Broker::Policy::GetTaskList */
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     /** @copydoc BrokerPolicies::StrictPolicy::SetTaskPriority */
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     /** @copydoc BrokerPolicies::StrictPolicy::GetTaskPriority */
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

Generated on Mon Dec 1 16:29:07 2003 for CPU Broker by doxygen 1.3.4