Mixe for Privacy and Anonymity in the Internet
Public Member Functions | Private Attributes | List of all members
weak_atomic< T > Class Template Reference

#include <atomicops.h>

Inheritance diagram for weak_atomic< T >:
Collaboration diagram for weak_atomic< T >:

Public Member Functions

AE_NO_TSAN weak_atomic ()
 
template<typename U >
AE_NO_TSAN weak_atomic (U &&x)
 
AE_NO_TSAN weak_atomic (weak_atomic const &other)
 
AE_NO_TSAN weak_atomic (weak_atomic &&other)
 
AE_FORCEINLINE operator T () const AE_NO_TSAN
 
template<typename U >
AE_FORCEINLINE weak_atomic const & operator= (U &&x) AE_NO_TSAN
 
AE_FORCEINLINE weak_atomic const & operator= (weak_atomic const &other) AE_NO_TSAN
 
AE_FORCEINLINEload () const AE_NO_TSAN
 
AE_FORCEINLINEfetch_add_acquire (T increment) AE_NO_TSAN
 
AE_FORCEINLINEfetch_add_release (T increment) AE_NO_TSAN
 

Private Attributes

std::atomic< T > value
 

Detailed Description

template<typename T>
class weak_atomic< T >

Definition at line 233 of file atomicops.h.

Constructor & Destructor Documentation

◆ weak_atomic() [1/4]

template<typename T >
AE_NO_TSAN weak_atomic< T >::weak_atomic ( )
inline

Definition at line 236 of file atomicops.h.

236 { }

◆ weak_atomic() [2/4]

template<typename T >
template<typename U >
AE_NO_TSAN weak_atomic< T >::weak_atomic ( U &&  x)
inline

Definition at line 241 of file atomicops.h.

241 : value(std::forward<U>(x)) { }
std::atomic< T > value
Definition: atomicops.h:322

◆ weak_atomic() [3/4]

template<typename T >
AE_NO_TSAN weak_atomic< T >::weak_atomic ( weak_atomic< T > const &  other)
inline

Definition at line 246 of file atomicops.h.

246 : value(other.load()) { }

◆ weak_atomic() [4/4]

template<typename T >
AE_NO_TSAN weak_atomic< T >::weak_atomic ( weak_atomic< T > &&  other)
inline

Definition at line 247 of file atomicops.h.

247 : value(std::move(other.load())) { }
AE_FORCEINLINE T load() const AE_NO_TSAN
Definition: atomicops.h:302

Member Function Documentation

◆ fetch_add_acquire()

template<typename T >
AE_FORCEINLINE T weak_atomic< T >::fetch_add_acquire ( increment)
inline

Definition at line 304 of file atomicops.h.

305  {
306  return value.fetch_add(increment, std::memory_order_acquire);
307  }
@ memory_order_acquire
Definition: atomicops.h:84

References memory_order_acquire, and weak_atomic< T >::value.

Referenced by spsc_sema::LightweightSemaphore::tryWait(), and spsc_sema::LightweightSemaphore::waitWithPartialSpinning().

Here is the caller graph for this function:

◆ fetch_add_release()

template<typename T >
AE_FORCEINLINE T weak_atomic< T >::fetch_add_release ( increment)
inline

Definition at line 309 of file atomicops.h.

310  {
311  return value.fetch_add(increment, std::memory_order_release);
312  }
@ memory_order_release
Definition: atomicops.h:85

References memory_order_release, and weak_atomic< T >::value.

Referenced by spsc_sema::LightweightSemaphore::signal(), and spsc_sema::LightweightSemaphore::waitWithPartialSpinning().

Here is the caller graph for this function:

◆ load()

template<typename T >
AE_FORCEINLINE T weak_atomic< T >::load ( ) const
inline

◆ operator T()

template<typename T >
AE_FORCEINLINE weak_atomic< T >::operator T ( ) const
inline

Definition at line 252 of file atomicops.h.

252 { return load(); }

◆ operator=() [1/2]

template<typename T >
template<typename U >
AE_FORCEINLINE weak_atomic const& weak_atomic< T >::operator= ( U &&  x)
inline

Definition at line 290 of file atomicops.h.

291  {
292  value.store(std::forward<U>(x), std::memory_order_relaxed);
293  return *this;
294  }

References memory_order_relaxed, and weak_atomic< T >::value.

◆ operator=() [2/2]

template<typename T >
AE_FORCEINLINE weak_atomic const& weak_atomic< T >::operator= ( weak_atomic< T > const &  other)
inline

Definition at line 296 of file atomicops.h.

297  {
299  return *this;
300  }

References memory_order_relaxed, and weak_atomic< T >::value.

Member Data Documentation

◆ value

template<typename T >
std::atomic<T> weak_atomic< T >::value
private

The documentation for this class was generated from the following file: