41template <
typename EnumType>
65 : m_value(static_cast<uint64_t>(flags))
78 uint64_t
value()
const {
return m_value; }
83 bool has(
FlagSet flags)
const {
return (m_value & flags.m_value) == flags.m_value; }
95 bool operator==(
FlagSet flags)
const {
return m_value == flags.m_value; }
97 bool operator!=(
FlagSet flags)
const {
return m_value != flags.m_value; }
105 m_value |= flags.m_value;
111 m_value &= flags.m_value;
117 m_value ^= flags.m_value;
137#define IOLINK_DEFINE_ENUM_BITWISE_OPERATORS(EnumType) \
138 inline FlagSet<EnumType> operator|(EnumType lhs, EnumType rhs) { return FlagSet<EnumType>(lhs) |= rhs; } \
139 inline FlagSet<EnumType> operator&(EnumType lhs, EnumType rhs) { return FlagSet<EnumType>(lhs) &= rhs; } \
140 inline FlagSet<EnumType> operator^(EnumType lhs, EnumType rhs) { return FlagSet<EnumType>(lhs) ^= rhs; }
Template class to handle a flags system from an enum.
Definition: FlagSet.h:43
void add(FlagSet flags)
Set the given set of flags to true.
Definition: FlagSet.h:88
FlagSet(uint64_t value)
Initialize from a value.
Definition: FlagSet.h:56
bool has(FlagSet flags) const
Check if a given set of flags is true.
Definition: FlagSet.h:83
FlagSet()
Initialize with no flags set.
Definition: FlagSet.h:48
uint64_t value() const
Return the internal value.
Definition: FlagSet.h:78
void remove(FlagSet flags)
Set the given set of flags to false.
Definition: FlagSet.h:93
FlagSet(EnumType flags)
Initialize from a value from the wrapped enum type.
Definition: FlagSet.h:64
All IOLink symbols are enclosed in this namespace.
Definition: ArrayX.h:8