Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::core::Atomic< T > Class Template Reference

Atomic integer. Provides sequential consistency. For a fine-grained memory order control, see AtomicOps. More...

#include <atomic.h>

Inheritance diagram for roc::core::Atomic< T >:
Collaboration diagram for roc::core::Atomic< T >:

Public Member Functions

 Atomic (T val=0)
 Initialize with given value. More...
 
exchange (T val)
 Atomic exchange. More...
 
bool compare_exchange (T exp, T des)
 Atomic compare-and-swap. More...
 
fetch_or (T val)
 Atomic fetch-or. More...
 
fetch_and (T val)
 Atomic fetch-and. More...
 
fetch_xor (T val)
 Atomic fetch-xor. More...
 
 operator T () const
 Atomic load. More...
 
operator= (T val)
 Atomic store. More...
 
operator++ ()
 Atomic increment (prefix). More...
 
operator++ (int)
 Atomic increment (postfix). More...
 
operator-- ()
 Atomic decrement (prefix). More...
 
operator-- (int)
 Atomic decrement (postfix). More...
 
operator+= (T val)
 Atomic addition. More...
 
operator-= (T val)
 Atomic subtraction. More...
 
operator|= (T val)
 Atomic bitwise or. More...
 
operator&= (T val)
 Atomic bitwise and. More...
 
operator^= (T val)
 Atomic bitwise xor. More...
 

Detailed Description

template<class T>
class roc::core::Atomic< T >

Atomic integer. Provides sequential consistency. For a fine-grained memory order control, see AtomicOps.

Definition at line 26 of file atomic.h.

Constructor & Destructor Documentation

◆ Atomic()

template<class T >
roc::core::Atomic< T >::Atomic ( val = 0)
inlineexplicit

Initialize with given value.

Definition at line 34 of file atomic.h.

Member Function Documentation

◆ compare_exchange()

template<class T >
bool roc::core::Atomic< T >::compare_exchange ( exp,
des 
)
inline

Atomic compare-and-swap.

Definition at line 44 of file atomic.h.

◆ exchange()

template<class T >
T roc::core::Atomic< T >::exchange ( val)
inline

Atomic exchange.

Definition at line 39 of file atomic.h.

◆ fetch_and()

template<class T >
T roc::core::Atomic< T >::fetch_and ( val)
inline

Atomic fetch-and.

Definition at line 54 of file atomic.h.

◆ fetch_or()

template<class T >
T roc::core::Atomic< T >::fetch_or ( val)
inline

Atomic fetch-or.

Definition at line 49 of file atomic.h.

◆ fetch_xor()

template<class T >
T roc::core::Atomic< T >::fetch_xor ( val)
inline

Atomic fetch-xor.

Definition at line 59 of file atomic.h.

◆ operator T()

template<class T >
roc::core::Atomic< T >::operator T ( ) const
inline

Atomic load.

Definition at line 64 of file atomic.h.

◆ operator&=()

template<class T >
T roc::core::Atomic< T >::operator&= ( val)
inline

Atomic bitwise and.

Definition at line 110 of file atomic.h.

◆ operator++() [1/2]

template<class T >
T roc::core::Atomic< T >::operator++ ( )
inline

Atomic increment (prefix).

Definition at line 75 of file atomic.h.

◆ operator++() [2/2]

template<class T >
T roc::core::Atomic< T >::operator++ ( int  )
inline

Atomic increment (postfix).

Definition at line 80 of file atomic.h.

◆ operator+=()

template<class T >
T roc::core::Atomic< T >::operator+= ( val)
inline

Atomic addition.

Definition at line 95 of file atomic.h.

◆ operator--() [1/2]

template<class T >
T roc::core::Atomic< T >::operator-- ( )
inline

Atomic decrement (prefix).

Definition at line 85 of file atomic.h.

◆ operator--() [2/2]

template<class T >
T roc::core::Atomic< T >::operator-- ( int  )
inline

Atomic decrement (postfix).

Definition at line 90 of file atomic.h.

◆ operator-=()

template<class T >
T roc::core::Atomic< T >::operator-= ( val)
inline

Atomic subtraction.

Definition at line 100 of file atomic.h.

◆ operator=()

template<class T >
T roc::core::Atomic< T >::operator= ( val)
inline

Atomic store.

Definition at line 69 of file atomic.h.

◆ operator^=()

template<class T >
T roc::core::Atomic< T >::operator^= ( val)
inline

Atomic bitwise xor.

Definition at line 115 of file atomic.h.

◆ operator|=()

template<class T >
T roc::core::Atomic< T >::operator|= ( val)
inline

Atomic bitwise or.

Definition at line 105 of file atomic.h.


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