ClTracer Class Reference

#include <cltracer.h>

Collaboration diagram for ClTracer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ClTracer ()
void addTracer (ClMessageTracer *newTr)
void addCommonTracer (ClMessageTracer *newTr)
void trace (ClMessage *m, ConnectorTrace *clsap)

Private Member Functions

void addTracer (ClMessageTracer *newTr, ClMessageTracer **tr)

Private Attributes

ClMessageTracertr_ [MAXHASHINDEX]
ClMessageTracercommonTr_

Detailed Description

The ClTracer class contains the ClMessageTracer. The ClMessageTracer are stored in an Hash Table in order to improve the performance. The key of the Hash Table is the rest of the division of the Message ID by the constant MAXHASHINDEX. If two or more ClMessageTracer objects have the same key, the ClTrace insert these objects in an circular list. Note that if two or more ClMessageTracer have the same clType_ the simulator does not give error, but the trace file could be unexpected. It is possible to declare a common ClMessageTracer, which proccess all the incoming ClMessage. Note that there could be at most one common ClMessageTracer in the simultation.

See also:
ClMessageTracer

Definition at line 156 of file cltracer.h.


Constructor & Destructor Documentation

ClTracer::ClTracer (  ) 

ClTracer constructor. It set tr_[i]=0 for i=0,...,MAXHASHINDEX-1 and commonTr_=0

See also:
tr_

Definition at line 38 of file cltracer.cc.

References MAXHASHINDEX, and tr_.


Member Function Documentation

void ClTracer::addTracer ( ClMessageTracer newTr  ) 

This method adds a new ClMessageTracer. It compute the key of the ClMessageTracer and call addTracer(ClMessageTracer *, ClMessageTracer**) private method at which it pass the ClMessageTracer that can be added and the pointer of the position in the hash table

Parameters:
newTr pointer to the ClMessageTracer which has to be added
See also:
addTracer(ClMessageTracer *, ClMessageTracer**)

Definition at line 46 of file cltracer.cc.

References ClMessageTracer::clType(), MAXHASHINDEX, and tr_.

Referenced by ConnectorTrace::addTracer().

Here is the call graph for this function:

void ClTracer::addCommonTracer ( ClMessageTracer newTr  ) 

This method adds a new common ClMessageTracer. It set commonTr_ equal to newTr

Parameters:
newTr pointer to the ClMessageTracer which has to be added

Definition at line 54 of file cltracer.cc.

References commonTr_.

Referenced by ConnectorTrace::addCommonTracer().

void ClTracer::trace ( ClMessage m,
ConnectorTrace clsap 
)

Begin the trace of the ClMessage that is crossing the ClSAP. First The ClMessage is processed by the common ClMessageTracer and then by the specific ClMessageTracer in the hash table.

Parameters:
m pointer to the ClMessage to trace
clsap pointer to the ClSAP instance which call this method (useful to write in the BaseTrace)
See also:
ConnectorTrace, ClSAP

Definition at line 82 of file cltracer.cc.

References ClMessageTracer::clType(), commonTr_, ClMessageTracer::format(), MAXHASHINDEX, ClMessageTracer::next(), and tr_.

Referenced by Bin::drop(), ConnectorTrace::trace(), and ConnectorTrace::traceSync().

Here is the call graph for this function:

void ClTracer::addTracer ( ClMessageTracer newTr,
ClMessageTracer **  tr 
) [private]

This method adds a new ClMessageTracer to a circular list which have the first node pointed by *tr

Parameters:
newTr pointer to the ClMessageTracer which has to be added
tr pointer to the pointer of the first element in the circular list (i.e. &tr_[i])
See also:
addTracer(ClMessageTracer *)

Definition at line 61 of file cltracer.cc.

References ClMessageTracer::next().

Here is the call graph for this function:


Member Data Documentation

ClMessageTracer* ClTracer::tr_[MAXHASHINDEX] [private]

ClMessageTracer hash table. Each entry of the array points to the first element of a circular list

Definition at line 209 of file cltracer.h.

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

ClMessageTracer* ClTracer::commonTr_ [private]

Pointer to the common ClMessageTracer. Each incoming ClMessage is processed by the common ClMessageTracer at first, and then by the corresponding ClMessageTRec er in the hash table (if exists)

Definition at line 214 of file cltracer.h.

Referenced by addCommonTracer(), and trace().


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