ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::ObjectCounter< T > Class Template Reference

Helper to enable counting number of instantiations in debug builds. More...

#include <TrkObjectCounter.h>

Collaboration diagram for Trk::ObjectCounter< T >:

Static Public Member Functions

static std::size_t numberOfInstantiations ()

Static Public Attributes

static std::atomic_size_t s_numberOfInstantiations = 0

Protected Member Functions

 ObjectCounter ()
 ObjectCounter (const ObjectCounter &)
 ~ObjectCounter ()
ObjectCounteroperator= (const ObjectCounter &)=default
 ObjectCounter (ObjectCounter &&)=default
ObjectCounteroperator= (ObjectCounter &&)=default

Detailed Description

template<typename T>
class Trk::ObjectCounter< T >

Helper to enable counting number of instantiations in debug builds.

Author
Christos Anastopoulos.

Definition at line 17 of file TrkObjectCounter.h.

Constructor & Destructor Documentation

◆ ObjectCounter() [1/3]

template<typename T>
Trk::ObjectCounter< T >::ObjectCounter ( )
inlineprotected

Definition at line 36 of file TrkObjectCounter.h.

37 {
39 }
Helper to enable counting number of instantiations in debug builds.
static std::atomic_size_t s_numberOfInstantiations

◆ ObjectCounter() [2/3]

template<typename T>
Trk::ObjectCounter< T >::ObjectCounter ( const ObjectCounter< T > & )
inlineprotected

Definition at line 40 of file TrkObjectCounter.h.

◆ ~ObjectCounter()

template<typename T>
Trk::ObjectCounter< T >::~ObjectCounter ( )
inlineprotected

Definition at line 44 of file TrkObjectCounter.h.

◆ ObjectCounter() [3/3]

template<typename T>
Trk::ObjectCounter< T >::ObjectCounter ( ObjectCounter< T > && )
protecteddefault

Member Function Documentation

◆ numberOfInstantiations()

template<typename T>
std::size_t Trk::ObjectCounter< T >::numberOfInstantiations ( )
inlinestatic

Definition at line 25 of file TrkObjectCounter.h.

26 {
27#ifndef NDEBUG
28 return s_numberOfInstantiations.load();
29#endif
30 return 0;
31 }

◆ operator=() [1/2]

template<typename T>
ObjectCounter & Trk::ObjectCounter< T >::operator= ( const ObjectCounter< T > & )
protecteddefault

◆ operator=() [2/2]

template<typename T>
ObjectCounter & Trk::ObjectCounter< T >::operator= ( ObjectCounter< T > && )
protecteddefault

Member Data Documentation

◆ s_numberOfInstantiations

template<typename T>
std::atomic_size_t Trk::ObjectCounter< T >::s_numberOfInstantiations = 0
inlinestatic

Definition at line 22 of file TrkObjectCounter.h.


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