#include "DataFormats/Common/interface/AtomicPtrCache.h"
Public Member Functions | |
AtomicPtrCache () | |
AtomicPtrCache (T *) | |
Takes exclusive ownership of the value. More... | |
AtomicPtrCache (const AtomicPtrCache< T > &) | |
Uses T's copy constructor to make a copy. More... | |
bool | isSet () const |
T const * | load () const |
T * | load () |
T const & | operator* () const |
T & | operator* () |
T const * | operator-> () const |
T * | operator-> () |
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 81 of file AtomicPtrCache.h.
|
inlineexplicit |
|
inline |
|
inline |
Definition at line 113 of file AtomicPtrCache.h.
|
inline |
Definition at line 124 of file AtomicPtrCache.h.
Referenced by HcalGeometry::fillDetIds(), HcalGeometry::getHxSize(), and HcalGeometry::getValidDetIds().
|
inline |
Definition at line 121 of file AtomicPtrCache.h.
Referenced by HcalGeometry::getValidDetIds(), edm::AtomicPtrCache< std::vector< DetId > >::operator*(), and edm::AtomicPtrCache< std::vector< DetId > >::operator->().
|
inline |
Definition at line 118 of file AtomicPtrCache.h.
|
inline |
Definition at line 55 of file AtomicPtrCache.h.
|
inline |
Definition at line 66 of file AtomicPtrCache.h.
|
inline |
Definition at line 54 of file AtomicPtrCache.h.
|
inline |
Definition at line 65 of file AtomicPtrCache.h.
|
inline |
|
inline |
Definition at line 140 of file AtomicPtrCache.h.
References tmp.
Referenced by cuy.ValElement::__init__().
|
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 78 of file AtomicPtrCache.h.
Referenced by edm::AtomicPtrCache< T >::operator=().