libzypp 17.31.23
|
A simple tracer for (copy) Construction, Assignment, and Destruction. More...
#include <base/Debug.h>
Public Member Functions | |
TraceCAD () | |
TraceCAD (const TraceCAD &rhs) | |
TraceCAD (TraceCAD &&rhs) | |
TraceCAD & | operator= (const TraceCAD &rhs) |
TraceCAD & | operator= (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) |
Stream output. | |
Related Functions inherited from zypp::debug::TraceCADBase | |
std::ostream & | operator<< (std::ostream &str, TraceCADBase::What obj) |
Stream output of TraceCADBase::What. | |
Additional Inherited Members | |
Public Types inherited from zypp::debug::TraceCADBase | |
enum | What { CTOR , COPYCTOR , MOVECTOR , ASSIGN , MOVEASSIGN , 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. | |
ProvideNumericId (const ProvideNumericId &) | |
Copy ctor. | |
ProvideNumericId (ProvideNumericId &&rhs) | |
Move ctor. | |
ProvideNumericId (const void *const) | |
No-Id ctor (0). | |
ProvideNumericId & | operator= (const ProvideNumericId &) |
Assign. | |
ProvideNumericId & | operator= (ProvideNumericId &&rhs) |
Move Assign. | |
~ProvideNumericId () | |
Dtor. | |
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 |
|
inline |
|
inlinevirtual |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
related |