Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Monitor::Utility::MyTrace Class Reference

Execution trace utility. More...

#include <mytrace.h>

List of all members.

Public Methods

 MyTrace (const string &newTraceMessage)
 Constructor. More...

virtual ~MyTrace ()
 Destructor. More...


Static Public Methods

void setTraceStream (const char *newStreamName)
 Set the file stream to which text is sent. More...

ostream & getTraceStream ()
 Get the stream to which text is being sent. More...


Private Attributes

string traceMessage
 User text for sending to stream. More...


Static Private Attributes

ostream * traceStream = &cerr
 Stream currently being used. More...


Detailed Description

Execution trace utility.

Definition at line 50 of file mytrace.h.


Constructor & Destructor Documentation

MyTrace::MyTrace const string &    newTraceMessage
 

Constructor.

If code is compiled with _DOENTRYTRACE_ defined user text is sent to stream during construction, if compiled with _DOEXITTRACE_ defined user text is prepended with 'Scoped: '.

Parameters:
newTraceMessage  User text to be sent to stream.

Definition at line 51 of file mytrace.cpp.

MyTrace::~MyTrace   [virtual]
 

Destructor.

If code compiled with _DOEXITTRACE_ defined user text is sent to stream during destruction, prepended with 'Descoped: '.

Definition at line 66 of file mytrace.cpp.

References traceMessage, and traceStream.


Member Function Documentation

ostream & MyTrace::getTraceStream   [static]
 

Get the stream to which text is being sent.

Returns:
Reference to stream currently being used.

Definition at line 91 of file mytrace.cpp.

References traceStream.

void MyTrace::setTraceStream const char *    newStreamName [static]
 

Set the file stream to which text is sent.

Creates a new fstream instance using passed name, opens stream for output. Never deletes the stream as this method is expected to be used only once at process start, also only in 'test' builds and so not worried memory leaks.

Parameters:
newStreamName  Name of file stream to use.

Definition at line 83 of file mytrace.cpp.


Member Data Documentation

string Monitor::Utility::MyTrace::traceMessage [private]
 

User text for sending to stream.

Definition at line 96 of file mytrace.h.

Referenced by ~MyTrace.

ostream * MyTrace::traceStream = &cerr [static, private]
 

Stream currently being used.

Definition at line 47 of file mytrace.cpp.

Referenced by getTraceStream, and ~MyTrace.


Generated on Wed Oct 29 20:51:59 2003 for Utility BC Common by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002