Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Tracking
TrkEvent
TrkEventPrimitives
TrkEventPrimitives
TrkObjectCounter.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef TRKEVENTPRIMITIVES_TRKOBJECTCOUNTER_H
6
#define TRKEVENTPRIMITIVES_TRKOBJECTCOUNTER_H
7
#include <atomic>
8
#include <cstddef>
9
namespace
Trk
{
16
template
<
typename
T>
17
class
ObjectCounter
18
{
19
20
public
:
21
#ifndef NDEBUG
22
static
inline
std::atomic_size_t
s_numberOfInstantiations
= 0;
23
#endif
24
25
static
std::size_t
numberOfInstantiations
()
26
{
27
#ifndef NDEBUG
28
return
s_numberOfInstantiations
.load();
29
#endif
30
return
0;
31
}
32
33
protected
:
34
// cases where we want different behaviour for release/debug
35
#ifndef NDEBUG
36
ObjectCounter
()
37
{
38
s_numberOfInstantiations
.fetch_add(1, std::memory_order_relaxed);
39
}
40
ObjectCounter
(
const
ObjectCounter
&)
41
{
42
s_numberOfInstantiations
.fetch_add(1, std::memory_order_relaxed);
43
}
44
~ObjectCounter
()
45
{
46
s_numberOfInstantiations
.fetch_sub(1, std::memory_order_relaxed);
47
}
48
#else
49
ObjectCounter
() =
default
;
50
ObjectCounter
(
const
ObjectCounter
&) =
default
;
51
~ObjectCounter
() =
default
;
52
#endif
53
// The rest
54
ObjectCounter
&
operator=
(
const
ObjectCounter
&) =
default
;
55
ObjectCounter
(
ObjectCounter
&&) =
default
;
56
ObjectCounter
&
operator=
(
ObjectCounter
&&) =
default
;
57
};
58
59
}
60
#endif
Trk::ObjectCounter::ObjectCounter
ObjectCounter(ObjectCounter &&)=default
Trk::ObjectCounter::ObjectCounter
ObjectCounter(const ObjectCounter &)
Definition:
TrkObjectCounter.h:40
Trk::ObjectCounter::operator=
ObjectCounter & operator=(const ObjectCounter &)=default
Trk::ObjectCounter
Helper to enable counting number of instantiations in debug builds.
Definition:
TrkObjectCounter.h:18
Trk::ObjectCounter::numberOfInstantiations
static std::size_t numberOfInstantiations()
Definition:
TrkObjectCounter.h:25
Trk::ObjectCounter::ObjectCounter
ObjectCounter()
Definition:
TrkObjectCounter.h:36
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition:
FakeTrackBuilder.h:9
Trk::ObjectCounter::operator=
ObjectCounter & operator=(ObjectCounter &&)=default
Trk::ObjectCounter::~ObjectCounter
~ObjectCounter()
Definition:
TrkObjectCounter.h:44
Trk::ObjectCounter::s_numberOfInstantiations
static std::atomic_size_t s_numberOfInstantiations
Definition:
TrkObjectCounter.h:22
Generated on Mon Apr 21 2025 21:22:00 for ATLAS Offline Software by
1.8.18