libzypp
13.10.6
|
A simple tracer for (copy) Construction, Assignment, and Destruction. More...
#include <Debug.h>
Public Member Functions | |
TraceCAD () | |
TraceCAD (const TraceCAD &rhs) | |
TraceCAD & | operator= (const TraceCAD &rhs) |
virtual | ~TraceCAD () |
void | _PING () const |
Public Member Functions inherited from zypp::base::ProvideNumericId< TraceCAD< _Tp >, unsigned long > | |
unsigned long | numericId () const |
Static Public Member Functions | |
static unsigned long & | _totalTraceCAD () |
Related Functions | |
(Note that these are not member functions.) | |
template<class _Tp > | |
std::ostream & | operator<< (std::ostream &str, const TraceCAD< _Tp > &obj) |
Related Functions inherited from zypp::debug::TraceCADBase | |
std::ostream & | operator<< (std::ostream &str, TraceCADBase::What obj) |
Additional Inherited Members | |
Public Types inherited from zypp::debug::TraceCADBase | |
enum | What { CTOR, COPYCTOR, ASSIGN, DTOR, PING } |
Public Attributes inherited from zypp::debug::TraceCADBase | |
std::string | _ident |
Protected Member Functions inherited from zypp::base::ProvideNumericId< TraceCAD< _Tp >, unsigned long > | |
ProvideNumericId () | |
Default ctor. More... | |
ProvideNumericId (const ProvideNumericId &) | |
Copy ctor. More... | |
ProvideNumericId (const void *const ) | |
No-Id ctor (0). More... | |
ProvideNumericId & | operator= (const ProvideNumericId &) |
Assign. More... | |
~ProvideNumericId () | |
Dtor. More... | |
A simple tracer for (copy) Construction, Assignment, and Destruction.
To trace class Foo, derive public from TraceCAD<Foo>. This tracer simply calls traceCAD in each traced method, and traceCAD simply drops a line in the log.
This tracer logs construction, copy construction, assignment, destruction and _PING.
assignment: In case the traced class defines an operator= it must be altered to call TraceCAD::operator=, otherwise it won't be triggered.
_PING: Completely up to you. Call _PING somewhere in the traced class to indicate something. In case you overload traceCAD, do whatever is appropriate on _PING. It's just an offer to perform logging or actions here, and not in the traced code.
But traceCAD may be overloaded to produce more stats.
Example.COW_debug.cc
.
|
inline |
|
inline |
|
inlinevirtual |
|
inlinestatic |
|
inline |
|
inline |