Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

logging/STextLog.h

Go to the documentation of this file.
00001 /* #start# ***********************************************************
00002 
00003                              Scheduling Simulator
00004                     Lehrstuhl f"ur Effiziente Algorithmen
00005                        Technische Universit"at M"unchen
00006 
00007  File    : $Id: STextLog.h,v 1.2 2002/11/10 20:32:20 taeubig Exp $
00008 
00009  Purpose : the text logger writes all created events to a specific
00010            stream (default: stdout). if a filter is set, only those
00011      events are written that match the filter.
00012 
00013  RCS-Log:
00014  $Log: STextLog.h,v $
00015  Revision 1.2  2002/11/10 20:32:20  taeubig
00016  namespace and header include changes
00017 
00018  Revision 1.1  2002/08/29 12:59:58  taeubig
00019  Added the sources
00020 
00021  Revision 1.6  2000/01/17 10:17:21  zoidl
00022  little changes in javadocs
00023 
00024  Revision 1.5  2000/01/09 21:05:51  zoidl
00025  can protocol all SCHED and EDIT events now, added javadoc comments
00026 
00027  Revision 1.4  2000/01/05 14:32:48  kern
00028  changed setSchedFilter and setEditFilter
00029 
00030  Revision 1.3  2000/01/05 13:29:23  zoidl
00031  forgot some enums for edit filter
00032 
00033  Revision 1.2  1999/12/08 23:02:43  zoidl
00034  added logging of EDITEVENTs
00035 
00036  Revision 1.1  1999/12/07 14:15:13  zoidl
00037  textual event logging moved from SLogger to STextLog
00038 
00039 
00040  * #end# ************************************************************* */
00041 
00042 #ifndef STEXTLOG_H
00043 #define STEXTLOG_H
00044 
00045 // system header files
00046 #include <iostream>
00047 #include <LEDA/array.h>
00048 
00049 // project header files
00050 #include "SLogger.h"
00051 
00060 class STextLog : public virtual SLogger
00061 {
00062  public:
00068   STextLog(STaskSystem& ts, std::ostream& out=std::cout, 
00069      bool registerAsObserver=true);
00072   virtual ~STextLog();
00073   
00079   enum SchedFilter { JOBRESET = 1, JOBSTATECHANGED = 2, 
00080          JOBOVERDUE = 4, JOBPHASEFINISHED = 8, 
00081          JOBALLOCATED = 16, JOBDEALLOCATED = 32, 
00082          MACHINEBROKEN = 64, MACHINEREPAIRED = 128, 
00083          SCHEDALL = 255 };
00084 
00090   enum EditFilter { ADDINGJOB = 1, DELETINGJOB = 2,
00091         JOBSADDED = 4, JOBSDELETED = 8,
00092         CHANGEDMACHINETOPO = 16, 
00093         DEPADDED = 32, DEPDELETED = 64,
00094         EDITALL = 127 };
00095 
00100   virtual void feedEvent(const SEvent& event);
00101   
00106   void setLogStream(std::ostream& out) 
00107     { _pLogStream = &out; };
00108   
00117   void setSchedFilter( int filter ) { _schedFilter = filter; };
00125   void setEditFilter( int filter ) { _editFilter = filter; };
00126 
00127  private:
00128   STaskSystem& _ts;
00129   // write events to this stream (default: stdout)
00130   std::ostream *_pLogStream;
00131   // did we register as observer 
00132   bool _regAsObs;
00133   /* filters for events:
00134      considered as a bit-array, every bit corresponds to a certain event.
00135      true: event is logged, false: ignore event */
00136   int _schedFilter;
00137   int _editFilter;
00138 };
00139 
00140 #endif

Generated on Thu May 22 16:48:08 2003 for Sketch-it! by doxygen1.2.18