Singleton, thread-safe THolder cache.
More...
#include <THolderCache.h>
Singleton, thread-safe THolder cache.
The xAOD::THolder class needs to keep some global caches internally, due to the way it manages its own memory. This singleton helps doing that in a thread-safe way.
- Author
- Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Definition at line 31 of file THolderCache.h.
◆ THolderCache() [1/2]
xAOD::Internal::THolderCache::THolderCache |
( |
| ) |
|
|
private |
Hide the constructor of the class from the outside.
Definition at line 105 of file THolderCache.cxx.
◆ THolderCache() [2/2]
Delete the copy constructor.
◆ addClass()
void xAOD::Internal::THolderCache::addClass |
( |
const std::type_info & |
ti, |
|
|
::TClass * |
cl |
|
) |
| |
◆ decRef()
int xAOD::Internal::THolderCache::decRef |
( |
void * |
ptr | ) |
|
Decrease the reference count of an object in memory.
Definition at line 81 of file THolderCache.cxx.
◆ getClass()
std::pair< bool,::TClass * > xAOD::Internal::THolderCache::getClass |
( |
const std::type_info & |
ti | ) |
const |
Get the dictionary for a given type info.
Definition at line 35 of file THolderCache.cxx.
43 return std::pair< bool, ::TClass* >(
true, itr->second );
45 return std::pair< bool, ::TClass* >(
false,
nullptr );
◆ getRef()
int xAOD::Internal::THolderCache::getRef |
( |
void * |
ptr | ) |
const |
Get the reference count of an object in memory.
Definition at line 58 of file THolderCache.cxx.
◆ incRef()
int xAOD::Internal::THolderCache::incRef |
( |
void * |
ptr | ) |
|
Increment the reference count of an object in memory.
Definition at line 72 of file THolderCache.cxx.
◆ instance()
◆ m_refMap
std::map< void*, int > xAOD::Internal::THolderCache::m_refMap |
|
private |
◆ m_refMapMutex
std::shared_timed_mutex xAOD::Internal::THolderCache::m_refMapMutex |
|
mutableprivate |
Mutex for the reference count map.
Definition at line 64 of file THolderCache.h.
◆ m_typeMap
std::map< const std::type_info*, TClass* > xAOD::Internal::THolderCache::m_typeMap |
|
private |
◆ m_typeMapMutex
std::shared_timed_mutex xAOD::Internal::THolderCache::m_typeMapMutex |
|
mutableprivate |
The documentation for this class was generated from the following files: