1 #ifndef FWCore_Utilities_atomic_value_ptr_h 2 #define FWCore_Utilities_atomic_value_ptr_h 64 myP(createFrom(orig.myP.
load())) {
69 exchangeWithLocal(local);
74 myP(orig.myP) { orig.myP.store(
nullptr); }
78 exchangeWithLocal(local);
101 exchangeWithLocal(local);
116 exchangeWithLocal(local);
125 return myP.compare_exchange_strong(oldValue, newValue);
139 operator bool_type()
const {
140 return myP !=
nullptr ?
153 T* old = myP.exchange(local.
myP.load());
161 template <
typename U>
173 mutable std::atomic<T*>
myP;
182 template <
typename T,
typename U>
188 template <
typename T,
typename U>
194 template <
typename T,
typename U>
200 template <
typename T,
typename U>
208 #endif // FWCoreUtilities_atomic_value_ptr_h atomic_value_ptr(atomic_value_ptr< U > const &orig)
atomic_value_ptr & operator=(atomic_value_ptr< U > const &orig)
void exchangeWithLocal(atomic_value_ptr &local)
atomic_value_ptr & operator=(atomic_value_ptr const &orig)
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
atomic_value_ptr & operator=(std::unique_ptr< T > orig)
void this_type_does_not_support_comparisons() const
atomic_value_ptr & operator=(atomic_value_ptr &&orig)
atomic_value_ptr(atomic_value_ptr const &orig)
bool compare_exchange_strong(T *&oldValue, T *newValue)
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
static T * createFrom(U const *p)
static T * clone(T const *p)
atomic_value_ptr(std::unique_ptr< T > orig)
atomic_value_ptr(atomic_value_ptr &&orig)