BitSet.h
Go to the documentation of this file.
48 static_assert(std::is_enum<E>::value || (std::is_integral<E>::value && std::is_unsigned<E>::value),
86 template <typename S2> constexpr BitSet(const BitSet<S2, E>& bitset) : bitSetValue(bitset.value())
378 inline constexpr BitSet<S, E, size_> operator&(const BitSet<S, E, size_>& x, const BitSet<S, E, size_>& y)
396 inline constexpr BitSet<S, E, size_> operator+(const BitSet<S, E, size_>& x, const BitSet<S, E, size_>& y)
402 inline constexpr BitSet<S, E, size_> operator-(const BitSet<S, E, size_>& x, const BitSet<S, E, size_>& y)
442 typename std::enable_if<std::is_enum<E>::value && !std::is_convertible<E, int>::value, BitSet<uint32_t, E>>::type
450 typename std::enable_if<std::is_enum<E>::value && !std::is_convertible<E, int>::value, BitSet<uint32_t, E>>::type
456 template <typename T> typename std::enable_if<std::is_integral<T>::value, String>::type toString(T value)
std::enable_if< std::is_integral< T >::value, String >::type toString(T value)
Definition: BitSet.h:456
bool operator==(E e) const
Determine if set consists of only the one given element.
Definition: BitSet.h:332
constexpr BitSet< S, E, size_ > operator &(const BitSet< S, E, size_ > &x, const BitSet< S, E, size_ > &y)
Definition: BitSet.h:378
BitSet & operator+=(const BitSet &rhs)
Union: Add elements to set.
Definition: BitSet.h:183
constexpr BitSet(E e)
Construct set containing a single value.
Definition: BitSet.h:102
BitSet & reset(E e)
Clear the state of the given bit (i.e. remove it from the set)
Definition: BitSet.h:324
static constexpr size_t size()
Get the number of possible elements in the set.
Definition: BitSet.h:133
static constexpr S bitVal(E e)
Get the bitmask corresponding to a given value.
Definition: BitSet.h:149
constexpr BitSet< S, E, size_ > operator^(BitSet< S, E, size_ > x, BitSet< S, E, size_ > y)
Definition: BitSet.h:420
BitSet & operator|=(const BitSet &rhs)
Union: Add elements to set.
Definition: BitSet.h:210
static constexpr BitSet domain()
Get the set of all possible values.
Definition: BitSet.h:141
size_t length(void) const
Obtain the String length in characters, excluding NUL terminator.
Definition: WString.h:237
bool operator==(const BitSet &other) const
Compare this set with another for equality.
Definition: BitSet.h:109
Definition: BitSet.h:53
BitSet & operator^=(const BitSet &rhs)
XOR - toggle state of bits using another set.
Definition: BitSet.h:219
constexpr BitSet< S, E, size_ > operator-(const BitSet< S, E, size_ > &x, const BitSet< S, E, size_ > &y)
Definition: BitSet.h:402
constexpr BitSet< S, E, size_ > operator+(const BitSet< S, E, size_ > &x, const BitSet< S, E, size_ > &y)
Definition: BitSet.h:396
size_t count() const
Get the number of elements in the set, i.e. bits set to 1.
Definition: BitSet.h:175
BitSet & operator-=(const BitSet &rhs)
Remove elements from set.
Definition: BitSet.h:192
constexpr BitSet< S, E, size_ > operator|(BitSet< S, E, size_ > x, BitSet< S, E, size_ > y)
Definition: BitSet.h:384
BitSet & operator &=(const BitSet &rhs)
Intersection: Leave only elements common to both sets.
Definition: BitSet.h:201
bool operator!=(const BitSet &other) const
Compare this set with another for inequality.
Definition: BitSet.h:117
constexpr BitSet operator~() const
Obtain a set containing all elements not in this one.
Definition: BitSet.h:125
bool test(E e) const
Test to see if given element is in the set.
Definition: BitSet.h:228
constexpr BitSet(const BitSet< S2, E > &bitset)
Copy constructor.
Definition: BitSet.h:86
bool any(const BitSet &other) const
Determine if set contains any values from another set i.e. intersection != [].
Definition: BitSet.h:267