![]() |
ATLAS Offline Software
|
Singleton, thread-safe THolder cache. More...
#include <THolderCache.h>
Public Member Functions | |
| std::pair< bool, ::TClass * > | getClass (const std::type_info &ti) const |
| Get the dictionary for a given type info. | |
| void | addClass (const std::type_info &ti, ::TClass *cl) |
| Add the dictionary for a given type. | |
| int | getRef (void *ptr) const |
| Get the reference count of an object in memory. | |
| int | incRef (void *ptr) |
| Increment the reference count of an object in memory. | |
| int | decRef (void *ptr) |
| Decrease the reference count of an object in memory. | |
Static Public Member Functions | |
| static THolderCache & | instance () |
| Singleton accessor. | |
Private Member Functions | |
| THolderCache () | |
| Hide the constructor of the class from the outside. | |
| THolderCache (const THolderCache &)=delete | |
| Delete the copy constructor. | |
Private Attributes | |
| std::map< const std::type_info *, TClass * > | m_typeMap |
| The type map. | |
| std::map< void *, int > | m_refMap |
| The reference count map. | |
| std::shared_timed_mutex | m_typeMapMutex |
| Mutex for the type map. | |
| std::shared_timed_mutex | m_refMapMutex |
| Mutex for the reference count map. | |
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.
Definition at line 31 of file THolderCache.h.
|
private |
Hide the constructor of the class from the outside.
Definition at line 105 of file THolderCache.cxx.
|
privatedelete |
Delete the copy constructor.
| void xAOD::Internal::THolderCache::addClass | ( | const std::type_info & | ti, |
| ::TClass * | cl ) |
Add the dictionary for a given type.
Definition at line 49 of file THolderCache.cxx.
| int xAOD::Internal::THolderCache::decRef | ( | void * | ptr | ) |
Decrease the reference count of an object in memory.
Definition at line 81 of file THolderCache.cxx.
| 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.
| 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.
| int xAOD::Internal::THolderCache::incRef | ( | void * | ptr | ) |
Increment the reference count of an object in memory.
Definition at line 72 of file THolderCache.cxx.
|
static |
Singleton accessor.
Definition at line 29 of file THolderCache.cxx.
|
private |
The reference count map.
Definition at line 59 of file THolderCache.h.
|
mutableprivate |
Mutex for the reference count map.
Definition at line 64 of file THolderCache.h.
|
private |
The type map.
Definition at line 57 of file THolderCache.h.
|
mutableprivate |
Mutex for the type map.
Definition at line 62 of file THolderCache.h.