Set of enumerators.
More...
#include "C16/Flags.hpp"
template<typename Enumeration>
class C16::Flags< Enumeration >
Set of enumerators.
- Template Parameters
-
Enumeration | Type of the enumeration of the flags |
|
static const Flags< Enumeration > | EMPTY = Flags<Enumeration>() |
| Empty flags. More...
|
|
static constexpr Enumeration | NOTHING = static_cast<Enumeration>(0) |
| Valueless enumerator. More...
|
|
|
constexpr | Flags () |
| Constructs empty flags. More...
|
|
constexpr | Flags (const std::initializer_list< Enumeration > &enumerators) |
| Constructs flags by means of enumerators. More...
|
|
constexpr bool | contains (Enumeration enumerator) const |
| Gets if the flags contain an enumerator. More...
|
|
constexpr value_type | value () const |
| Gets the value of the flags. More...
|
|
void | add (Enumeration enumerator) |
| Adds a single enumerator to the flags. More...
|
|
void | add (const std::initializer_list< Enumeration > &enumerators) |
| Adds multiple enumerators to the flags. More...
|
|
void | remove (Enumeration enumerator) |
| Removes a single enumerator from the flags. More...
|
|
void | remove (const std::initializer_list< Enumeration > &enumerators) |
| Removes multiple enumerators from the flags. More...
|
|
void | clear () |
| Empties the flags. More...
|
|
void | set (Enumeration enumerator, bool set) |
| Sets a single enumerator of the flags. More...
|
|
void | set (const std::initializer_list< Enumeration > &enumerators, bool set) |
| Sets multiple enumerators of the flags. More...
|
|
void | toggle (Enumeration enumerator) |
| Toggles a single enumerator of the flags. More...
|
|
void | toggle (const std::initializer_list< Enumeration > &enumerators) |
| Toggles multiple enumerators of the flags. More...
|
|
◆ EMPTY
template<typename Enumeration >
◆ NOTHING
template<typename Enumeration >
constexpr Enumeration C16::Flags< Enumeration >::NOTHING = static_cast<Enumeration>(0) |
|
staticconstexpr |
◆ Flags() [1/2]
template<typename Enumeration >
◆ Flags() [2/2]
template<typename Enumeration >
constexpr C16::Flags< Enumeration >::Flags |
( |
const std::initializer_list< Enumeration > & |
enumerators | ) |
|
|
inlineconstexpr |
Constructs flags by means of enumerators.
- Parameters
-
◆ contains()
template<typename Enumeration >
constexpr bool C16::Flags< Enumeration >::contains |
( |
Enumeration |
enumerator | ) |
const |
|
inlineconstexpr |
◆ value()
template<typename Enumeration >
constexpr value_type C16::Flags< Enumeration >::value |
( |
| ) |
const |
|
inlineconstexpr |
◆ add() [1/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::add |
( |
Enumeration |
enumerator | ) |
|
|
inline |
◆ add() [2/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::add |
( |
const std::initializer_list< Enumeration > & |
enumerators | ) |
|
|
inline |
◆ remove() [1/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::remove |
( |
Enumeration |
enumerator | ) |
|
|
inline |
◆ remove() [2/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::remove |
( |
const std::initializer_list< Enumeration > & |
enumerators | ) |
|
|
inline |
◆ clear()
template<typename Enumeration >
◆ set() [1/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::set |
( |
Enumeration |
enumerator, |
|
|
bool |
set |
|
) |
| |
|
inline |
◆ set() [2/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::set |
( |
const std::initializer_list< Enumeration > & |
enumerators, |
|
|
bool |
set |
|
) |
| |
|
inline |
◆ toggle() [1/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::toggle |
( |
Enumeration |
enumerator | ) |
|
|
inline |
◆ toggle() [2/2]
template<typename Enumeration >
void C16::Flags< Enumeration >::toggle |
( |
const std::initializer_list< Enumeration > & |
enumerators | ) |
|
|
inline |