jaulib v1.1.2-85-g839acae-dirty
Jau Support Library (C++, Java, ..)
Public Member Functions | Static Public Attributes | List of all members
jau::ordered_atomic< _Tp, _MO > Struct Template Reference

std::atomic<T> type with predefined fixed std::memory_order, not allowing changing the memory model on usage and applying the set order to all operator. More...

#include <ordered_atomic.hpp>

Inheritance diagram for jau::ordered_atomic< _Tp, _MO >:
Collaboration diagram for jau::ordered_atomic< _Tp, _MO >:

Public Member Functions

 ordered_atomic () noexcept=default
 
constexpr ordered_atomic (_Tp __i) noexcept
 
 ordered_atomic (const ordered_atomic &)=delete
 
 ~ordered_atomic () noexcept=default
 
CXX_ALWAYS_INLINE bool compare_exchange_strong (_Tp &__e, _Tp __i) noexcept
 
CXX_ALWAYS_INLINE bool compare_exchange_strong (_Tp &__e, _Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE bool compare_exchange_weak (_Tp &__e, _Tp __i) noexcept
 
CXX_ALWAYS_INLINE bool compare_exchange_weak (_Tp &__e, _Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp exchange (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE _Tp exchange (_Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_add (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_add (_Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_and (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_and (_Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_or (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_or (_Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_sub (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_sub (_Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_xor (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE _Tp fetch_xor (_Tp __i) volatile noexcept
 
CXX_ALWAYS_INLINE bool is_lock_free () const noexcept
 
CXX_ALWAYS_INLINE bool is_lock_free () const volatile noexcept
 
CXX_ALWAYS_INLINE _Tp load () const noexcept
 
CXX_ALWAYS_INLINE _Tp load () const volatile noexcept
 
CXX_ALWAYS_INLINE operator _Tp () const noexcept
 
CXX_ALWAYS_INLINE operator _Tp () const volatile noexcept
 
CXX_ALWAYS_INLINE _Tp operator++ (int) noexcept
 
CXX_ALWAYS_INLINE _Tp operator++ (int) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp operator-- (int) noexcept
 
CXX_ALWAYS_INLINE _Tp operator-- (int) volatile noexcept
 
CXX_ALWAYS_INLINE _Tp operator= (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE _Tp operator= (_Tp __i) volatile noexcept
 
ordered_atomicoperator= (const ordered_atomic &) volatile=delete
 
ordered_atomicoperator= (const ordered_atomic &)=delete
 
CXX_ALWAYS_INLINE void store (_Tp __i) noexcept
 
CXX_ALWAYS_INLINE void store (_Tp __i) volatile noexcept
 

Static Public Attributes

static constexpr bool is_always_lock_free = super::is_always_lock_free
 

Detailed Description

template<typename _Tp, std::memory_order _MO>
struct jau::ordered_atomic< _Tp, _MO >

std::atomic<T> type with predefined fixed std::memory_order, not allowing changing the memory model on usage and applying the set order to all operator.

See also:



Definition at line 71 of file ordered_atomic.hpp.

Constructor & Destructor Documentation

◆ ordered_atomic() [1/3]

template<typename _Tp , std::memory_order _MO>
jau::ordered_atomic< _Tp, _MO >::ordered_atomic ( )
defaultnoexcept

◆ ~ordered_atomic()

template<typename _Tp , std::memory_order _MO>
jau::ordered_atomic< _Tp, _MO >::~ordered_atomic ( )
defaultnoexcept

◆ ordered_atomic() [2/3]

template<typename _Tp , std::memory_order _MO>
jau::ordered_atomic< _Tp, _MO >::ordered_atomic ( const ordered_atomic< _Tp, _MO > &  )
delete

◆ ordered_atomic() [3/3]

template<typename _Tp , std::memory_order _MO>
constexpr jau::ordered_atomic< _Tp, _MO >::ordered_atomic ( _Tp  __i)
inlineconstexprnoexcept

Definition at line 82 of file ordered_atomic.hpp.

Member Function Documentation

◆ operator=() [1/4]

template<typename _Tp , std::memory_order _MO>
ordered_atomic & jau::ordered_atomic< _Tp, _MO >::operator= ( const ordered_atomic< _Tp, _MO > &  )
delete

◆ operator=() [2/4]

template<typename _Tp , std::memory_order _MO>
ordered_atomic & jau::ordered_atomic< _Tp, _MO >::operator= ( const ordered_atomic< _Tp, _MO > &  ) volatile
delete

◆ operator _Tp() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE jau::ordered_atomic< _Tp, _MO >::operator _Tp ( ) const
inlinenoexcept

Definition at line 87 of file ordered_atomic.hpp.

◆ operator _Tp() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE jau::ordered_atomic< _Tp, _MO >::operator _Tp ( ) const volatile
inlinenoexcept

Definition at line 91 of file ordered_atomic.hpp.

◆ operator=() [3/4]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::operator= ( _Tp  __i)
inlinenoexcept

Definition at line 95 of file ordered_atomic.hpp.

◆ operator=() [4/4]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::operator= ( _Tp  __i) volatile
inlinenoexcept

Definition at line 99 of file ordered_atomic.hpp.

◆ operator++() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::operator++ ( int  )
inlinenoexcept

Definition at line 103 of file ordered_atomic.hpp.

◆ operator++() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::operator++ ( int  ) volatile
inlinenoexcept

Definition at line 107 of file ordered_atomic.hpp.

◆ operator--() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::operator-- ( int  )
inlinenoexcept

Definition at line 111 of file ordered_atomic.hpp.

◆ operator--() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::operator-- ( int  ) volatile
inlinenoexcept

Definition at line 115 of file ordered_atomic.hpp.

◆ is_lock_free() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE bool jau::ordered_atomic< _Tp, _MO >::is_lock_free ( ) const
inlinenoexcept

Definition at line 141 of file ordered_atomic.hpp.

◆ is_lock_free() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE bool jau::ordered_atomic< _Tp, _MO >::is_lock_free ( ) const volatile
inlinenoexcept

Definition at line 145 of file ordered_atomic.hpp.

◆ store() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE void jau::ordered_atomic< _Tp, _MO >::store ( _Tp  __i)
inlinenoexcept

Definition at line 151 of file ordered_atomic.hpp.

Here is the caller graph for this function:

◆ store() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE void jau::ordered_atomic< _Tp, _MO >::store ( _Tp  __i) volatile
inlinenoexcept

Definition at line 155 of file ordered_atomic.hpp.

◆ load() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::load ( ) const
inlinenoexcept

Definition at line 159 of file ordered_atomic.hpp.

Here is the caller graph for this function:

◆ load() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::load ( ) const volatile
inlinenoexcept

Definition at line 163 of file ordered_atomic.hpp.

◆ exchange() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::exchange ( _Tp  __i)
inlinenoexcept

Definition at line 167 of file ordered_atomic.hpp.

◆ exchange() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::exchange ( _Tp  __i) volatile
inlinenoexcept

Definition at line 171 of file ordered_atomic.hpp.

◆ compare_exchange_weak() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE bool jau::ordered_atomic< _Tp, _MO >::compare_exchange_weak ( _Tp &  __e,
_Tp  __i 
)
inlinenoexcept

Definition at line 175 of file ordered_atomic.hpp.

◆ compare_exchange_weak() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE bool jau::ordered_atomic< _Tp, _MO >::compare_exchange_weak ( _Tp &  __e,
_Tp  __i 
) volatile
inlinenoexcept

Definition at line 179 of file ordered_atomic.hpp.

◆ compare_exchange_strong() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE bool jau::ordered_atomic< _Tp, _MO >::compare_exchange_strong ( _Tp &  __e,
_Tp  __i 
)
inlinenoexcept

Definition at line 183 of file ordered_atomic.hpp.

◆ compare_exchange_strong() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE bool jau::ordered_atomic< _Tp, _MO >::compare_exchange_strong ( _Tp &  __e,
_Tp  __i 
) volatile
inlinenoexcept

Definition at line 187 of file ordered_atomic.hpp.

◆ fetch_add() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_add ( _Tp  __i)
inlinenoexcept

Definition at line 191 of file ordered_atomic.hpp.

◆ fetch_add() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_add ( _Tp  __i) volatile
inlinenoexcept

Definition at line 195 of file ordered_atomic.hpp.

◆ fetch_sub() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_sub ( _Tp  __i)
inlinenoexcept

Definition at line 199 of file ordered_atomic.hpp.

◆ fetch_sub() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_sub ( _Tp  __i) volatile
inlinenoexcept

Definition at line 203 of file ordered_atomic.hpp.

◆ fetch_and() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_and ( _Tp  __i)
inlinenoexcept

Definition at line 207 of file ordered_atomic.hpp.

◆ fetch_and() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_and ( _Tp  __i) volatile
inlinenoexcept

Definition at line 211 of file ordered_atomic.hpp.

◆ fetch_or() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_or ( _Tp  __i)
inlinenoexcept

Definition at line 215 of file ordered_atomic.hpp.

◆ fetch_or() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_or ( _Tp  __i) volatile
inlinenoexcept

Definition at line 219 of file ordered_atomic.hpp.

◆ fetch_xor() [1/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_xor ( _Tp  __i)
inlinenoexcept

Definition at line 223 of file ordered_atomic.hpp.

◆ fetch_xor() [2/2]

template<typename _Tp , std::memory_order _MO>
CXX_ALWAYS_INLINE _Tp jau::ordered_atomic< _Tp, _MO >::fetch_xor ( _Tp  __i) volatile
inlinenoexcept

Definition at line 227 of file ordered_atomic.hpp.

Member Data Documentation

◆ is_always_lock_free

template<typename _Tp , std::memory_order _MO>
constexpr bool jau::ordered_atomic< _Tp, _MO >::is_always_lock_free = super::is_always_lock_free
staticconstexpr

Definition at line 148 of file ordered_atomic.hpp.


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