libthrowable::TracePoint Class Reference
[Debugging]

A class that can be very useful for finding bugs. More...

#include <libthrowable/trace_point.h>

List of all members.

Public Member Functions

 TracePoint (const char *filename, int linenumber, const char *function) throw ()
 Constructs a new TracePoint object from filename, linenumber and function.
 TracePoint (const char *filename, int linenumber, const char *function, const std::string &message) throw ()
 Constructs a new TracePoint object from filename, linenumber, function and message.
template<class OStreamableT>
 TracePoint (const char *filename, int linenumber, const char *function, const OStreamableT &t, const std::string &name) throw ()
 Constructs a new TracePoint object from filename, linenumber, function, a variable and its name.
 ~TracePoint () throw ()

Static Public Member Functions

static void setLineWidth (int width) throw ()
 Specify a line width for all TracePoint objects.
static void setOstream (std::ostream &os) throw ()
 Write to os instead of std::cerr.
static void setThreadName (const std::string &name) throw ()
 Sets a name for the current thread.

Classes

struct  Function


Detailed Description

A class that can be very useful for finding bugs.

Warning:
If you are using TracePoint in a multi threaded environment, based on pthreads, make sure that the library has been compiled with pthreads support. This can be accomplished by passing "--enable-pthreads" to configure. If you are using the Gentoo ebuild, be sure that you emerge libthrowable with USE="threads".
See also:
LIBTHROWABLE_TRACE

LIBTHROWABLE_TRACE_MSG

LIBTHROWABLE_TRACE_VAR

Since:
libthrowable-0.9.1

Constructor & Destructor Documentation

libthrowable::TracePoint::TracePoint ( const char *  filename,
int  linenumber,
const char *  function 
) throw ()

Constructs a new TracePoint object from filename, linenumber and function.

See also:
TracePoint(const char*, int, const char*, const std::string&)

LIBTHROWABLE_TRACE

libthrowable::TracePoint::TracePoint ( const char *  filename,
int  linenumber,
const char *  function,
const std::string &  message 
) throw ()

Constructs a new TracePoint object from filename, linenumber, function and message.

See also:
TracePoint(const char*, int, const char*)

LIBTHROWABLE_TRACE_MSG

template<class OStreamableT>
libthrowable::TracePoint::TracePoint ( const char *  filename,
int  linenumber,
const char *  function,
const OStreamableT &  t,
const std::string &  name 
) throw () [inline]

Constructs a new TracePoint object from filename, linenumber, function, a variable and its name.

Parameters:
filename usually __FILE__
linenumber usually __LINE__
function usually __FUNCTION__, __func__ or __PRETTY_FUNCTION__
t any type meeting the requirements for util::stringify()
name the name of the variable you want to examine
See also:
LIBTHROWABLE_TRACE_VAR
Since:
libthrowable-1.0.0

libthrowable::TracePoint::~TracePoint (  )  throw ()


Member Function Documentation

static void libthrowable::TracePoint::setLineWidth ( int  width  )  throw () [static]

Specify a line width for all TracePoint objects.

Parameters:
width 
  • If width < 0 the output will be optimized for your current terminal. This is the default.
  • If 0 <= width < 40 no optimizing will be done.
  • If width <= 40 all TracePoint objects will generate output optimized for width. This is mostly useful when writing to files.

static void libthrowable::TracePoint::setOstream ( std::ostream &  os  )  throw () [static]

Write to os instead of std::cerr.

Warning:
The caller of this function is responsible for making sure that os remains a valid reference as long as used by various trace points.


The documentation for this class was generated from the following file:
Generated on Wed Jan 9 18:07:18 2008 for libthrowable by  doxygen 1.5.4  Hosted on  SourceForge.net Logo