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