#include <dpTracer.h>
Public Methods | |
| dpTracer (const char *) | |
| ~dpTracer () | |
NAME: dpTracer - class for convenient manual trace of C++ code
DESCRIPTION:
The class is used to trace C++ code. Instead of enclosing debug output statements at the beginning and end of functions in "ifdef" preprocessor statements, "dpTracer" can give the same effect. The result is shorter and prettier code. The basic idea is that one declares a "dpTracer" object at the beginning of the function. If "DP_DEBUG" is on (or greater than zero) the constructor of "dpTracer" will print a message. The message is given as an argument to the constructor. When the "dpTracer" goes out of scope at the end of the function, the "dpTracer" destructor will write a message that the end of the function is reached. When "DP_DEBUG" is undefined, the "dpTracer" object is empty and the constructor and destructor are empty inline functions. Hence, there should be negligble overhead in using "dpTracer". You must put a "dpTracer" object in the beginning of all functions you want to include in your trace mechanism. In practice, you apply the "DPTRACE" macro as shown below.
|
|
See documentation of one of the overloaded constructor. |
|
|
|