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

StubTask.hh

Go to the documentation of this file.
00001 /*
00002  * StubTask.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 StubTask.hh
00014  *
00015  * Header file and implementation for the StubTask class.
00016  */
00017 
00018 #ifndef _stub_task_hh
00019 #define _stub_task_hh
00020 
00021 #include "BrokerS.h"
00022 
00023 /**
00024  * A Broker::Task class that can be used for testing.
00025  */
00026 class StubTask : public POA_Broker::Task
00027 {
00028 
00029 public:
00030 
00031     /**
00032      * Construct an empty StubTask object.
00033      */
00034     StubTask()
00035     {
00036     };
00037 
00038     /**
00039      * Deconstruct a StubTask object.
00040      */
00041     virtual ~StubTask()
00042     {
00043     };
00044 
00045     /**
00046      * @return The string "<stub>".
00047      */
00048     virtual char *Name()
00049         throw (CORBA::SystemException)
00050     {
00051         return CORBA::string_dup("<stub>");
00052     };
00053 
00054     /**
00055      * Set the object that will be managing this task.
00056      *
00057      * @param man Stored in the st_Manager field.
00058      */
00059     virtual void SetManager(Broker::Manager_ptr man)
00060         throw (CORBA::SystemException)
00061     {
00062         this->st_Manager = Broker::Manager::_duplicate(man);
00063     };
00064     
00065     /**
00066      * Empty implementation of Broker::Task::BeginCPUScheduling.
00067      *
00068      * @param sp Unused.
00069      */
00070     virtual void BeginCPUScheduling(const Broker::ScheduleParameters &sp)
00071         throw (CORBA::SystemException,
00072                Broker::DuplicateScheduleParameter,
00073                Broker::InvalidScheduleParameter,
00074                Broker::MissingScheduleParameter)
00075     {
00076     };
00077 
00078     /**
00079      * Empty implementation of Broker::Task::EndCPUScheduling.
00080      */
00081     virtual void EndCPUScheduling(void)
00082         throw (CORBA::SystemException)
00083     {
00084         this->st_Manager = Broker::Manager::_nil();
00085     };
00086 
00087 protected:
00088 
00089     /**
00090      * The Broker::Manager used to handle scheduling during contention.  Only
00091      * valid between #BeginCPUScheduling and #EndCPUScheduling calls.
00092      */
00093     Broker::Manager_var st_Manager;
00094     
00095 };
00096 
00097 #endif

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