ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
xAODRootAccess
Root
TDestructorRegistry.cxx
Go to the documentation of this file.
1
// Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3
// ROOT include(s):
4
#include <TError.h>
5
6
// Framework include(s):
7
#include "
AthContainers/normalizedTypeinfoName.h
"
8
#include "
CxxUtils/checker_macros.h
"
9
10
// Local include(s):
11
#include "
xAODRootAccess/tools/TDestructorRegistry.h
"
12
#include "
xAODRootAccess/tools/Message.h
"
13
14
namespace
xAOD
{
15
16
TDestructorRegistry
&
TDestructorRegistry::instance
() {
17
18
static
TDestructorRegistry
obj
ATLAS_THREAD_SAFE
;
// this class is thread-safe
19
return
obj;
20
}
21
22
const
TVirtualDestructor
*
23
TDestructorRegistry::get
(
const
std::type_info& ti )
const
{
24
25
// Get a "read lock":
26
std::shared_lock< std::shared_timed_mutex >
lock
(
m_mutex
);
27
28
// Look for this type:
29
Map_t::const_iterator itr =
m_types
.find( &ti );
30
if
( itr !=
m_types
.end() ) {
31
return
itr->second.get();
32
}
33
34
// We didn't find it:
35
::Error(
"xAOD::TDestructorRegistry::get"
,
36
XAOD_MESSAGE
(
"Destructor not known for type %s"
),
37
SG::normalizedTypeinfoName
( ti ).c_str() );
38
return
nullptr
;
39
}
40
41
TDestructorRegistry::TDestructorRegistry
()
42
:
m_types
(),
m_mutex
() {
43
44
}
45
46
}
// namespace xAOD
Message.h
XAOD_MESSAGE
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Definition
Control/xAODRootAccess/xAODRootAccess/tools/Message.h:19
lock
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
TDestructorRegistry.h
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition
checker_macros.h:211
xAOD::TDestructorRegistry::TDestructorRegistry
TDestructorRegistry()
Hide the constructor of the type.
Definition
TDestructorRegistry.cxx:41
xAOD::TDestructorRegistry::m_types
Map_t m_types
Internal map of known destructor objects.
Definition
TDestructorRegistry.h:53
xAOD::TDestructorRegistry::m_mutex
std::shared_timed_mutex m_mutex
Mutex for the destructor map.
Definition
TDestructorRegistry.h:60
xAOD::TDestructorRegistry::get
const TVirtualDestructor * get(const std::type_info &ti) const
Get the destructor for a given type.
Definition
TDestructorRegistry.cxx:23
xAOD::TDestructorRegistry::instance
static TDestructorRegistry & instance()
Function accessing the singleton instance of this type.
Definition
TDestructorRegistry.cxx:16
xAOD::TVirtualDestructor
Base class for the templated destructor types.
Definition
TDestructor.h:25
SG::normalizedTypeinfoName
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Definition
normalizedTypeinfoName.cxx:120
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
normalizedTypeinfoName.h
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Generated on
for ATLAS Offline Software by
1.17.0