#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 > &) |
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 88 of file AtomicPtrCache.h.
|
inlineexplicit |
|
inline |
|
inline |
Definition at line 120 of file AtomicPtrCache.h.
|
inline |
Definition at line 131 of file AtomicPtrCache.h.
Referenced by pat::Jet::getPFConstituents(), pat::Tau::isolationPFCands(), pat::Tau::isolationPFChargedHadrCands(), pat::Tau::isolationPFGammaCands(), pat::Tau::isolationPFNeutrHadrCands(), pat::Tau::isolationTracks(), pat::Tau::signalPFCands(), pat::Tau::signalPFChargedHadrCands(), pat::Tau::signalPFGammaCands(), pat::Tau::signalPFNeutrHadrCands(), and pat::Tau::signalTracks().
|
inline |
Definition at line 128 of file AtomicPtrCache.h.
Referenced by edm::AtomicPtrCache< reco::TrackRefVector >::operator*(), and edm::AtomicPtrCache< reco::TrackRefVector >::operator->().
|
inline |
Definition at line 125 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 |
unsets the value and deletes the memory
Definition at line 144 of file AtomicPtrCache.h.
Referenced by pat::Jet::setPFCandidates().
|
inline |
returns true if actually was set. Will delete value held by iNewValue if not the first time set
Definition at line 134 of file AtomicPtrCache.h.
Referenced by pat::Jet::cachePFCandidates(), betterConfigParser.BetterConfigParser::getGeneral(), pat::Tau::isolationPFCands(), pat::Tau::isolationPFChargedHadrCands(), pat::Tau::isolationPFGammaCands(), pat::Tau::isolationPFNeutrHadrCands(), pat::Tau::isolationTracks(), pat::Tau::signalPFCands(), pat::Tau::signalPFChargedHadrCands(), pat::Tau::signalPFGammaCands(), pat::Tau::signalPFNeutrHadrCands(), and pat::Tau::signalTracks().
|
mutableprivate |
Definition at line 81 of file AtomicPtrCache.h.
Referenced by edm::AtomicPtrCache< T >::operator=().