rutz::trace Class Reference

Times and traces execution in and out of a lexical scope. More...

#include <rutz/trace.h>

Collaboration diagram for rutz::trace:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 trace (rutz::prof &p, bool use_msg) throw ()
 Construct a rutz::trace object.
 ~trace () throw ()
 Destruct the rutz::trace object, accumulating time information in the stored rutz::prof.

Static Public Member Functions

static bool get_global_trace () throw ()
 Query whether we are unconditionally printing trace in/out messages.
static void set_global_trace (bool on_off) throw ()
 Set whether to unconditionally print trace in/out messages.
static unsigned int get_max_level () throw ()
 Get the max nesting level for printing trace in/out messages.
static void set_max_level (unsigned int lev) throw ()
 Set the max nesting level for printing trace in/out messages.

Detailed Description

Times and traces execution in and out of a lexical scope.

This class cooperates with rutz::prof. rutz::prof objects are expected to have "long" lifetimes, and accumulate timing information over multiple passes. In each pass, a rutz::trace object should be constructed, which will pass its runtime info onto the rutz::prof, which then accumulates the timing info.

Definition at line 76 of file trace.h.


Constructor & Destructor Documentation

rutz::trace::trace ( rutz::prof p,
bool  use_msg 
) throw ()

Construct a rutz::trace object.

Store the current time internally (either the wall clock time or current user+sys rusage, depending on the current timing_mode). If use_msg, then print a trace-begin message to stderr showing the name of the given rutz::prof.

Definition at line 123 of file trace.cc.

References rutz::prof::get_now_time().

rutz::trace::~trace (  )  throw ()

Destruct the rutz::trace object, accumulating time information in the stored rutz::prof.

Get the new time (either wall clock or user+sys rusage, matching whatever we did in the rutz::trace constructor. If we printed a trace-begin message, then also print a matching trace-end message.

Definition at line 140 of file trace.cc.

References rutz::backtrace::current(), rutz::prof::get_now_time(), rutz::backtrace::pop(), and rutz::backtrace::top().


Member Function Documentation

bool rutz::trace::get_global_trace (  )  throw () [static]

Query whether we are unconditionally printing trace in/out messages.

Definition at line 103 of file trace.cc.

unsigned int rutz::trace::get_max_level (  )  throw () [static]

Get the max nesting level for printing trace in/out messages.

Definition at line 113 of file trace.cc.

void rutz::trace::set_global_trace ( bool  on_off  )  throw () [static]

Set whether to unconditionally print trace in/out messages.

Definition at line 108 of file trace.cc.

void rutz::trace::set_max_level ( unsigned int  lev  )  throw () [static]

Set the max nesting level for printing trace in/out messages.

Definition at line 118 of file trace.cc.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:44:44 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3