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

#include <userver/utils/flags.hpp>

Detailed Description

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

Wrapper to extend enum with flags interface.

Definition at line 21 of file flags.hpp.

Public Types

using ValueType = std::underlying_type_t<Enum>
 

Public Member Functions

constexpr Flags (Enum) noexcept
 
constexpr Flags (std::initializer_list< Enum >) noexcept
 
constexpr operator bool () const
 
constexpr Flagsoperator|= (Flags)
 
constexpr Flagsoperator&= (Flags)
 
constexpr FlagsClear (Flags)
 
constexpr Flags operator| (Flags) const
 
constexpr Flags operator& (Flags) const
 
constexpr bool operator== (Flags) const
 
constexpr bool operator!= (Flags) const
 
constexpr ValueType GetValue () const
 
constexpr void SetValue (ValueType value)
 

Member Typedef Documentation

◆ ValueType

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

Definition at line 23 of file flags.hpp.

Constructor & Destructor Documentation

◆ Flags() [1/3]

template<typename Enum >
constexpr utils::Flags< Enum >::Flags ( )
inlineconstexprnoexcept

Definition at line 25 of file flags.hpp.

◆ Flags() [2/3]

template<typename Enum >
constexpr utils::Flags< Enum >::Flags ( Enum value)
constexprnoexcept

Definition at line 136 of file flags.hpp.

◆ Flags() [3/3]

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

Definition at line 139 of file flags.hpp.

Member Function Documentation

◆ Clear()

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

Definition at line 163 of file flags.hpp.

◆ GetValue()

template<typename Enum >
constexpr Flags< Enum >::ValueType utils::Flags< Enum >::GetValue ( ) const
constexpr

Definition at line 189 of file flags.hpp.

◆ operator bool()

template<typename Enum >
constexpr utils::Flags< Enum >::operator bool ( ) const
explicitconstexpr

Definition at line 146 of file flags.hpp.

◆ operator!=()

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

Definition at line 184 of file flags.hpp.

◆ operator&()

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

Definition at line 174 of file flags.hpp.

◆ operator&=()

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

Definition at line 157 of file flags.hpp.

◆ operator==()

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

Definition at line 179 of file flags.hpp.

◆ operator|()

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

Definition at line 169 of file flags.hpp.

◆ operator|=()

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

Definition at line 151 of file flags.hpp.

◆ SetValue()

template<typename Enum >
constexpr void utils::Flags< Enum >::SetValue ( ValueType value)
constexpr

Definition at line 194 of file flags.hpp.

Friends And Related Symbol Documentation

◆ AtomicFlags< Enum >

template<typename Enum >
friend class AtomicFlags< Enum >
friend

Definition at line 42 of file flags.hpp.


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