00001 /* 00002 * GlacialTaskAdvocate.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 GlacialTaskAdvocate.hh 00014 * 00015 * Header file for the GlacialTaskAdvocate class. 00016 */ 00017 00018 #ifndef _glacial_task_advocate_hh 00019 #define _glacial_task_advocate_hh 00020 00021 #include <RealTimeTaskDelegateImpl.hh> 00022 00023 /** 00024 * An ExactTaskAdvocate that is slower to react to changes in the required 00025 * amount of CPU time. 00026 */ 00027 class GlacialTaskAdvocate : public virtual RealTimeTaskDelegateImpl 00028 { 00029 00030 public: 00031 00032 GlacialTaskAdvocate(void); 00033 00034 virtual ~GlacialTaskAdvocate(void); 00035 00036 /** 00037 * Compute a new processing time advice from the given status value. The 00038 * glacial implementation will use the advice reported by the parent class 00039 * and temper the change by some factor. 00040 * 00041 * @param rtt The task object that was actually added to the manager. 00042 * @param status The CPU usage of the task in microseconds. 00043 * @param advice The amount of CPU time, in microseconds, that the 00044 * application would like for the next period. 00045 * @return A processing time with a smaller change than that reported by 00046 * the parent. 00047 * @exception CORBA::BAD_INV_ORDER if the method is called without 00048 * BeginCPUScheduling() being called first. 00049 */ 00050 virtual void ReportCPU(Broker::RealTimeTask_ptr rtt, 00051 CORBA::ULong status, 00052 CORBA::ULong advice) 00053 throw (CORBA::SystemException); 00054 00055 private: 00056 00057 /** 00058 * The last advice reported by this advocate. 00059 */ 00060 CORBA::ULong gta_LastAdvice; 00061 00062 }; 00063 00064 #endif