|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
13 #ifndef DD4HEP_INSTANCECOUNT_H
14 #define DD4HEP_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; }
150 #endif // DD4HEP_INSTANCECOUNT_H
counter_t m_max
Maximum number of simultaneous instances.
Helper to support object counting when debugging memory leaks.
counter_t m_tot
Increment counter value.
counter_t m_count
Reference counter value.
Internal class to could object constructions and destructions.
static void dump(int which=ALL)
Dump list of instance counters.
void increment()
Increment counter.
InstanceCount()
Standard Constructor - No need to call explicitly.
Counter()=default
Default constructor.
counter_t maximum() const
Access maximum counter value.
static void increment(T *)
Increment count according to type information.
Counter(const Counter &c)=default
Copy constructor.
~Counter()=default
Destructor.
static void doTracing(bool value)
Enable/Disable tracing.
static counter_t get(T *)
Access current counter.
static void decrement(T *)
Decrement count according to type information.
static counter_t get(const std::string &typ)
Access current counter.
static bool doTrace()
Check if tracing is enabled.
static void clear(int which=ALL)
Clear list of instance counters.
static counter_t get(const std::type_info &typ)
Access current counter.
Helper class to count call stack depths of certain functions.
counter_t value() const
Access counter value.
Namespace for the AIDA detector description toolkit.
void decrement()
Decrement counter.
counter_t total() const
Access counter value.
static Counter * getCounter(const std::type_info &typ)
Access counter object for local caching on optimizations.
virtual ~InstanceCount()
Standard Destructor - No need to call explicitly.