|
IBAMR
IBAMR version 0.19.
|
#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 |
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.
| SAMRAI::tbox::Tracer::Tracer | ( | const std::string & | message | ) |
The constructor for Tracer prints `‘Entering <message>’' to the tracer output stream.
| SAMRAI::tbox::Tracer::~Tracer | ( | ) |
The destructor for Tracer prints `‘Exiting <message>’' to the tracer output 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.
|
private |
|
staticprivate |
1.8.17