IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
SAMRAI::tbox::Tracer Class Reference

#include <tbox/Tracer.h>

Public Member Functions

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

Static Public Member Functions

static void setTraceStream (std::ostream *stream)
 

Private Attributes

std::string d_message
 

Static Private Attributes

static std::ostream * s_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

◆ Tracer()

SAMRAI::tbox::Tracer::Tracer ( const std::string &  message)

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

◆ ~Tracer()

SAMRAI::tbox::Tracer::~Tracer ( )

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

Member Function Documentation

◆ setTraceStream()

static void SAMRAI::tbox::Tracer::setTraceStream ( std::ostream *  stream)
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.

Member Data Documentation

◆ d_message

std::string SAMRAI::tbox::Tracer::d_message
private

◆ s_stream

std::ostream* SAMRAI::tbox::Tracer::s_stream
staticprivate

The documentation for this class was generated from the following file: