ClearSilver::TraceObject Class Reference

Trace lifetime of objects. More...

#include <TraceObject.h>

Inheritance diagram for ClearSilver::TraceObject:

ClearSilver::CGI ClearSilver::CGIApplication ClearSilver::FastCGIApplication ClearSilver::HDF ClearSilver::CGIApplicationAuthenticated ClearSilver::CGIApplicationUnauthenticated List of all members.

Public Member Functions

 TraceObject (bool, const std::string &)
 TraceObject (bool, const std::string &, const std::string &)
 TraceObject (const TraceObject &)
virtual ~TraceObject () throw ()
TraceObjectoperator= (const TraceObject &)
void swap (TraceObject &) throw ()

Static Public Member Functions

static bool & log_messages ()
static bool & stream_messages ()

Detailed Description

Trace lifetime of objects.

This class provides a simple means of logging the lifetime of objects to syslog(3). This class implements logging actions for each of the fundamental methods that affect object lifetime: creation, destruction, assignment, and swapping. Classes derived from this will trigger logging messages when they themselves are created, destroyed, etc. This can simplify the debugging process for situations in which object lifetime must be traced.

Because this introduces potentially undesirable overhead into any objects derived from TraceObject, it is possible at compile time to replace the class with an empty class that does no logging but has no overhead. This is controlled by the HAVE_OBJECT_TRACING preprocessor macro, which is controlled by the --enable-object-tracing and --disable-object-tracing configure options. Note that if object tracing is controlled by some other means, e.g., by controlling the definition of HAVE_OBJECT_TRACING outside the provided configuration mechamism, care must be taken to ensure that all uses of TraceObject.h are consistent. Otherwise, subtle bugs will occur as a result of disagreement about class definitions.

Definition at line 105 of file TraceObject.h.


The documentation for this class was generated from the following files:
Generated on Tue May 16 14:50:54 2006 for ClearSilver C++ Library by  doxygen 1.4.5