ClMessageTracer Class Reference

#include <cltracer.h>

Inheritance diagram for ClMessageTracer:

Inheritance graph
[legend]
Collaboration diagram for ClMessageTracer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ClMessageTracer (ClMessage_t clType)
virtual void format (ClMessage *m, ConnectorTrace *sap)=0
ClMessage_t clType ()
void next (ClMessageTracer *next)
ClMessageTracernext ()

Protected Member Functions

void writeTrace (ConnectorTrace *sap, char *s,...)

Private Attributes

ClMessage_t clType_
ClMessageTracernext_

Detailed Description

A ClMessageTracer is an object which know how to trace a ClMessage. The ClMessage delivery is done by the ClTracer, which check the incoming ClMessage ID and give it to the correctly ClMessageTracer. Hence the incoming ClMessage ID is equal to the ClMessageTracer clType_.
There is only one instance of ClMessageTracer for ClMessage during the simulation. ClMessageTracer has an abstract method format which must be overloaded by the derived classes. This method can permorm the string that will be writen in the trace file with the writeTrace protected method.

See also:
ClMessage, ClSAP, ClTracer, clType_

Definition at line 66 of file cltracer.h.


Constructor & Destructor Documentation

ClMessageTracer::ClMessageTracer ( ClMessage_t  clType  ) 

ClMessageTracer constructor. The clType param indicates the ID of the ClMessage which this class can trace.

Parameters:
clType the ID of the ClMessage which this class can trace
Remarks:
If two ClMessageTracer have the same clType_ the simulation does not return erro, but the output trace can have some lines with a trace format and some lines with the other.
See also:
ClTracer

Definition at line 108 of file cltracer.cc.

References next_.


Member Function Documentation

virtual void ClMessageTracer::format ( ClMessage m,
ConnectorTrace sap 
) [pure virtual]

This method has to write a formatted string with the ClMessage's information using the method writeTrace of the given ClSAP.

Parameters:
m pointer to the ClMessage to be traced
sap pointer to the ClSAP instance which ask for the trace
Remarks:
This method is virtual, thus it must be overloaded. The ClMessageTracer class is a ClSAP friend class, but a derived class can not call the protected method of ClSAP. This mean that when we wants to write a string in the trace file, we have to call the ClMessageTracer writeTrace method passing the ClSAP instance.
See also:
writeTrace, ConnectorTrace, SAP

Implemented in ClCommonTracer, VerboseClCmnTracer, ClMsgPhyMacStartRxTracer, ClMsgPhyMacEndTxTracer, and ClMsgPhyMacCCATracer.

Referenced by ClTracer::trace().

ClMessage_t ClMessageTracer::clType (  ) 

Returns the clType_ of the ClMessageTracer

Returns:
the clType_ of the ClMessageTracer
See also:
clType_

Definition at line 113 of file cltracer.cc.

References clType_.

Referenced by ClTracer::addTracer(), and ClTracer::trace().

void ClMessageTracer::next ( ClMessageTracer next  ) 

Set the next_ ClMessageTracer in the ClTracer objects list (The are stored in a HashTable, but the ClMessageTracer with the same key are stored in a circular list).

Parameters:
next pointer to the next ClMessageTracer
See also:
ClTracer

Definition at line 123 of file cltracer.cc.

References next_.

Referenced by ClTracer::addTracer(), and ClTracer::trace().

ClMessageTracer * ClMessageTracer::next (  ) 

Returns the pointer to the next ClMessageTracer in the ClTracer list

Returns:
tha pointer of the next ClMessageTracer of the ClTracer list
See also:
ClTracer

Definition at line 118 of file cltracer.cc.

References next_.

void ClMessageTracer::writeTrace ( ConnectorTrace sap,
char *  s,
  ... 
) [protected]

This method write a string in the trace file using the method vWriteTRace of the given ClSAP instance

Parameters:
sap the ClSAP instance where the string will write.
s string to be write in the trace file. The sintax is equal to the printf C function
See also:
ConnectorTrace::vWriteTrace, ConnectorTrace, ClSAP

Definition at line 128 of file cltracer.cc.

References ConnectorTrace::vWriteTrace().

Referenced by ClMsgPhyMacCCATracer::format(), ClMsgPhyMacEndTxTracer::format(), ClMsgPhyMacStartRxTracer::format(), VerboseClCmnTracer::format(), and ClCommonTracer::format().

Here is the call graph for this function:


Member Data Documentation

ClMessage_t ClMessageTracer::clType_ [private]

The ID of the ClMessage which this class can trace

Definition at line 138 of file cltracer.h.

Referenced by clType().

ClMessageTracer* ClMessageTracer::next_ [private]

The next ClMessageTracer in the CLTracer chain

Definition at line 142 of file cltracer.h.

Referenced by ClMessageTracer(), and next().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 15:48:29 2008 for NS-MIRACLE library by  doxygen 1.5.2