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

LoggingAdvocate.hh

Go to the documentation of this file.
00001 /*
00002  * LoggingAdvocate.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 LoggingAdvocate.hh
00014  *
00015  * Header file for the LoggingAdvocate class.
00016  */
00017 
00018 #ifndef _logging_advocate_hh
00019 #define _logging_advocate_hh
00020 
00021 #include <iostream>
00022 
00023 #include <RealTimeTaskDelegateImpl.hh>
00024 
00025 /**
00026  * A Broker::RealTimeAdvocate that suggests the task gets the exact amount of
00027  * compute time as needed by the last period.
00028  */
00029 class LoggingAdvocate : public virtual RealTimeTaskDelegateImpl
00030 {
00031 
00032 public:
00033 
00034     LoggingAdvocate(void);
00035 
00036     virtual ~LoggingAdvocate(void);
00037 
00038     virtual void SetDelegateAttribute(const char *id,
00039                                       const CORBA::Any &value)
00040         throw (CORBA::SystemException);
00041 
00042     virtual void ReportCPU(Broker::RealTimeTask_ptr rtt,
00043                            CORBA::ULong status,
00044                            CORBA::ULong advice)
00045         throw (CORBA::SystemException);
00046 
00047 protected:
00048 
00049     /**
00050      * The time that this object was constructed.
00051      */
00052     struct timeval eta_StartTime;
00053 
00054     /**
00055      * The last time that the CPU usage was logged.
00056      */
00057     struct timeval eta_LastCPULog;
00058 
00059     /**
00060      * The output stream for the CPU usage log.
00061      */
00062     ofstream *eta_CPULog;
00063 
00064     /**
00065      * The last time the advice was logged.
00066      */
00067     struct timeval eta_LastAdviceLog;
00068 
00069     /**
00070      * The output stream for the advice log.
00071      */
00072     ofstream *eta_AdviceLog;
00073 
00074     /**
00075      * The output stream for the completion log.
00076      */
00077     ofstream *eta_CompleteLog;
00078 
00079 };
00080 
00081 #endif

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