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

StubRealTimeTask.hh

Go to the documentation of this file.
00001 /*
00002  * StubRealTimeTask.hh
00003  *
00004  * Copyright (c) 2003, 2004 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 StubRealTimeTask.hh
00014  *
00015  * Header file and implementation for the StubRealTimeTask class.
00016  */
00017 
00018 #ifndef _stub_real_time_task_hh
00019 #define _stub_real_time_task_hh
00020 
00021 #include <time_util.h>
00022 
00023 #include "BrokerS.h"
00024 
00025 /**
00026  * A Broker::RealTimeTask class that can be used for testing.
00027  */
00028 class StubRealTimeTask : public POA_Broker::RealTimeTask
00029 {
00030 
00031 public:
00032 
00033     /**
00034      * Construct an empty StubRealTimeTask object.
00035      */
00036     StubRealTimeTask(const char *name)
00037     {
00038         this->srtt_Name = name;
00039     };
00040 
00041     /**
00042      * Deconstruct a StubTask object.
00043      */
00044     virtual ~StubRealTimeTask()
00045     {
00046     };
00047 
00048     /**
00049      * @return The name passed in the constructor.
00050      */
00051     virtual char *Name()
00052         throw (CORBA::SystemException)
00053     {
00054         return( this->srtt_Name._retn() );
00055     };
00056 
00057     /** @copydoc Broker::RealTimeTask::SetManager */
00058     virtual void SetManager(Broker::Manager_ptr man)
00059         throw (CORBA::SystemException)
00060     {
00061         this->srtt_Manager = Broker::Manager::_duplicate(man);
00062     };
00063     
00064     /** @copydoc Broker::RealTimeTask::BeginCPUScheduling */
00065     virtual void BeginCPUScheduling(const Broker::ScheduleParameters &sp)
00066         throw (CORBA::SystemException,
00067                Broker::DuplicateScheduleParameter,
00068                Broker::InvalidScheduleParameter,
00069                Broker::MissingScheduleParameter)
00070     {
00071     };
00072     
00073     /** @copydoc Broker::RealTimeTask::EndCPUScheduling */
00074     virtual void EndCPUScheduling(void)
00075         throw (CORBA::SystemException)
00076     {
00077     };
00078     
00079     /** @copydoc Broker::RealTimeTask::PassCPU */
00080     virtual Broker::CPUReserve PassCPU(Broker::RealTimeTask_ptr rtt,
00081                                        const Broker::CPUReserve &status,
00082                                        const Broker::CPUReserve &advice,
00083                                        const Broker::KeyedReportParameters &krp)
00084         throw (CORBA::SystemException)
00085     {
00086         return this->srtt_Manager->ChangeTaskCPU(rtt, advice);
00087     };
00088 
00089     /** @copydoc Broker::RealTimeTask::ReportCPU */
00090     virtual Broker::CPUReserve ReportCPU(const Broker::CPUReserve &status,
00091                                          const Broker::CPUReserve &advice,
00092                                          const Broker::KeyedReportParameters &krp)
00093         throw (CORBA::SystemException)
00094     {
00095         return this->PassCPU(this->_this(), status, advice, krp);
00096     };
00097 
00098 private:
00099 
00100     /**
00101      * The Broker::Manager used to handle scheduling during contention.  Only
00102      * valid between #BeginCPUScheduling and #EndCPUScheduling calls.
00103      */
00104     Broker::Manager_var srtt_Manager;
00105     
00106     /**
00107      * The task name.
00108      */
00109     CORBA::String_var srtt_Name;
00110     
00111 };
00112 
00113 #endif

Generated on Fri Oct 22 07:50:25 2004 for CPU Broker by  doxygen 1.3.9.1