Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages   Examples  

Trace Class Reference
[Utilities]

Inherited by Simulation.


Detailed Description

The Trace receives marks from TraceProducer objects and informs registered TraceConsumer about these marks.

Author:
Ralf Gerstenberger

See also:
TraceConsumer TraceProducer MarkType Tag
Author:
Ralf Gerstenberger
Date:
created at 2002/03/10

See also:
Trace.cpp
A Trace mechanism is used to report events and state changes of objects in a generalised way. Objects (TraceProducer) generate a sequence of marks, which are send to a trace manager (Trace). The trace manager broadcasts the marks to all registered trace handler (TraceConsumer). A Mark is defined by its type (MarkType). A sender can use one of the predefined mark-functions to send a mark or compose a mark out of tags.

Since:
1.0

Since:
1.0


Public Member Functions

 Trace ()
 Construction.

 ~Trace ()
 Destruction.

Simple trace marks
Simple trace marks are reported by the following methods.

void mark (const TraceProducer *sender, MarkType m, const char *comment=0)
 send most simple trace mark

void mark (const TraceProducer *sender, MarkType m, const TraceProducer *partner, const char *comment=0)
 send marks that includes information about associations of the producer

void mark (const TraceProducer *sender, MarkType m, const TraceProducer *firstPartner, const TraceProducer *secondPartner, const char *comment=0)
 send marks that includes information about associations of the producer

void mark (const TraceProducer *sender, MarkType m, bool newValue, bool oldValue, const char *comment=0)
 send bool-attribute changes

void mark (const TraceProducer *sender, MarkType m, char newValue, char oldValue, const char *comment=0)
 send char-attribute changes

void mark (const TraceProducer *sender, MarkType m, short newValue, short oldValue, const char *comment=0)
 send short-attribute changes

void mark (const TraceProducer *sender, MarkType m, int newValue, int oldValue, const char *comment=0)
 send int-attribute changes

void mark (const TraceProducer *sender, MarkType m, long newValue, long oldValue, const char *comment=0)
 send long-attribute changes

void mark (const TraceProducer *sender, MarkType m, float newValue, float oldValue, const char *comment=0)
 send float-attribute changes

void mark (const TraceProducer *sender, MarkType m, double newValue, double oldValue, const char *comment=0)
 send double-attribute changes

void mark (const TraceProducer *sender, MarkType m, const char *newValue, const char *oldValue, const char *comment=0)
 send const char*-attribute changes

void mark (const TraceProducer *sender, MarkType m, unsigned char newValue, unsigned char oldValue, const char *comment=0)
 send unsigned char-attribute changes

void mark (const TraceProducer *sender, MarkType m, unsigned short newValue, unsigned short oldValue, const char *comment=0)
 send unsigned short-attribute changes

void mark (const TraceProducer *sender, MarkType m, unsigned int newValue, unsigned int oldValue, const char *comment=0)
 send unsigned int-attribute changes

void mark (const TraceProducer *sender, MarkType m, unsigned long newValue, unsigned long oldValue, const char *comment=0)
 send unsigned long-attribute changes

Composed trace marks
Composed trace marks are build with the following methods. A composed trace mark can be interpreted as an sequence of tag-value pairs.

A structure can be build with beginTag() and endTag(). It is recommended but not surveyed that for every beginTag(X) an endTag(X) is called in the appropriate order (XML). A TraceConsumer may rely on a correct order of beginTag() - endTag() calls.

void beginMark (const TraceProducer *sender, MarkType m)
 begin a new composed mark

void endMark ()
 end of composed mark

void beginTag (Tag t)
 called to begin of the composed Tag t.

void endTag (Tag t)
 end tag

void addTag (Tag t, bool value)
 add a tag with a boolean value

void addTag (Tag t, char value)
 add a tag with a char value

void addTag (Tag t, short value)
 add a tag with a short value

void addTag (Tag t, int value)
 add a tag with an int value

void addTag (Tag t, long value)
 add a tag with a long value

void addTag (Tag t, float value)
 add a tag with a float value

void addTag (Tag t, double value)
 add a tag with a double value

void addTag (Tag t, const char *value)
 add a tag with a const char* value

void addTag (Tag t, const TraceProducer *value)
 add a tag with a TraceProducer* value

void addTag (Tag t, unsigned char value)
 add a tag with an unsigned char value

void addTag (Tag t, unsigned short value)
 add a tag with an unsigned short value

void addTag (Tag t, unsigned int value)
 add a tag with an unsigned int value

void addTag (Tag t, unsigned long value)
 add a tag with an unsigned long value

TraceConsumer management
void addConsumer (TraceConsumer *c)
 add Consumer

void removeConsumer (TraceConsumer *c)
 remove Consumer

Trace control
The trace is started with startTrace() end finished with stopTrace() or destruction. pauseTrace() and continueTrace() should be used to signal temporary deactivation of trace generation.

Note:
An open composed mark will be closed by pauseTrace and stopTrace.


void startTrace ()
 start trace

void stopTrace ()
 stop trace

void pauseTrace ()
 break trace

void continueTrace ()
 continue trace


Member Function Documentation

void mark const TraceProducer sender,
MarkType  m,
const char *  comment = 0
 

send most simple trace mark

Parameters:
sender pointer to sender of this mark
m type of this mark
comment comments

void beginMark const TraceProducer sender,
MarkType  m
 

begin a new composed mark

The construction of a new composed mark starts with beginMark(...). If a older mark is still in construction [endMark(...) was not called] it is closed.

void endMark  ) 
 

end of composed mark

The construction of a composed mark is finished by endMark().

void beginTag Tag  t  ) 
 

called to begin of the composed Tag t.

begin a tag end of Tag t


Generated on Mon Aug 11 10:36:07 2003 for ODEMx by doxygen1.3