userver: utils::AtomicFlags< Enum > Class Template Reference
Loading...
Searching...
No Matches
utils::AtomicFlags< Enum > Class Template Reference

#include <userver/utils/flags.hpp>

Detailed Description

template<typename Enum>
class utils::AtomicFlags< Enum >

Wrapper to extend enum with atomic flags interface.

Definition at line 66 of file flags.hpp.

Public Types

using ValueType = std::underlying_type_t<Enum>
 

Public Member Functions

constexpr AtomicFlags (Enum)
 
constexpr AtomicFlags (std::initializer_list< Enum >)
 
 operator bool () const
 
 operator Flags< Enum > () const
 
Flags< Enum > Load (std::memory_order=std::memory_order_seq_cst) const
 
AtomicFlagsoperator= (Flags< Enum >)
 
AtomicFlagsStore (Flags< Enum >, std::memory_order=std::memory_order_seq_cst)
 
Flags< Enum > Exchange (Flags< Enum >)
 
AtomicFlagsoperator|= (Flags< Enum >)
 
AtomicFlagsoperator&= (Flags< Enum >)
 
AtomicFlagsClear (Flags< Enum >)
 
Flags< Enum > FetchOr (Flags< Enum >, std::memory_order=std::memory_order_seq_cst)
 
Flags< Enum > FetchAnd (Flags< Enum >, std::memory_order=std::memory_order_seq_cst)
 
Flags< Enum > FetchClear (Flags< Enum >, std::memory_order=std::memory_order_seq_cst)
 
bool CompareExchangeWeak (Flags< Enum > &expected, Flags< Enum > desired, std::memory_order order=std::memory_order_seq_cst)
 
bool CompareExchangeStrong (Flags< Enum > &expected, Flags< Enum > desired, std::memory_order order=std::memory_order_seq_cst)
 
bool CompareExchangeWeak (Flags< Enum > &expected, Flags< Enum > desired, std::memory_order success, std::memory_order failure)
 
bool CompareExchangeStrong (Flags< Enum > &expected, Flags< Enum > desired, std::memory_order success, std::memory_order failure)
 
Flags< Enum > operator| (Flags< Enum >) const
 
Flags< Enum > operator& (Flags< Enum >) const
 
bool operator== (Flags< Enum >) const
 
bool operator!= (Flags< Enum >) const
 
ValueType GetValue ()
 

Member Typedef Documentation

◆ ValueType

template<typename Enum >
using utils::AtomicFlags< Enum >::ValueType = std::underlying_type_t<Enum>

Definition at line 68 of file flags.hpp.

Constructor & Destructor Documentation

◆ AtomicFlags() [1/3]

template<typename Enum >
constexpr utils::AtomicFlags< Enum >::AtomicFlags ( )
inlineconstexpr

Definition at line 70 of file flags.hpp.

◆ AtomicFlags() [2/3]

template<typename Enum >
constexpr utils::AtomicFlags< Enum >::AtomicFlags ( Enum value)
explicitconstexpr

Definition at line 214 of file flags.hpp.

◆ AtomicFlags() [3/3]

template<typename Enum >
constexpr utils::AtomicFlags< Enum >::AtomicFlags ( std::initializer_list< Enum > values)
constexpr

Definition at line 218 of file flags.hpp.

Member Function Documentation

◆ Clear()

template<typename Enum >
AtomicFlags< Enum > & utils::AtomicFlags< Enum >::Clear ( Flags< Enum > flags)

Definition at line 267 of file flags.hpp.

◆ CompareExchangeStrong() [1/2]

template<typename Enum >
bool utils::AtomicFlags< Enum >::CompareExchangeStrong ( Flags< Enum > & expected,
Flags< Enum > desired,
std::memory_order order = std::memory_order_seq_cst )

Definition at line 302 of file flags.hpp.

◆ CompareExchangeStrong() [2/2]

template<typename Enum >
bool utils::AtomicFlags< Enum >::CompareExchangeStrong ( Flags< Enum > & expected,
Flags< Enum > desired,
std::memory_order success,
std::memory_order failure )

Definition at line 325 of file flags.hpp.

◆ CompareExchangeWeak() [1/2]

template<typename Enum >
bool utils::AtomicFlags< Enum >::CompareExchangeWeak ( Flags< Enum > & expected,
Flags< Enum > desired,
std::memory_order order = std::memory_order_seq_cst )

Definition at line 291 of file flags.hpp.

◆ CompareExchangeWeak() [2/2]

template<typename Enum >
bool utils::AtomicFlags< Enum >::CompareExchangeWeak ( Flags< Enum > & expected,
Flags< Enum > desired,
std::memory_order success,
std::memory_order failure )

Definition at line 313 of file flags.hpp.

◆ Exchange()

template<typename Enum >
Flags< Enum > utils::AtomicFlags< Enum >::Exchange ( Flags< Enum > flags)

Definition at line 250 of file flags.hpp.

◆ FetchAnd()

template<typename Enum >
Flags< Enum > utils::AtomicFlags< Enum >::FetchAnd ( Flags< Enum > rhs,
std::memory_order memory_order = std::memory_order_seq_cst )

Definition at line 279 of file flags.hpp.

◆ FetchClear()

template<typename Enum >
Flags< Enum > utils::AtomicFlags< Enum >::FetchClear ( Flags< Enum > flags,
std::memory_order memory_order = std::memory_order_seq_cst )

Definition at line 285 of file flags.hpp.

◆ FetchOr()

template<typename Enum >
Flags< Enum > utils::AtomicFlags< Enum >::FetchOr ( Flags< Enum > rhs,
std::memory_order memory_order = std::memory_order_seq_cst )

Definition at line 273 of file flags.hpp.

◆ GetValue()

template<typename Enum >
AtomicFlags< Enum >::ValueType utils::AtomicFlags< Enum >::GetValue ( )

Definition at line 357 of file flags.hpp.

◆ Load()

template<typename Enum >
Flags< Enum > utils::AtomicFlags< Enum >::Load ( std::memory_order order = std::memory_order_seq_cst) const

Definition at line 232 of file flags.hpp.

◆ operator bool()

template<typename Enum >
utils::AtomicFlags< Enum >::operator bool ( ) const
explicit

Definition at line 222 of file flags.hpp.

◆ operator Flags< Enum >()

template<typename Enum >
utils::AtomicFlags< Enum >::operator Flags< Enum > ( ) const

Definition at line 227 of file flags.hpp.

◆ operator!=()

template<typename Enum >
bool utils::AtomicFlags< Enum >::operator!= ( Flags< Enum > rhs) const

Definition at line 352 of file flags.hpp.

◆ operator&()

template<typename Enum >
Flags< Enum > utils::AtomicFlags< Enum >::operator& ( Flags< Enum > rhs) const

Definition at line 342 of file flags.hpp.

◆ operator&=()

template<typename Enum >
AtomicFlags< Enum > & utils::AtomicFlags< Enum >::operator&= ( Flags< Enum > rhs)

Definition at line 261 of file flags.hpp.

◆ operator=()

template<typename Enum >
AtomicFlags< Enum > & utils::AtomicFlags< Enum >::operator= ( Flags< Enum > rhs)

Definition at line 237 of file flags.hpp.

◆ operator==()

template<typename Enum >
bool utils::AtomicFlags< Enum >::operator== ( Flags< Enum > rhs) const

Definition at line 347 of file flags.hpp.

◆ operator|()

template<typename Enum >
Flags< Enum > utils::AtomicFlags< Enum >::operator| ( Flags< Enum > rhs) const

Definition at line 337 of file flags.hpp.

◆ operator|=()

template<typename Enum >
AtomicFlags< Enum > & utils::AtomicFlags< Enum >::operator|= ( Flags< Enum > rhs)

Definition at line 255 of file flags.hpp.

◆ Store()

template<typename Enum >
AtomicFlags< Enum > & utils::AtomicFlags< Enum >::Store ( Flags< Enum > rhs,
std::memory_order order = std::memory_order_seq_cst )

Definition at line 243 of file flags.hpp.


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