Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::RelaxedAtomic< T > Class Template Reference

#include <atomic.h>

Public Member Functions

constexpr RelaxedAtomic ()
 
constexpr RelaxedAtomic (T arg)
 
 RelaxedAtomic (const RelaxedAtomic &arg)
 
T load (std::memory_order order=std::memory_order_relaxed) const
 
T load (std::memory_order order=std::memory_order_relaxed) const volatile
 
void store (T arg, std::memory_order order=std::memory_order_relaxed)
 
void store (T arg, std::memory_order order=std::memory_order_relaxed) volatile
 
T fetch_add (T arg, std::memory_order order=std::memory_order_relaxed)
 
T fetch_sub (T arg, std::memory_order order=std::memory_order_relaxed)
 
T fetch_or (T arg, std::memory_order order=std::memory_order_relaxed)
 
T fetch_and (T arg, std::memory_order order=std::memory_order_relaxed)
 
T exchange (T arg, std::memory_order order=std::memory_order_relaxed)
 
bool compare_exchange_weak (T &expected, T desired, std::memory_order order=std::memory_order_relaxed)
 
bool compare_exchange_weak (T &expected, T desired, std::memory_order order=std::memory_order_relaxed) volatile
 
bool compare_exchange_strong (T &expected, T desired, std::memory_order order=std::memory_order_relaxed)
 
 operator T () const
 
T operator= (T arg)
 
T operator= (const RelaxedAtomic &arg)
 
T operator+= (T arg)
 
T operator-= (T arg)
 
T operator++ ()
 
T operator-- ()
 
T operator++ (int)
 
T operator-- (int)
 

Detailed Description

template<typename T>
class dart::RelaxedAtomic< T >

Definition at line 15 of file atomic.h.

Constructor & Destructor Documentation

◆ RelaxedAtomic() [1/3]

template<typename T >
constexpr dart::RelaxedAtomic< T >::RelaxedAtomic ( )
inlineconstexpr

Definition at line 17 of file atomic.h.

17: value_() {}

◆ RelaxedAtomic() [2/3]

template<typename T >
constexpr dart::RelaxedAtomic< T >::RelaxedAtomic ( T  arg)
inlineconstexpr

Definition at line 18 of file atomic.h.

18: value_(arg) {} // NOLINT

◆ RelaxedAtomic() [3/3]

template<typename T >
dart::RelaxedAtomic< T >::RelaxedAtomic ( const RelaxedAtomic< T > &  arg)
inline

Definition at line 19 of file atomic.h.

19: value_(arg) {} // NOLINT

Member Function Documentation

◆ compare_exchange_strong()

template<typename T >
bool dart::RelaxedAtomic< T >::compare_exchange_strong ( T expected,
T  desired,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 64 of file atomic.h.

67 {
68 return value_.compare_exchange_strong(expected, desired, order, order);
69 }

◆ compare_exchange_weak() [1/2]

template<typename T >
bool dart::RelaxedAtomic< T >::compare_exchange_weak ( T expected,
T  desired,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 52 of file atomic.h.

55 {
56 return value_.compare_exchange_weak(expected, desired, order, order);
57 }

◆ compare_exchange_weak() [2/2]

template<typename T >
bool dart::RelaxedAtomic< T >::compare_exchange_weak ( T expected,
T  desired,
std::memory_order  order = std::memory_order_relaxed 
) volatile
inline

Definition at line 58 of file atomic.h.

61 {
62 return value_.compare_exchange_weak(expected, desired, order, order);
63 }

◆ exchange()

template<typename T >
T dart::RelaxedAtomic< T >::exchange ( T  arg,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 48 of file atomic.h.

48 {
49 return value_.exchange(arg, order);
50 }

◆ fetch_add()

template<typename T >
T dart::RelaxedAtomic< T >::fetch_add ( T  arg,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 35 of file atomic.h.

35 {
36 return value_.fetch_add(arg, order);
37 }

◆ fetch_and()

template<typename T >
T dart::RelaxedAtomic< T >::fetch_and ( T  arg,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 44 of file atomic.h.

44 {
45 return value_.fetch_and(arg, order);
46 }

◆ fetch_or()

template<typename T >
T dart::RelaxedAtomic< T >::fetch_or ( T  arg,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 41 of file atomic.h.

41 {
42 return value_.fetch_or(arg, order);
43 }

◆ fetch_sub()

template<typename T >
T dart::RelaxedAtomic< T >::fetch_sub ( T  arg,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 38 of file atomic.h.

38 {
39 return value_.fetch_sub(arg, order);
40 }

◆ load() [1/2]

template<typename T >
T dart::RelaxedAtomic< T >::load ( std::memory_order  order = std::memory_order_relaxed) const
inline

Definition at line 21 of file atomic.h.

21 {
22 return value_.load(order);
23 }

◆ load() [2/2]

template<typename T >
T dart::RelaxedAtomic< T >::load ( std::memory_order  order = std::memory_order_relaxed) const volatile
inline

Definition at line 24 of file atomic.h.

24 {
25 return value_.load(order);
26 }

◆ operator T()

template<typename T >
dart::RelaxedAtomic< T >::operator T ( ) const
inline

Definition at line 71 of file atomic.h.

71{ return load(); }
T load(std::memory_order order=std::memory_order_relaxed) const
Definition: atomic.h:21

◆ operator++() [1/2]

template<typename T >
T dart::RelaxedAtomic< T >::operator++ ( )
inline

Definition at line 83 of file atomic.h.

83{ return fetch_add(1) + 1; }
T fetch_add(T arg, std::memory_order order=std::memory_order_relaxed)
Definition: atomic.h:35

◆ operator++() [2/2]

template<typename T >
T dart::RelaxedAtomic< T >::operator++ ( int  )
inline

Definition at line 85 of file atomic.h.

85{ return fetch_add(1); }

◆ operator+=()

template<typename T >
T dart::RelaxedAtomic< T >::operator+= ( T  arg)
inline

Definition at line 81 of file atomic.h.

81{ return fetch_add(arg) + arg; }

◆ operator--() [1/2]

template<typename T >
T dart::RelaxedAtomic< T >::operator-- ( )
inline

Definition at line 84 of file atomic.h.

84{ return fetch_sub(1) - 1; }
T fetch_sub(T arg, std::memory_order order=std::memory_order_relaxed)
Definition: atomic.h:38

◆ operator--() [2/2]

template<typename T >
T dart::RelaxedAtomic< T >::operator-- ( int  )
inline

Definition at line 86 of file atomic.h.

86{ return fetch_sub(1); }

◆ operator-=()

template<typename T >
T dart::RelaxedAtomic< T >::operator-= ( T  arg)
inline

Definition at line 82 of file atomic.h.

82{ return fetch_sub(arg) - arg; }

◆ operator=() [1/2]

template<typename T >
T dart::RelaxedAtomic< T >::operator= ( const RelaxedAtomic< T > &  arg)
inline

Definition at line 76 of file atomic.h.

76 {
77 T loaded_once = arg;
78 store(loaded_once);
79 return loaded_once;
80 }
void store(T arg, std::memory_order order=std::memory_order_relaxed)
Definition: atomic.h:27
#define T
Definition: precompiler.cc:65

◆ operator=() [2/2]

template<typename T >
T dart::RelaxedAtomic< T >::operator= ( T  arg)
inline

Definition at line 72 of file atomic.h.

72 {
73 store(arg);
74 return arg;
75 }

◆ store() [1/2]

template<typename T >
void dart::RelaxedAtomic< T >::store ( T  arg,
std::memory_order  order = std::memory_order_relaxed 
)
inline

Definition at line 27 of file atomic.h.

27 {
28 value_.store(arg, order);
29 }

◆ store() [2/2]

template<typename T >
void dart::RelaxedAtomic< T >::store ( T  arg,
std::memory_order  order = std::memory_order_relaxed 
) volatile
inline

Definition at line 30 of file atomic.h.

31 {
32 value_.store(arg, order);
33 }

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