Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
Grindstone::Containers::Bitset< bitCount, WordType > Class Template Reference

Public Member Functions

 Bitset (const Bitset &other)
 Bitset (Bitset &&other) noexcept
Bitset & operator= (const Bitset &other)
Bitset & operator= (Bitset &&other)
void Set ()
void Set (uint32_t bitIndex, bool value=true)
void Unset ()
void Unset (uint32_t index)
void Flip ()
void Flip (uint32_t index)
bool Test (uint32_t index) const
WordType GetWord (uint32_t index) const
bool All () const
bool Any () const
bool None () const
constexpr uint32_t GetTrueBitCount () const
constexpr uint32_t GetFalseBitCount () const
Bitset operator&= (const Bitset &other) const
Bitset operator|= (const Bitset &other) const
Bitset operator^= (const Bitset &other) const
Bitset operator& (const Bitset &other) const
Bitset operator| (const Bitset &other) const
Bitset operator^ (const Bitset &other) const
bool operator[] (uint32_t index) const
bool operator== (const Bitset &other) const
bool operator!= (const Bitset &other) const

Static Public Member Functions

static constexpr uint32_t GetBitCount ()
static constexpr uint32_t GetBitCapacity ()
static constexpr uint32_t GetWordCount ()

Static Public Attributes

static constexpr uint32_t bitsPerWord = (CHAR_BIT * sizeof(WordType))
static constexpr uint32_t wordCount = ((bitCount + bitsPerWord - 1) / bitsPerWord)
static constexpr uint32_t totalBitCount = wordCount * bitsPerWord
static constexpr uint32_t lastWordbitCount = bitCount % bitsPerWord
static constexpr uint32_t lastWordMask

Protected Attributes

WordType contents [wordCount]

Friends

Bitset operator~ (const Bitset &obj)

Member Data Documentation

◆ lastWordMask

template<uint32_t bitCount, typename WordType = uint32_t>
uint32_t Grindstone::Containers::Bitset< bitCount, WordType >::lastWordMask
staticconstexpr
Initial value:
= (lastWordbitCount == 0)
? ~0
: ((1 << lastWordbitCount) - 1)

The documentation for this class was generated from the following file:
  • /github/workspace/sources/code/Common/Containers/Bitset.hpp