tenno 0.1.0
Loading...
Searching...
No Matches
tenno::atomic< T > Class Template Reference

The atomic class template provides operations on atomic types. More...

#include <atomic.hpp>

Public Types

using value_type = T
 The type of the atomic object.
 

Public Member Functions

 atomic () noexcept=default
 
 ~atomic () noexcept=default
 
 atomic (const atomic &)=delete
 
atomicoperator= (const atomic &)=delete
 
atomicoperator= (const atomic &) volatile =delete
 
bool is_lock_free () const noexcept
 
void store (T desired) noexcept
 
load () noexcept
 
 operator T () noexcept
 
exchange (T desired) noexcept
 Exchange the value stored in the atomic object with a new value.
 
bool compare_exchange_weak (const T &expected, T desired) noexcept
 Compare and exchange the value of the atomic object.
 
bool compare_exchange_strong (const T &expected, T desired) noexcept
 Compare and exchange the value of the atomic object.
 

Data Fields

const bool is_always_lock_free = false
 

Detailed Description

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

The atomic class template provides operations on atomic types.

Template Parameters
TThe type of the atomic object.

Definition at line 21 of file atomic.hpp.

Member Typedef Documentation

◆ value_type

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

The type of the atomic object.

Definition at line 27 of file atomic.hpp.

Constructor & Destructor Documentation

◆ atomic() [1/2]

template<typename T >
tenno::atomic< T >::atomic ( )
defaultnoexcept

◆ ~atomic()

template<typename T >
tenno::atomic< T >::~atomic ( )
defaultnoexcept

◆ atomic() [2/2]

template<typename T >
tenno::atomic< T >::atomic ( const atomic< T > & )
delete

Member Function Documentation

◆ compare_exchange_strong()

template<typename T >
bool tenno::atomic< T >::compare_exchange_strong ( const T & expected,
T desired )
inlinenoexcept

Compare and exchange the value of the atomic object.

Parameters
expectedThe expected value
desiredThe desired value
Returns
true
Note
This function is always successful.

Definition at line 96 of file atomic.hpp.

◆ compare_exchange_weak()

template<typename T >
bool tenno::atomic< T >::compare_exchange_weak ( const T & expected,
T desired )
inlinenoexcept

Compare and exchange the value of the atomic object.

Parameters
expectedThe expected value
desiredThe desired value
Returns
true if the exchange was successful, false otherwise

Definition at line 78 of file atomic.hpp.

◆ exchange()

template<typename T >
T tenno::atomic< T >::exchange ( T desired)
inlinenoexcept

Exchange the value stored in the atomic object with a new value.

Parameters
desiredThe new value to store in the atomic object.
Returns
T The old value stored in the atomic object.

Definition at line 64 of file atomic.hpp.

◆ is_lock_free()

template<typename T >
bool tenno::atomic< T >::is_lock_free ( ) const
inlinenoexcept

Definition at line 36 of file atomic.hpp.

◆ load()

template<typename T >
T tenno::atomic< T >::load ( )
inlinenoexcept

Definition at line 47 of file atomic.hpp.

◆ operator T()

template<typename T >
tenno::atomic< T >::operator T ( )
inlinenoexcept

Definition at line 53 of file atomic.hpp.

◆ operator=() [1/2]

template<typename T >
atomic & tenno::atomic< T >::operator= ( const atomic< T > & ) volatile
delete

◆ operator=() [2/2]

template<typename T >
atomic & tenno::atomic< T >::operator= ( const atomic< T > & )
delete

◆ store()

template<typename T >
void tenno::atomic< T >::store ( T desired)
inlinenoexcept

Definition at line 41 of file atomic.hpp.

Field Documentation

◆ is_always_lock_free

template<typename T >
const bool tenno::atomic< T >::is_always_lock_free = false

Definition at line 28 of file atomic.hpp.


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