00001 /* 00002 * MaxTaskAdvocate.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 MaxTaskAdvocate.hh 00014 * 00015 * Header file for the MaxTaskAdvocate class. 00016 */ 00017 00018 #ifndef _max_task_advocate_hh 00019 #define _max_task_advocate_hh 00020 00021 #include "ExactTaskAdvocate.hh" 00022 00023 /** 00024 * An ExactTaskAdvocate that will always advise the maximum required processing 00025 * time it has ever seen. 00026 */ 00027 class MaxTaskAdvocate : public ExactTaskAdvocate 00028 { 00029 00030 public: 00031 00032 /** @copydoc Broker::TaskFactory::CreateTask */ 00033 MaxTaskAdvocate(const Broker::TaskParameters &tp) 00034 throw (CORBA::SystemException, 00035 Broker::DuplicateTaskParameter, 00036 Broker::InvalidTaskParameter, 00037 Broker::MissingTaskParameter); 00038 00039 /** 00040 * Compute a new processing time advice from the given status value. The 00041 * max implementation will compare the advice reported by the parent class 00042 * against the current processing time and return the maximum of the two. 00043 * 00044 * @param status The value passed into ReportCPU. 00045 * @return A processing time that will satisfy all requirements that have 00046 * been encountered so far. 00047 * @exception InvalidStatus if the status value is invalid. 00048 * @exception CORBA::BAD_INV_ORDER if the method is called without 00049 * BeginCPUScheduling() being called first. 00050 */ 00051 virtual CORBA::ULong ComputeAdvice(CORBA::ULong status) 00052 throw (CORBA::SystemException, Broker::InvalidStatus); 00053 00054 }; 00055 00056 #endif