FlagSet.hh
Go to the documentation of this file.
std::enable_if_t< IsEnumThatContainsSentinel< T >::value, FlagSet< T >> operator|(const T &_lhs, const T &_rhs)
Definition: FlagSet.hh:377
T any(T... args)
FlagSet operator|(const T &_val) const
Return a FlagSet with the given flag set to true.
Definition: FlagSet.hh:155
static FlagSet AllSet()
Retrurn a FlagSet with all flags set to true.
Definition: FlagSet.hh:301
FlagSet & operator&=(const FlagSet &_o) noexcept
Return a bit AND of this FlagSet and the argument.
Definition: FlagSet.hh:102
static constexpr size_t numElements
Number of elements of the bitset.
Definition: FlagSet.hh:349
FlagSet & Flip()
Set all flags to their negation.
Definition: FlagSet.hh:245
bool operator!=(const FlagSet &_o) const
Test FlagSet inequality.
Definition: FlagSet.hh:205
bool Any() const
Test whether any flag is set.
Definition: FlagSet.hh:281
FlagSet & operator|=(const FlagSet &_o) noexcept
Return a bit OR of this FlagSet and the argument.
Definition: FlagSet.hh:120
FlagSet & Set(const T &_val, bool _value=true)
Set the given flag to the specified value.
Definition: FlagSet.hh:255
FlagSet(const std::initializer_list< T > &_list)
Construct a FlagSet with the given flags set and all other unset.
Definition: FlagSet.hh:77
bool operator==(const FlagSet &_o) const
Test FlagSet equality.
Definition: FlagSet.hh:197
FlagSet operator~() const
Return a negation of this FlagSet.
Definition: FlagSet.hh:177
FlagSet & Reset(const T &_val)
Set the given flag to false.
Definition: FlagSet.hh:264
FlagSet operator|(const FlagSet &_val) const
Return a bit OR of this FlagSet and the argument.
Definition: FlagSet.hh:167
static FlagSet NoneSet()
Retrurn a FlagSet with all flags set to false.
Definition: FlagSet.hh:307
std::size_t Count() const
Return the number of flags set to true.
Definition: FlagSet.hh:222
friend std::ostream & operator<<(std::ostream &_stream, const FlagSet &_self)
Operator for outputting to std::ostream.
Definition: FlagSet.hh:332
bool All() const
Test whether all flags are set.
Definition: FlagSet.hh:288
std::size_t Size() const
Return the total number of flags represented by this FlagSet.
Definition: FlagSet.hh:214
size_t Hash() const
Compute hash of the FlagSet.
Definition: FlagSet.hh:340
constexpr bool operator[](const T &_val) const
Return whether the given flag is set.
Definition: FlagSet.hh:316
FlagSet & operator&=(const T &_val) noexcept
Return a FlagSet with only the given flag set (or even this one unset if it wasn't set in this FlagSe...
Definition: FlagSet.hh:91
FlagSet & Flip(const T &_val)
Negate the given flag.
Definition: FlagSet.hh:273
FlagSet operator&(const FlagSet &_val) const
Return a bit AND of this FlagSet and the argument.
Definition: FlagSet.hh:143
FlagSet & operator|=(const T &_val) noexcept
Set the given flag to true in this FlagSet.
Definition: FlagSet.hh:111
std::string String() const
Return a string describing this FlagSet.
Definition: FlagSet.hh:323
FlagSet operator&(const T &_val) const
Return a FlagSet with only the given flag set (or even this one unset if it wasn't set in this FlagSe...
Definition: FlagSet.hh:131
FlagSet(const T &_val)
Construct a FlagSet with the given flag set and all other unset.
Definition: FlagSet.hh:70
bool None() const
Test whether no flag is set.
Definition: FlagSet.hh:295
T count(T... args)
T flip(T... args)
Definition: Base64.hh:26
Forward declarations for the common classes.
STL namespace.
T reset(T... args)
T set(T... args)
T size(T... args)
Definition: FlagSet.hh:359
std::size_t operator()(const FlagSet< T, LastElement, ExcludeLast > &_s) const noexcept
Definition: FlagSet.hh:391
T test(T... args)
T to_string(T... args)