Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Tracer Class Reference

#include <Tracer.h>

Inheritance diagram for Tracer:

CC_RootObject DC_DummyTracer DC_TestTracer List of all members.

Detailed Description

Base class from which all tracer classes are derived.

A tracer is a component that can send trace signals to an external test set-up. A trace signal is made up of one or more trace items. A trace item is an elementary item of trace information that is sent to the test set-up in one single operation.

Two types of trace signals are recognized: a Synch Trace, and a Packet Trace. A synch trace consists of one single trace item. A packet trace consists of a sequence of trace items.

The tracer can be enabled or disabled. Calls to the services to send trace signals in a tracer that is disabled have no effect.

This class is abstract because the implementation of the services that send the trace signals must be specified in the derived classes that implement concrete tracers.

Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

Definition at line 38 of file Tracer.h.

Public Member Functions

 Tracer (void)
 Instantiate a tracer object.

void sendSynchTrace (TD_TraceItem traceId) const
 Send a Synch trace signal if the tracer is enabled.

void sendPacketTrace (unsigned int n, TD_TraceItem traceData[]) const
 Send a packet trace signal if the tracer is enabled.

virtual void setEnabled (bool isEnabled)
 Set the enable status of the tracer.

bool isEnabled (void) const
 Check the enable status of the tracer.


Protected Member Functions

virtual void sendRawTrace (TD_TraceItem rawItem) const =0
 Encapsulate the mechanism to send one single tracer item over the trace channel to the external test set-up.


Constructor & Destructor Documentation

Tracer::Tracer void   ) 
 

Instantiate a tracer object.

The enabled status of the tracer must be initialized to "enabled".

Definition at line 15 of file Tracer.cpp.


Member Function Documentation

bool Tracer::isEnabled void   )  const [inline]
 

Check the enable status of the tracer.

Returns:
true if the profile is enabled, false otherwise

Definition at line 13 of file Tracer_inl.h.

void Tracer::sendPacketTrace unsigned int  n,
TD_TraceItem  traceData[]
const
 

Send a packet trace signal if the tracer is enabled.

If the tracer is disabled, the method call has no effect. A pseudo-code implementation for this method is as follows:

    if ( isEnabled() )
    {  for (int i=0; i smaller than number of items in packet; i++)
       {  TD_TraceItem b = . . .  // form i-th item of the packet trace
          sendRawTrace(b);
       }
    } 
The sendRawTrace() method is abstract and encapsulates the implementation of the raw trace signal sending. Thus, this class enforces the management of the enabled status and transform the sequence of trace data into elementary trace item to be sent to the test set-up in sequence but delegates implementation of the sending mechanism to derived classes implementing concrete tracers.
Parameters:
n number of trace data elements
traceData array of trace data

Definition at line 24 of file Tracer.cpp.

virtual void Tracer::sendRawTrace TD_TraceItem  rawItem  )  const [protected, pure virtual]
 

Encapsulate the mechanism to send one single tracer item over the trace channel to the external test set-up.

This method is called by methods sendLedTrace(), sendSynchTrace() and sendPacketTrace() in this same class. User of a tracer object do not see method sendRawTrace(), they only see the sendXxxTrace() methods.

See also:
sendSynchTrace

sendPacketTrace

Parameters:
rawItem the trace item to be sent to the test set-up

Implemented in DC_DummyTracer, and DC_TestTracer.

void Tracer::sendSynchTrace TD_TraceItem  traceId  )  const
 

Send a Synch trace signal if the tracer is enabled.

If the tracer is disabled, the method call has no effect. A pseudo-code implementation for this method is as follows:

    if ( isEnabled() )
    {  sendRawTrace(traceId);
    } 
The sendRawTrace() method is abstract and encapsulates the implementation of the raw trace signal sending. Thus, this class enforces the management of the enabled status but delegates implementation of the sending mechanism to derived classes implementing concrete tracers.
Parameters:
traceId the trace identifier

Definition at line 19 of file Tracer.cpp.

void Tracer::setEnabled bool  isEnabled  )  [virtual]
 

Set the enable status of the tracer.

When the tracer is disabled, a call to its trace sending methods has no effect.

Parameters:
isEnabled if true, then the tracer is enabled; if false, then the profile is disabled

Definition at line 31 of file Tracer.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved