alternative Standard Libary  0.29.8
std::atomic< T > Template-Klassenreferenz

#include <atomic.hpp>

Öffentliche Typen

using value_type = T
 
using self_type = atomic< value_type >
 

Öffentliche Methoden

 atomic ()
 
 atomic (value_type value)
 
value_type get ()
 
bool is_free (void) const
 
void store (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type load (MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst) const
 
value_type exchange (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
bool compare_exchange (value_type &expected, T desired, bool b, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type fetch_add (T v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type fetch_sub (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type fetch_and (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type fetch_or (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type fetch_xor (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type add_fetch (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type sub_fetch (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type and_fetch (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type or_fetch (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
value_type xor_fetch (value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
 
void swap (self_type &other)
 
 operator value_type (void) const
 
value_type operator= (value_type v)
 
value_type operator++ (int)
 
value_type operator-- (int)
 
value_type operator++ (void)
 
value_type operator-- (void)
 
value_type operator+= (value_type v)
 
value_type operator-= (value_type v)
 
value_type operator &= (value_type v)
 
value_type operator|= (value_type v)
 
value_type operator^= (value_type v)
 

Ausführliche Beschreibung

template<typename T>
class std::atomic< T >

Dokumentation der benutzerdefinierten Datentypen

◆ self_type

template<typename T>
using std::atomic< T >::self_type = atomic<value_type>

◆ value_type

template<typename T>
using std::atomic< T >::value_type = T

Beschreibung der Konstruktoren und Destruktoren

◆ atomic() [1/2]

template<typename T>
std::atomic< T >::atomic ( )
inline
57 : _m_value(0) { }

◆ atomic() [2/2]

template<typename T>
std::atomic< T >::atomic ( value_type  value)
inline
58 : _m_value(value) { }

Dokumentation der Elementfunktionen

◆ add_fetch()

template<typename T>
value_type std::atomic< T >::add_fetch ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
91  { return __atomic_add_fetch (&_m_value, v, order); }

◆ and_fetch()

template<typename T>
value_type std::atomic< T >::and_fetch ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
97  { return __atomic_and_fetch (&_m_value, v, order); }

◆ compare_exchange()

template<typename T>
bool std::atomic< T >::compare_exchange ( value_type expected,
desired,
bool  b,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
73  { return __atomic_compare_exchange_n (&_m_value, &expected, desired, b, order, order); }

◆ exchange()

template<typename T>
value_type std::atomic< T >::exchange ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
71  { return __atomic_exchange_n (&_m_value, v, order); }

◆ fetch_add()

template<typename T>
value_type std::atomic< T >::fetch_add ( v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
76  { return __atomic_fetch_add (&_m_value, v, order); }

◆ fetch_and()

template<typename T>
value_type std::atomic< T >::fetch_and ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
82  { return __atomic_fetch_and (&_m_value, v, order); }

◆ fetch_or()

template<typename T>
value_type std::atomic< T >::fetch_or ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
85  { return __atomic_fetch_or (&_m_value, v, order); }

◆ fetch_sub()

template<typename T>
value_type std::atomic< T >::fetch_sub ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
79  { return __atomic_fetch_sub (&_m_value, v, order); }

◆ fetch_xor()

template<typename T>
value_type std::atomic< T >::fetch_xor ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
88  { return __atomic_fetch_xor (&_m_value, v, order); }

◆ get()

template<typename T>
value_type std::atomic< T >::get ( )
inline
61 { return _m_value; }

◆ is_free()

template<typename T>
bool std::atomic< T >::is_free ( void  ) const
inline
64  { return __atomic_is_lock_free (sizeof(value_type), &_m_value); }
T value_type
Definition: atomic.hpp:54

◆ load()

template<typename T>
value_type std::atomic< T >::load ( MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst) const
inline
69  { return __atomic_load_n (&_m_value, order); }

◆ operator &=()

template<typename T>
value_type std::atomic< T >::operator&= ( value_type  v)
inline
126  { return and_fetch (v); }
value_type and_fetch(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:96

◆ operator value_type()

template<typename T>
std::atomic< T >::operator value_type ( void  ) const
inline
110  { return load(); }
value_type load(MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst) const
Definition: atomic.hpp:68

◆ operator++() [1/2]

template<typename T>
value_type std::atomic< T >::operator++ ( int  )
inline
114  { return fetch_add (1); }
value_type fetch_add(T v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:75

◆ operator++() [2/2]

template<typename T>
value_type std::atomic< T >::operator++ ( void  )
inline
118  { return add_fetch (1); }
value_type add_fetch(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:90

◆ operator+=()

template<typename T>
value_type std::atomic< T >::operator+= ( value_type  v)
inline
122  { return add_fetch (v); }
value_type add_fetch(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:90

◆ operator--() [1/2]

template<typename T>
value_type std::atomic< T >::operator-- ( int  )
inline
116  { return fetch_sub (1); }
value_type fetch_sub(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:78

◆ operator--() [2/2]

template<typename T>
value_type std::atomic< T >::operator-- ( void  )
inline
120  { return sub_fetch (1); }
value_type sub_fetch(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:93

◆ operator-=()

template<typename T>
value_type std::atomic< T >::operator-= ( value_type  v)
inline
124  { return sub_fetch (v); }
value_type sub_fetch(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:93

◆ operator=()

template<typename T>
value_type std::atomic< T >::operator= ( value_type  v)
inline
112  { store(v); return v; }
void store(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:65

◆ operator^=()

template<typename T>
value_type std::atomic< T >::operator^= ( value_type  v)
inline
130  { return xor_fetch (v); }
value_type xor_fetch(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:102

◆ operator|=()

template<typename T>
value_type std::atomic< T >::operator|= ( value_type  v)
inline
128  { return or_fetch (v); }
value_type or_fetch(value_type v, MemoryOrder::MemoryOrder_t order=MemoryOrder::SeqCst)
Definition: atomic.hpp:99

◆ or_fetch()

template<typename T>
value_type std::atomic< T >::or_fetch ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
100  { return __atomic_or_fetch (&_m_value, v, order); }

◆ store()

template<typename T>
void std::atomic< T >::store ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
66  { __atomic_store_n (&_m_value, v, order); }

◆ sub_fetch()

template<typename T>
value_type std::atomic< T >::sub_fetch ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
94  { return __atomic_sub_fetch (&_m_value, v, order); }

◆ swap()

template<typename T>
void std::atomic< T >::swap ( self_type other)
inline
105  {
106  std::swap<value_type>(_m_value, other._m_value);
107  }

◆ xor_fetch()

template<typename T>
value_type std::atomic< T >::xor_fetch ( value_type  v,
MemoryOrder::MemoryOrder_t  order = MemoryOrder::SeqCst 
)
inline
103  { return __atomic_xor_fetch (&_m_value, v, order); }

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: