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

GlacialTaskAdvocate.cc

Go to the documentation of this file.
00001 /*
00002  * GlacialTaskAdvocate.cc
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.cc
00014  *
00015  * Implementation of the GlacialTaskAdvocate class.
00016  */
00017 
00018 #include "config.h"
00019 
00020 #include "GlacialTaskAdvocate.hh"
00021 
00022 GlacialTaskAdvocate::GlacialTaskAdvocate(void)
00023 {
00024     this->gta_LastAdvice = 0;
00025 }
00026 
00027 GlacialTaskAdvocate::~GlacialTaskAdvocate(void)
00028 {
00029 }
00030 
00031 void GlacialTaskAdvocate::ReportCPU(Broker::RealTimeTask_ptr rtt,
00032                                     CORBA::ULong status,
00033                                     CORBA::ULong advice)
00034     throw (CORBA::SystemException)
00035 {
00036     CORBA::ULong change;
00037 
00038     if( CORBA::is_nil(this->dm_RemoteObject) )
00039     {
00040         throw CORBA::BAD_INV_ORDER();
00041     }
00042     
00043     if( advice > this->gta_LastAdvice )
00044     {
00045         change = advice - this->gta_LastAdvice;
00046         advice = this->gta_LastAdvice + (change / 4) + 10;
00047     }
00048     else
00049     {
00050         change = this->gta_LastAdvice - advice;
00051         advice = this->gta_LastAdvice - (change / 4);
00052     }
00053     this->gta_LastAdvice = advice;
00054     this->RealTimeTaskDelegateImpl::ReportCPU(rtt, status, advice);
00055 }

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