#include "DataFormats/Common/interface/AtomicPtrCache.h"
Public Member Functions | |
AtomicPtrCache () | |
AtomicPtrCache (const AtomicPtrCache< T > &) | |
Uses T's copy constructor to make a copy. More... | |
AtomicPtrCache (T *) | |
Takes exclusive ownership of the value. More... | |
bool | isSet () const |
T * | load () |
T const * | load () const |
T & | operator* () |
T const & | operator* () const |
T * | operator-> () |
T const * | operator-> () const |
AtomicPtrCache & | operator= (const AtomicPtrCache< T > &) |
T * | release () |
void | reset () |
unsets the value and deletes the memory More... | |
bool | set (std::unique_ptr< T > iNewValue) const |
~AtomicPtrCache () | |
Private Attributes | |
std::atomic< T * > | m_data |
Description: A thread safe cache managed by a pointer
Usage: Data products which need to cache results into non-trivial structures (e.g. an std::vector) can use this class to manage the cache in a thread-safe way. The thread-safety guarantee is only the standard C++, if calls are made to const functions simultaneously then everything is thread safe. Calling a non-const function while calling any other functions is not thread-safe.
This class also hides the std::atomic from ROOT so this class can safely be used in a stored class.
WARNING: member data which uses this class must be made transient in the classes_def.xml file!
Definition at line 38 of file AtomicPtrCache.h.
|
inline |
Definition at line 78 of file AtomicPtrCache.h.
|
inlineexplicit |
|
inline |
Uses T's copy constructor to make a copy.
Definition at line 84 of file AtomicPtrCache.h.
|
inline |
Definition at line 107 of file AtomicPtrCache.h.
|
inline |
Definition at line 122 of file AtomicPtrCache.h.
Referenced by HcalGeometry::fillDetIds(), and HcalGeometry::getHxSize().
|
inline |
Definition at line 112 of file AtomicPtrCache.h.
|
inline |
Definition at line 117 of file AtomicPtrCache.h.
Referenced by HcalGeometry::getValidDetIds(), edm::AtomicPtrCache< std::vector< reco::PFRecoTauChargedHadron > >::isSet(), edm::AtomicPtrCache< std::vector< reco::PFRecoTauChargedHadron > >::operator*(), edm::AtomicPtrCache< std::vector< reco::PFRecoTauChargedHadron > >::operator->(), and edm::AtomicPtrCache< std::vector< reco::PFRecoTauChargedHadron > >::~AtomicPtrCache().
|
inline |
Definition at line 64 of file AtomicPtrCache.h.
|
inline |
Definition at line 53 of file AtomicPtrCache.h.
|
inline |
Definition at line 63 of file AtomicPtrCache.h.
|
inline |
Definition at line 52 of file AtomicPtrCache.h.
|
inline |
Definition at line 91 of file AtomicPtrCache.h.
|
inline |
Definition at line 142 of file AtomicPtrCache.h.
Referenced by edm::AtomicPtrCache< std::vector< reco::PFRecoTauChargedHadron > >::set().
|
inline |
unsets the value and deletes the memory
Definition at line 137 of file AtomicPtrCache.h.
Referenced by DTReadOutMapping::clear().
|
inline |
returns true if actually was set. Will delete value held by iNewValue if not the first time set
Definition at line 127 of file AtomicPtrCache.h.
Referenced by DTReadOutMapping::cacheMap(), and HcalGeometry::fillDetIds().
|
mutableprivate |
Definition at line 75 of file AtomicPtrCache.h.
Referenced by edm::AtomicPtrCache< std::vector< reco::PFRecoTauChargedHadron > >::operator=().