desystem.h

Go to the documentation of this file.
00001 /*
00002   $Id: desystem.h,v 1.3 2004/12/12 23:44:44 pecos Exp $
00003 */  
00004 
00005 /* *********
00006 *  
00007 *  This file is part of:
00008 *  NePSing, Network Protocol Simulator next generation
00009 *  
00010 *  Copyright (C) 2004  Tommaso Pecorella <tpecorella@mac.com>
00011 *  
00012 *  This library is free software; you can redistribute it and/or
00013 *  modify it under the terms of the GNU Lesser General Public
00014 *  License as published by the Free Software Foundation; either
00015 *  version 2.1 of the License, or (at your option) any later version.
00016 *  
00017 *  This library is distributed in the hope that it will be useful,
00018 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 *  Lesser General Public License for more details.
00021 *  
00022 *  You should have received a copy of the GNU Lesser General Public
00023 *  License along with this library; if not, write to the Free Software
00024 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 *  
00026 ********* */
00027 
00034 #ifndef ___DESYSTEM_H___
00035 #define ___DESYSTEM_H___
00036 
00037 #include "parmanager.h"
00038 #include "gprobemanager.h"
00039 #include "probemanager.h"
00040 #include "rndgen.h"
00041 #include "dedebug.h"
00042 #include "deevent.h"
00043 
00044 class DEScheduler;
00045 
00047 
00068 class DESystem
00069 {
00070 protected: 
00071   DEScheduler *Sched;
00072   DETime Time;
00073 
00074   DETime CheckInterval;
00075 
00076   DEDebug* Dbg;
00077   void NewCheckPoint();
00078 
00079   ParamManager* Param;
00080   GlobalProbeManager* Results;
00081   ProbeManager* ProbeMgr;
00082 
00083   int RunNumber;
00084 
00085 public:
00087 
00109     DESystem(ParamManager* _Param, 
00110              GlobalProbeManager* _Results, 
00111              ProbeManager* _ProbeMgr,  
00112              int _TimeResolution,                 
00113              time_int _TicksPerStep,              
00114              time_int _StepsPerBigstep,           
00115              time_int _BigstepsPerSuperstep       
00116              );
00117 
00118   virtual ~DESystem();
00119 
00121   const DETime& getTime() const;
00122 
00124   virtual void Initialize();
00125 
00127   void Run();
00128 
00129   // Handler of DECheckEvent. 
00130   /*  
00131     Actually this function does nothing. It must be overridden to
00132     do periodic jobs like updating of statistics ecc.  
00133   */
00134   virtual void CheckPoint();
00135 
00136   // Returns a reference to the scheduler, used internally
00137   DEScheduler& getSched();
00138 
00139   static void addParameters(ParamManager *Param);
00140 
00141   friend class DEDevice;
00142   friend class DECheckEvent;
00143 };
00144 
00145 
00146 // Event used by DESystem to do periodic jobs.
00147 class DECheckEvent : public DEEvent
00148 {
00149 protected:
00150   DESystem &sys;
00151 
00152 public:
00153   DECheckEvent( DETime Time, DESystem &_sys);
00154   virtual const char *Type() const;
00155   virtual void print(ostream &os) const;
00156   virtual bool EvCompareTarget(void *target);
00157   void Handler();
00158 };
00159 
00160 
00161 
00162 #endif
00163 
00164 
00165 
00166 
00167 /*
00168 
00169   $Log: desystem.h,v $
00170   Revision 1.3  2004/12/12 23:44:44  pecos
00171   Added Copyright message - LGPL
00172 
00173   Revision 1.2  2004/12/11 23:53:25  pecos
00174   Added DoxyGen comments
00175 
00176   Revision 1.1.1.1  2004/07/08 16:59:33  pecos
00177   NePSing framework
00178 
00179   Revision 1.2  2000/01/20 11:21:58  pecos
00180   no message
00181 
00182   Revision 1.1.1.1  1999/05/24 15:59:57  inesis
00183   INeSiS Project
00184 
00185   Revision 1.1.1.1  1999/05/24 15:17:20  inesis
00186   INeSiS Project
00187 
00188   Revision 1.1  1999/01/02 09:09:22  nanni
00189   *** empty log message ***
00190 
00191 
00192 */

Generated on Wed Dec 22 23:23:47 2004 for NePSing by doxygen 1.3.9.1 ---- Hosted by SourceForge.net Logo