Developer Documentation
ACG::Tracing Class Reference

#include <ACG/Utils/Tracing.hh>

Inheritance diagram for ACG::Tracing:
ACG::TimedTracing

Public Member Functions

 Tracing (const std::string &_text, std::ostream &_os=std::cerr)
 Constructor.
 
 ~Tracing ()
 Destructor.
 
void progress ()
 

Protected Attributes

std::ostream & os_
 

Static Protected Attributes

static char progress_ [4] = { '-', '\\', '|', '/' }
 
static unsigned char idx_ = 0
 

Detailed Description

Tracing outputs starting and finishing messages for some lengthy procedures. Its constructor will output a given string, the destructor will output "finished\\n". That means you have to start a new block and define a local trancing object in there. When entering the block the constructor is called, the start message is printed. When leaving the block the descructor displays the finishing message. For convenience there are some macros defining the local object so you can write:

{ // start a new block
ACG_TRACE("What's the meaning of like?");
for (years=0; years <= ACG::NumLimitsT<int>::max(); ++years)
{
// ... lengthy computation, show some progress
ACG_TRACE_PROGRESS;
}
std::cout << "42";
} // leaving the block will display "finished\n"

If you want to trace only one command you can also use:

ACG_TRACE_CMD("What's the meaning of like?", calc_meaning_of_life());
See also
TimedTracing

Definition at line 119 of file Tracing.hh.

Member Function Documentation

◆ progress()

void ACG::Tracing::progress ( )
inline

Show some progress (the next frame of a rotating bar is displayed for every call of this function)

Definition at line 136 of file Tracing.hh.


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