DEDebug Class Reference

Class used to print debugging messages during the simulation. More...

#include <dedebug.h>

Collaboration diagram for DEDebug:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DEDebug (ostream &_os=cout, int _DbgLevel=0, DETime _StartTime=0.0, int _StartRun=0, DETime _PrintInterval=DETime())
 Constructs a DEDebug with specified parameters.
void Initialize ()
 Initializes the debugger.
void SchedulerExecEvent (DEScheduler *Sched)
 Function called by the sceduler to print its queues information.
void CurrentTime (DETime &Time, int _Run)
 Set the current debug time and run to Time and Run respectively.
bool isDebugging ()
 Returns true if the current time is between Start and Stop.
DEDebugoperator<< (const char *x)
 Operator used to print user debugging messages of type string.
void ErrorMessage (const char *x)
 Prints an user error message in every debug level.

Public Attributes

ostream & os
 stream where to print debugging informations

Related Functions

(Note that these are not member functions.)

template<class T>
DEDebugoperator<< (DEDebug &dbg, const T &x)
 Template operator used to print user debugging messages of any type other than string.

Detailed Description

Class used to print debugging messages during the simulation.

An instance of this class can optionally be passed to the instance of DESystem to print debugging information during the simulation.

It can be used to print information on the events which are being executed, as well as user information.

This can be done by means of the operator << as in the following example:

  if (Dbg)
    *Dbg << "MyVar=" << MyVar;

where Dbg is a pointer to the DEDebug class, and MyVar is a variable to be printed.

"Debugger" parameters:
Param Type Param Name Default value span or allowed values meaning
BitmaskParameter DebugLevel TimeStamps TimeStamps
Events
EventQueue
Messages
Represents which informations are to be printed during execution:
  • None : no debugging informations
  • TimeStamps : print a timestamp every DebugPrintInterval
  • Events : print every event before executing it
  • EventQueue : print the event heap before executing each event
  • Messages : print execution messages while executing events
DETimeParameter DebugStartTime 0 [0,SimulationTime) Time when to start printing in debug levels 'Events', 'EventQueue' and 'Messages'
IntParameter DebugStartRun 0 [0,SimulationTime) Run number when to start printing in debug levels 'Events', 'EventQueue' and 'Messages'
DETimeParameter DebugPrintInterval 10 (0,SimulationTime) Time interval between printing of timestamps in debugging level 'TimeStamps'
BitmaskParameter DebugPrintMask AbsT+Step+RStep+
Offset+Paren
AbsT
SStep
BStep
Step
RBStep
RStep
Offset
Paren
Represents the printing format of timestamps:
  • AbsT : Absolute time
  • SStep : Absolute superframe
  • BStep : Absolute frame
  • Step : Absolute slot
  • RBStep : Frame position in superframe
  • RStep : Slot position in frame
  • Offset : Offset (ticks from the step beginning)
  • Paren : Encloses in parenthesis


Constructor & Destructor Documentation

DEDebug::DEDebug ostream &  _os = cout,
int  _DbgLevel = 0,
DETime  _StartTime = 0.0,
int  _StartRun = 0,
DETime  _PrintInterval = DETime()
 

Constructs a DEDebug with specified parameters.

Parameters:
_os is the stream used to print debugging informations (default cout)
_DbgLevel is a bitmask specifying what information to print according to the following table:
  • 1 : print a timestamp every "DebugPrintInterval"
  • 2 : print every event before executing it
  • 4 : print the event heap before executing each event
  • 8 : print execution messages while executing events
_StartTime is the time when DEDebug starts printing information of level 2 and above (defaults to the beginning of the simulation)
_StartRun is the run when DEDebug starts printing information of level 2 and above (defaults to the first run)
_PrintInterval is the time between printig of level 1 debugging informations.
Remarks:
No need to call this, as debugger's parameters are set up via file parameters.


The documentation for this class was generated from the following file:
Generated on Wed Dec 22 23:23:48 2004 for NePSing by doxygen 1.3.9.1 ---- Hosted by SourceForge.net Logo