#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 40 of file AtomicPtrCache.h.
|
inline |
Definition at line 90 of file AtomicPtrCache.h.
|
inlineexplicit |
|
inline |
|
inline |
Definition at line 122 of file AtomicPtrCache.h.
|
inline |
Definition at line 133 of file AtomicPtrCache.h.
Referenced by HcalGeometry::fillDetIds(), and HcalGeometry::getValidDetIds().
|
inline |
Definition at line 130 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 127 of file AtomicPtrCache.h.
|
inline |
Definition at line 57 of file AtomicPtrCache.h.
|
inline |
Definition at line 70 of file AtomicPtrCache.h.
|
inline |
Definition at line 56 of file AtomicPtrCache.h.
|
inline |
Definition at line 69 of file AtomicPtrCache.h.
|
inline |
|
inline |
Definition at line 149 of file AtomicPtrCache.h.
References tmp.
Referenced by cuy.ValElement::__init__().
|
inline |
unsets the value and deletes the memory
Definition at line 146 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 136 of file AtomicPtrCache.h.
Referenced by DTReadOutMapping::cacheMap(), HcalGeometry::fillDetIds(), and betterConfigParser.BetterConfigParser::getGeneral().
|
mutableprivate |
Definition at line 83 of file AtomicPtrCache.h.
Referenced by edm::AtomicPtrCache< T >::operator=().