![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Dynamically sized bit set. More...
#include <dbitset.h>
Public Types | |
| using | iter = const_iterator< dbitset > |
| Forward iterator over set bit indices. | |
| using | iter_inv = const_iterator_inverse< dbitset > |
| Forward iterator over unset bit indices. | |
| using | iter_rev = const_reverse_iterator< dbitset > |
| Reverse iterator over set bit indices. | |
| using | iter_rev_inv = const_reverse_inverse_iterator< dbitset > |
| Reverse iterator over unset bit indices. | |
Public Member Functions | |
| dbitset () | |
| Constructs a bit set with capacity for at least 128 bits and an initial size of one bit. | |
| dbitset (uint32_t reserveBits) | |
| Constructs a bit set with requested initial capacity and a size of one bit. | |
| dbitset (const dbitset &other) | |
| Copy-constructs a bit set. | |
| dbitset & | operator= (const dbitset &other) |
| Copy-assigns a bit set. | |
| dbitset (dbitset &&other) noexcept | |
| Move-constructs a bit set and leaves the source empty. | |
| dbitset & | operator= (dbitset &&other) noexcept |
| Move-assigns a bit set and leaves the source empty. | |
| void | reserve (uint32_t bitsWanted) |
| Reserves storage without changing the current bit count. | |
| void | resize (uint32_t bitsWanted) |
| Changes the number of addressable bits. | |
| iter | begin () const |
| Returns an iterator to the first set bit. | |
| iter | end () const |
| Returns the forward set-bit sentinel. | |
| iter_rev | rbegin () const |
| Returns an iterator to the last set bit. | |
| iter_rev | rend () const |
| Returns the reverse set-bit sentinel. | |
| iter_inv | ibegin () const |
| Returns an iterator to the first unset bit. | |
| iter_inv | iend () const |
| Returns the forward unset-bit sentinel. | |
| iter_rev_inv | ribegin () const |
| Returns an iterator to the last unset bit. | |
| iter_rev_inv | riend () const |
| Returns the reverse unset-bit sentinel. | |
| GAIA_NODISCARD bool | operator[] (uint32_t pos) const |
| Tests a bit. | |
| GAIA_NODISCARD bool | operator== (const dbitset &other) const |
| Compares two bit sets for equality. | |
| GAIA_NODISCARD bool | operator!= (const dbitset &other) const |
| Compares two bit sets for inequality. | |
| void | set () |
| Sets all bits. | |
| void | set (uint32_t pos, bool value=true) |
| Sets one bit, growing the bit set when needed. | |
| void | flip () |
| Flips all bits. | |
| void | flip (uint32_t pos) |
| Flips one bit. | |
| dbitset & | flip (uint32_t bitFrom, uint32_t bitTo) |
| Flips an inclusive range of bits. | |
| void | reset () |
| Unsets all bits. | |
| void | reset (uint32_t pos) |
| Unsets one bit. | |
| GAIA_NODISCARD bool | test (uint32_t pos) const |
| Returns the value of one bit. | |
| GAIA_NODISCARD bool | all () const |
| Checks if all bits are set. | |
| GAIA_NODISCARD bool | any () const |
| Checks if any bit is set. | |
| GAIA_NODISCARD bool | none () const |
| Checks if all bits are reset. | |
| GAIA_NODISCARD uint32_t | count () const |
| Returns the number of set bits. | |
| GAIA_NODISCARD constexpr uint32_t | size () const |
| Returns the number of bits the dbitset holds. | |
| GAIA_NODISCARD constexpr uint32_t | capacity () const |
| Returns the number of bits the dbitset can hold. | |
Dynamically sized bit set.
| Allocator | Allocator adaptor used for backing-word storage. |
|
inline |
Constructs a bit set with requested initial capacity and a size of one bit.
| reserveBits | Minimum requested capacity in bits. |
|
inline |
Copy-constructs a bit set.
| other | Bit set to copy. |
|
inlinenoexcept |
Move-constructs a bit set and leaves the source empty.
| other | Bit set whose storage is transferred. |
|
inline |
Checks if all bits are set.
|
inline |
Checks if any bit is set.
|
inline |
Returns an iterator to the first set bit.
|
inlineconstexpr |
Returns the number of bits the dbitset can hold.
|
inline |
Returns the number of set bits.
|
inline |
Returns the forward set-bit sentinel.
|
inline |
Flips an inclusive range of bits.
| bitFrom | First bit position to flip. |
| bitTo | Last bit position to flip, inclusive. |
|
inline |
Flips one bit.
| pos | Zero-based bit position, which must be less than size(). |
|
inline |
Returns an iterator to the first unset bit.
|
inline |
Returns the forward unset-bit sentinel.
|
inline |
Checks if all bits are reset.
|
inline |
Compares two bit sets for inequality.
| other | Bit set to compare with. |
|
inline |
Copy-assigns a bit set.
| other | Bit set to copy. |
|
inlinenoexcept |
Move-assigns a bit set and leaves the source empty.
| other | Bit set whose storage is transferred. |
|
inline |
Compares two bit sets for equality.
| other | Bit set to compare with. |
|
inline |
Tests a bit.
| pos | Zero-based bit position, which must be less than size(). |
|
inline |
Returns an iterator to the last set bit.
|
inline |
Returns the reverse set-bit sentinel.
|
inline |
Reserves storage without changing the current bit count.
| bitsWanted | Minimum requested capacity in bits. |
|
inline |
Unsets one bit.
| pos | Zero-based bit position, which must be less than size(). |
|
inline |
Changes the number of addressable bits.
| bitsWanted | Requested size in bits. Values below one are clamped to one. |
|
inline |
Returns an iterator to the last unset bit.
|
inline |
Returns the reverse unset-bit sentinel.
|
inline |
Sets one bit, growing the bit set when needed.
| pos | Zero-based bit position. |
| value | Value assigned to the bit. |
|
inlineconstexpr |
Returns the number of bits the dbitset holds.
|
inline |
Returns the value of one bit.
| pos | Zero-based bit position, which must be less than size(). |