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

DC_TestTracer Class Reference

#include <DC_TestTracer.h>

Inheritance diagram for DC_TestTracer:

Tracer CC_RootObject List of all members.

Detailed Description

Implementation of a test tracer that sends the trace signals to a log file.

The dummy tracer can be useful during a test phase when no external test set-up is available. The log file simulates the external test set-up. Depending on the value of a compiler switch, the log file is either a proper file or the standard output. The latter case may allow use of this component in an embedded environment where no file system is available.

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

Definition at line 27 of file DC_TestTracer.h.

Public Member Functions

 DC_TestTracer (void)
 Instantiate a test tracer object.

void closeLogFile (void)
 In a desktop environment, flush and close the log file.

const char *const getLogFileName (void)
 In a desktop environment, return the name of the log file.


Protected Member Functions

virtual void sendRawTrace (TD_TraceItem traceItem) const
 Wwrite the trace item to the log file.


Constructor & Destructor Documentation

DC_TestTracer::DC_TestTracer void   ) 
 

Instantiate a test tracer object.

The log file is opened and a header is written to it. If the MS_HOST compiler switch is defined, the log file is a proper file. Otherwise, it is the standard output. In the former case, the name of the log file is hardcoded as a test constant. Note that responsibility for closing the log file rests with the user (through method closeLogFile).

See also:
closeLogFile

MS_HOST

TEST_TRACER_LOG_FILE

Tracer#setEnabledStatus

Definition at line 19 of file DC_TestTracer.cpp.


Member Function Documentation

void DC_TestTracer::closeLogFile void   ) 
 

In a desktop environment, flush and close the log file.

In an embedded environment, no action is taken. This method should not be called more than once. There is no way to open the log file after it has been closed.

See also:
closeLogFile

TestCompilerSwitches#MS_HOST

TestConstants::TEST_TRACER_LOG_FILE

Tracer::setEnabled

Definition at line 50 of file DC_TestTracer.cpp.

const char *const DC_TestTracer::getLogFileName void   ) 
 

In a desktop environment, return the name of the log file.

In an embedded environment, return pNULL.

See also:
TEST_TRACER_LOG_FILE
Returns:
the name of the log file or pNULL if the standard output is used as log file

Definition at line 58 of file DC_TestTracer.cpp.

void DC_TestTracer::sendRawTrace TD_TraceItem  traceItem  )  const [protected, virtual]
 

Wwrite the trace item to the log file.

The trace item is written using the printf (embedded environment) or fprintf (desktop environment) library function with the x format specifier. It is assumed that the TD_TraceItem is compatible with this this specifier. This method should be called only when the log file is still open.

See also:
closeLogFile

Tracer::sendRawTrace

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

Implements Tracer.

Definition at line 41 of file DC_TestTracer.cpp.


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