Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef CXXUTILS_CACHEDPOINTER_H
14 #define CXXUTILS_CACHEDPOINTER_H
21 #if ATOMIC_POINTER_LOCK_FREE != 2
22 # error Code assumes lock-free atomic pointers; see comments below.
100 mutable std::atomic<pointer_t>
m_a;
111 #endif // not CXXUTILS_CACHEDPOINTER_H
CachedPointer(pointer_t elt)
Constructor from an element.
CachedPointer(const CachedPointer &other) noexcept
Copy constructor.
CachedPointer(CachedPointer &&other) noexcept
Move constructor.
void set(pointer_t elt) const
Set the element, assuming it is currently null.
std::atomic< pointer_t > m_a
The cached element, both directly and as an atomic (recall that this is a union).
CachedPointer()
Default constructor. Sets the element to null.
const pointer_t * ptr() const
Return a pointer to the cached element.
const T * pointer_t
The stored pointer type.
CachedPointer & operator=(const CachedPointer &other)
Assignment.
void store(pointer_t elt)
Store a new value to the element.
Cached pointer with atomic update.
pointer_t get() const
Return the current value of the element.