SAMRAI::tbox::Tracer Class Reference

#include <source/toolbox/base/Tracer.h>

List of all members.

Public Member Functions

 Tracer (const std::string &message)
 ~Tracer ()

Static Public Member Functions

static void setTraceStream (std::ostream *stream)


Detailed Description

Class Tracer allows one to trace entrances and exits of class member functions. An example usage is:
 * #include "tbox/Tracer.h"
 * ....
 * void MyClass::myClassMemberFunction() 
 * {
 *    Tracer t("MyClass::myClassMemberFunction");
 *     ....
 * }
 * 
When the function `myClassMemberFunction' is called, a tracer object local to the function scope is created and the message {Entering MyClass::myClassMemberFunction} is sent to the tracer output stream. Upon exiting the function, the tracer object is destroyed and {Exiting MyClass::myClassMemberFunction} is sent to the tracer output stream. By default, the tracer class sends data to the parallel log stream, although the default output stream can be changed through a call to static member function setTraceStream(), which will set the tracer output stream for all subsequent calls.


Constructor & Destructor Documentation

SAMRAI::tbox::Tracer::Tracer ( const std::string &  message  )  [inline]

The constructor for Tracer prints ``Entering <message>'' to the tracer output stream.

SAMRAI::tbox::Tracer::~Tracer (  )  [inline]

The destructor for Tracer prints ``Exiting <message>'' to the tracer output stream.


Member Function Documentation

void SAMRAI::tbox::Tracer::setTraceStream ( std::ostream *  stream  )  [inline, static]

Set the tracer output stream for all tracer output. By default, this is set to the parallel log stream plog. If this argument is NULL, then all output to trace streams is disabled.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:59 2009 for SAMRAI by  doxygen 1.5.1