13 #ifndef DD4HEP_GEOMETRY_INSTANCECOUNT_H
14 #define DD4HEP_GEOMETRY_INSTANCECOUNT_H
94 static Counter*
getCounter(
const std::type_info& typ);
96 static Counter*
getCounter(
const std::string& typ);
110 static void increment(
const std::type_info& typ);
112 static void decrement(
const std::type_info& typ);
118 static void increment(
const std::string& typ);
120 static void decrement(
const std::string& typ);
126 static void dump(
int which =
ALL);
144 static int&
counter() {
static int cnt=0;
return cnt; }
Counter()=default
Default constructor.
void decrement()
Decrement counter.
static void decrement(T *)
Decrement count according to type information.
~Counter()=default
Destructor.
counter_t m_tot
Increment counter value.
static void dump(int which=ALL)
Dump list of instance counters.
Helper class to count call stack depths of certain functions.
static bool doTrace()
Check if tracing is enabled.
counter_t total() const
Access counter value.
counter_t m_max
Maximum number of simultaneous instances.
static void increment(T *)
Increment count according to type information.
counter_t maximum() const
Access maximum counter value.
void increment()
Increment counter.
InstanceCount()
Standard Constructor - No need to call explicitly.
virtual ~InstanceCount()
Standard Destructor - No need to call explicitly.
static void clear(int which=ALL)
Clear list of instance counters.
Helper to support object counting when debugging memory leaks.
Internal class to could object constructions and destructions.
counter_t value() const
Access counter value.
static Counter * getCounter(const std::type_info &typ)
Access counter object for local caching on optimizations.
counter_t m_count
Reference counter value.
static void doTracing(bool value)
Enable/Disable tracing.