|
| constexpr | Bitmask () noexcept |
| | Empty mask (static_cast<E>(0)).
|
| |
| constexpr | Bitmask (E value) noexcept |
| | Mask from a single enumerator (or already combined value).
|
| |
| constexpr | Bitmask (const Bitmask &other) noexcept=default |
| | Copy constructor.
|
| |
| constexpr | Bitmask (Bitmask &&other) noexcept=default |
| | Move constructor.
|
| |
| virtual constexpr | ~Bitmask () noexcept=default |
| | Destructor.
|
| |
| constexpr Bitmask & | operator= (const Bitmask &other) noexcept=default |
| | Copy assignment.
|
| |
| constexpr Bitmask & | operator= (Bitmask &&other) noexcept=default |
| | Move assignment.
|
| |
| constexpr bool | operator== (const Bitmask &other) const noexcept |
| | Equality.
|
| |
| constexpr bool | operator!= (const Bitmask &other) const noexcept |
| | Inequality.
|
| |
| constexpr Derived | operator| (const Bitmask &other) const noexcept |
| | Bitwise OR; returns Derived.
|
| |
| constexpr Derived | operator& (const Bitmask &other) const noexcept |
| | Bitwise AND; returns Derived.
|
| |
| constexpr Derived | operator^ (const Bitmask &other) const noexcept |
| | Bitwise XOR; returns Derived.
|
| |
| constexpr Derived | operator~ () const noexcept |
| | Bitwise NOT; returns Derived.
|
| |
| constexpr Bitmask & | operator|= (const Bitmask &other) noexcept |
| | OR-assign.
|
| |
| constexpr Bitmask & | operator&= (const Bitmask &other) noexcept |
| | AND-assign.
|
| |
| constexpr Bitmask & | operator^= (const Bitmask &other) noexcept |
| | XOR-assign.
|
| |
| constexpr void | Add (E value) noexcept |
| | Sets every bit in value.
|
| |
| constexpr void | Remove (E value) noexcept |
| | Clears every bit in value.
|
| |
| constexpr E | Value () const noexcept |
| | Stored enumerators.
|
| |
| constexpr bool | Has (E value) const noexcept |
| | true when every bit in value is set.
|
| |
| constexpr bool | Has (const Bitmask &other) const noexcept |
| | true when every bit in other is set.
|
| |
| constexpr bool | HasAny (E value) const noexcept |
| | true when any bit in value is set.
|
| |
| constexpr bool | HasAny (const Bitmask &other) const noexcept |
| | true when any bit in other is set.
|
| |
| constexpr bool | HasNone (E value) const noexcept |
| | true when no bit in value is set.
|
| |
| constexpr bool | HasNone (const Bitmask &other) const noexcept |
| | true when no bit in other is set.
|
| |
template<typename Derived, Type::UnsignedEnum E>
class StormByte::Bitmask< Derived, E >
CRTP wrapper that stores an unsigned enum as a flag set.
- Template Parameters
-
| Derived | Concrete bitmask type. |
| E | Flag enumeration (Type::UnsignedEnum). |
enum class MyFlags : uint8_t { FlagA = 0x01, FlagB = 0x02 };
class MyBitmask :
public Bitmask<MyBitmask, MyFlags> {
public:
using Bitmask<MyBitmask, MyFlags>::Bitmask;
};
MyBitmask mask(MyFlags::FlagA);
mask |= MyBitmask(MyFlags::FlagB);
CRTP wrapper that stores an unsigned enum as a flag set.
Definition bitmask.hxx:95