IOLink IOL_v1.8.0_release
|
Template class to handle a flags system from an enum. More...
#include <iolink/FlagSet.h>
Public Member Functions | |
FlagSet () | |
Initialize with no flags set. | |
FlagSet (uint64_t value) | |
Initialize from a value. | |
FlagSet (EnumType flags) | |
Initialize from a value from the wrapped enum type. | |
FlagSet (const FlagSet &other)=default | |
FlagSet & | operator= (const FlagSet &other)=default |
FlagSet (FlagSet &&other) noexcept=default | |
FlagSet & | operator= (FlagSet &&other) noexcept=default |
uint64_t | value () const |
Return the internal value. | |
bool | has (FlagSet flags) const |
Check if a given set of flags is true. | |
void | add (FlagSet flags) |
Set the given set of flags to true. | |
void | remove (FlagSet flags) |
Set the given set of flags to false. | |
bool | operator== (FlagSet flags) const |
bool | operator!= (FlagSet flags) const |
FlagSet & | operator|= (FlagSet flags) |
FlagSet & | operator&= (FlagSet flags) |
FlagSet & | operator^= (FlagSet flags) |
FlagSet | operator| (FlagSet flags) |
FlagSet | operator& (FlagSet flags) |
FlagSet | operator^ (FlagSet flags) |
Template class to handle a flags system from an enum.
The wrapped enum must have the values set to follow a flags logic, flags values must be multiples of two. The enum can also have shorcut values that combines multiple basic values.
Setup:
EnumType | The enum to wrap. |