00001 /* #start# *********************************************************** 00002 00003 Scheduling Simulator 00004 Lehrstuhl f"ur Effiziente Algorithmen 00005 Technische Universit"at M"unchen 00006 00007 File : $Id: SPrecBroker.h,v 1.4 2003/01/08 18:57:12 meierb Exp $ 00008 00009 Purpose : precedence relations must be retrieved via this class. 00010 the broker knows how the prec.rel. is represented and 00011 generates a filter if a different representation is 00012 requested 00013 00014 RCS-Log: 00015 $Log: SPrecBroker.h,v $ 00016 Revision 1.4 2003/01/08 18:57:12 meierb 00017 added randomized release times 00018 00019 Revision 1.1.1.1 2002/12/02 22:26:19 meierb 00020 my_schedule 00021 00022 Revision 1.2 2002/11/11 16:52:52 taeubig 00023 header include changes 00024 00025 Revision 1.1 2002/08/29 12:59:58 taeubig 00026 Added the sources 00027 00028 Revision 1.16 2001/05/16 13:19:57 taeubig 00029 QT headers are included last because of "slots" conflict 00030 00031 Revision 1.15 2000/01/17 13:17:35 zoidl 00032 added javadoc comments 00033 00034 Revision 1.14 1999/10/13 14:42:53 zoidl 00035 added getTypeOfMaster() to enable check whether there is a prec 00036 relation or not 00037 00038 Revision 1.13 1999/10/07 15:57:21 hall 00039 TaskSystem in PrecBroker isn't const anymore 00040 00041 Revision 1.12 1999/08/05 08:48:08 schickin 00042 purpose of important classes noted in the header-files 00043 00044 Revision 1.11 1999/06/17 16:34:40 hall 00045 STopology changed, tuned STSysSchedEvent-stuff and lost more! 00046 00047 Revision 1.10 1999/04/27 13:39:30 schickin 00048 well folks, that's the first demo version that really runs 8-) 00049 00050 Revision 1.9 1999/03/29 12:48:57 schickin 00051 design of modifiers changed (SFooMod is now a member of SFoo). the stuff 00052 compiles and a simple test program runs fine. 00053 00054 Revision 1.8 1999/03/25 14:12:49 schickin 00055 several changes in /model (no real executable yet) 00056 00057 Revision 1.7 1999/03/23 14:26:48 schickin 00058 a lot of new code in /model: things compile but have no functionality 00059 00060 Revision 1.6 1999/02/12 11:55:47 hall 00061 impl. SEnvironment slice 00062 00063 Revision 1.5 1999/02/10 10:50:46 schickin 00064 main loop for simulation added 00065 00066 Revision 1.4 1999/02/09 11:45:17 hall 00067 nc 00068 00069 Revision 1.3 1999/01/29 10:03:45 schickin 00070 Project-Headers added. 00071 00072 00073 * #end# ************************************************************* */ 00074 00075 #ifndef SPRECBROKER_H 00076 #define SPRECBROKER_H 00077 00078 // system header files 00079 00080 // project header files 00081 #include "SPrecDAGInt.h" 00082 #include "SPrecRelation.h" 00083 #include "SPrecIntervalInt.h" 00084 #include "../general/SObservable.h" 00085 #include "../general/SObserver.h" 00086 00087 // we use only a forward declaration of SPrecBrokerMod here (against the 00088 // usual convention) because in SPrecBrokerMod.h SPrecBroker.h has to be 00089 // included. 00090 class SPrecBrokerMod; 00091 00099 class SPrecBroker { 00100 friend class SPrecBrokerMod; 00101 NOCOPY(SPrecBroker); 00102 public: 00105 SPrecBroker(STaskSystem &ts); 00108 virtual ~SPrecBroker(); 00109 00112 //used as index for _isConstructed and _pPrecRelations ! 00113 enum PrecType {NONE = -1, PRECDAG = 0, PRECINTERVAL = 1}; 00114 00117 SPrecRelation& getMaster(); 00120 const SPrecRelation& getMaster() const; 00121 00125 const PrecType getTypeOfMaster() const; 00126 00129 SPrecIntervalInt& getInterval() 00130 { return (SPrecIntervalInt&) getPrec(PRECINTERVAL); }; 00131 00134 SPrecDAGInt& getDAG() 00135 { return (SPrecDAGInt&) getPrec(PRECDAG); }; 00136 00139 virtual SPrecBrokerMod& getModifier() 00140 { return *_pMod; }; 00141 00142 private: 00144 enum { NUMOFRELATIONS = 2 }; 00145 00146 int _typeOfMaster; 00148 bool _isConstructed[NUMOFRELATIONS]; 00151 SPrecRelation *_pPrecRelations[NUMOFRELATIONS]; 00153 SPrecBrokerMod *_pMod; 00154 00155 STaskSystem* _pTaskSys; // can't be const because of precDag.getJob(..) 00156 00157 // internal member functions 00158 00160 SPrecRelation& getPrec(PrecType type); 00161 }; 00162 00163 00164 #endif //SPRECBROKER_H 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186