libzypp: zypp::debug::TraceCAD< Tp > Struct Template Reference

libzypp 17.38.5

zypp::debug::TraceCAD< Tp > Struct Template Reference

A simple tracer for (copy) Construction, Assignment, and Destruction. More...

`#include <zypp/base/Debug.h>`

Inheritance diagram for zypp::debug::TraceCAD< Tp >:

## Public Member Functions
| TraceCAD ()
| TraceCAD (const TraceCAD &rhs)
| TraceCAD (TraceCAD &&rhs) noexcept
TraceCAD & | operator= (const TraceCAD &rhs)
TraceCAD & | operator= (TraceCAD &&rhs) noexcept
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 Symbols
(Note that these are not member symbols.)
template<class Tp>
std::ostream & | operator<< (std::ostream &str, const TraceCAD< Tp > &obj)
| Stream output.
Related Symbols 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 & | operator= (const ProvideNumericId &)
| Assign.
| ~ProvideNumericId ()
| Dtor.

## Detailed Description

template<class Tp>
struct zypp::debug::TraceCAD< Tp >

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.

See also
  `Example.COW_debug.cc`.

Definition at line 111 of file Debug.h.

## Constructor & Destructor Documentation

## ◆ TraceCAD() [1/3]

template<class Tp>

zypp::debug::TraceCAD< Tp >::TraceCAD | ( |  | ) |
| inline

Definition at line 118 of file Debug.h.

## ◆ TraceCAD() [2/3]

template<class Tp>

zypp::debug::TraceCAD< Tp >::TraceCAD | ( | const TraceCAD< Tp > & | rhs | ) |
| inline

Definition at line 123 of file Debug.h.

## ◆ TraceCAD() [3/3]

template<class Tp>

zypp::debug::TraceCAD< Tp >::TraceCAD | ( | TraceCAD< Tp > && | rhs | ) |
| inlinenoexcept

Definition at line 127 of file Debug.h.

## ◆ ~TraceCAD()

template<class Tp>

virtual zypp::debug::TraceCAD< Tp >::~TraceCAD | ( |  | ) |
| inlinevirtual

Definition at line 137 of file Debug.h.

## Member Function Documentation

## ◆ _totalTraceCAD()

template<class Tp>

unsigned long & zypp::debug::TraceCAD< Tp >::_totalTraceCAD | ( |  | ) |
| inlinestatic

Definition at line 114 of file Debug.h.

## ◆ operator=() [1/2]

template<class Tp>

TraceCAD & zypp::debug::TraceCAD< Tp >::operator= | ( | const TraceCAD< Tp > & | rhs | ) |
| inline

Definition at line 131 of file Debug.h.

## ◆ operator=() [2/2]

template<class Tp>

TraceCAD & zypp::debug::TraceCAD< Tp >::operator= | ( | TraceCAD< Tp > && | rhs | ) |
| inlinenoexcept

Definition at line 134 of file Debug.h.

## ◆ ping()

template<class Tp>

void zypp::debug::TraceCAD< Tp >::ping | ( |  | ) | const
| inline

Definition at line 141 of file Debug.h.

## Friends And Related Symbol Documentation

## ◆ operator<<()

template<class Tp>

std::ostream & operator<< | ( | std::ostream & | str,
|  | const TraceCAD< Tp > & | obj )
| related

Stream output.

Definition at line 147 of file Debug.h.

The documentation for this struct was generated from the following file:

- zypp/base/Debug.h