#include <DynamicBitSet.hpp>
Public Member Functions | |
| DynamicBitSet (size_t BitCount) | |
| DynamicBitSet (const DynamicBitSet &Other)=default | |
| Creates an independent copy of Other. | |
| DynamicBitSet (DynamicBitSet &&Other) noexcept | |
| Moves the contents of Other and leaves it as an empty set. | |
| DynamicBitSet & | operator= (const DynamicBitSet &Other) |
| Replaces this set with an independent copy of Other. | |
| DynamicBitSet & | operator= (DynamicBitSet &&Other) noexcept |
| size_t | GetSize () const noexcept |
| Returns the number of addressable bits in the set. | |
| void | Resize (size_t BitCount) |
| bool | Test (size_t BitIndex) const noexcept |
| void | Set (size_t BitIndex, bool Value=true) noexcept |
| void | Reset (size_t BitIndex) noexcept |
| void | ResetAll () noexcept |
| Resets every bit in the set. | |
| template<typename HandlerType> | |
| void | ForEachSetBit (HandlerType &&Handler) const |
Runtime-sized set of bits.
The initial number of bits is specified at construction and may subsequently be changed with Resize(). All bits are initially reset, as are bits added by Resize(). The class is not thread-safe; concurrent access requires external synchronization if any thread may modify the set. Copies are independent; moving leaves the source as a valid empty set. Self-move assignment is a no-op.
|
inlineexplicit |
Creates a set containing BitCount reset bits.
| [in] | BitCount | - Number of addressable bits in the set. May be zero. |
|
inline |
Invokes Handler for every set bit in ascending index order.
Handler must be callable with one size_t argument containing the bit index. Modifying this bit set from Handler is not supported.
| [in] | Handler | - Function object invoked once for every set bit. |
|
inlinenoexcept |
Replaces this set with the contents of Other and leaves it empty. Self-move assignment is a no-op.
|
inlinenoexcept |
Resets the specified bit.
| [in] | BitIndex | - Bit index in the range [0, GetSize()). |
|
inline |
Changes the number of addressable bits in the set.
Existing bits in the retained range preserve their values. Newly added bits are reset, and bits removed by shrinking are discarded.
| [in] | BitCount | - New number of addressable bits. May be zero. |
|
inlinenoexcept |
Assigns a value to the specified bit.
| [in] | BitIndex | - Bit index in the range [0, GetSize()). |
| [in] | Value | - New bit value. The default value is true. |
|
inlinenoexcept |
Tests whether the specified bit is set.
| [in] | BitIndex | - Bit index in the range [0, GetSize()). |