ATLAS Offline Software
Loading...
Searching...
No Matches
TDestructorRegistry.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2//
3// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4//
5#ifndef XAODROOTACCESS_TOOLS_TDESTRUCTORREGISTRY_H
6#define XAODROOTACCESS_TOOLS_TDESTRUCTORREGISTRY_H
7
8// System include(s):
9#include <map>
10#include <shared_mutex>
11#include <memory>
12
13// Forward declaration(s):
14namespace std {
15 class type_info;
16}
17
18namespace xAOD {
19
20 // Forward declaration(s):
22
32
33 public:
36
38 const TVirtualDestructor* get( const std::type_info& ti ) const;
40 template< class T >
41 void add();
42
43 private:
48
50 typedef std::map< const std::type_info*,
51 std::unique_ptr< TVirtualDestructor > > Map_t;
60 mutable std::shared_timed_mutex m_mutex;
61
62 }; // class TDestructorRegistry
63
64} // namespace xAOD
65
66// Include the template implementation:
68
69#endif // XAODROOTACCESS_TOOLS_TDESTRUCTORREGISTRY_H
TDestructorRegistry()
Hide the constructor of the type.
Map_t m_types
Internal map of known destructor objects.
TDestructorRegistry(const TDestructorRegistry &)=delete
Hide the copy-constructor.
std::map< const std::type_info *, std::unique_ptr< TVirtualDestructor > > Map_t
Type of the internal map.
std::shared_timed_mutex m_mutex
Mutex for the destructor map.
void add()
Add a new destructor object.
const TVirtualDestructor * get(const std::type_info &ti) const
Get the destructor for a given type.
static TDestructorRegistry & instance()
Function accessing the singleton instance of this type.
Base class for the templated destructor types.
Definition TDestructor.h:25
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.