A class representing a set of bits, offering functionality to manipulate and query individual bits.
More...
|
| bitSet (u_integer size, ALLOC allocator=ALLOC{}) |
| Constructs a bitSet with the given size.
|
|
| bitSet (const std::initializer_list< bool > &lst) |
| Constructs a bitSet from an initializer list.
|
|
| bitSet (const bitSet &other) |
| Copy constructor.
|
|
bitSet & | operator= (const bitSet &other) |
| Copy assignment operator.
|
|
| bitSet (bitSet &&other) noexcept |
| Move constructor.
|
|
bitSet & | operator= (bitSet &&other) noexcept |
| Move assignment operator.
|
|
void | swap (bitSet &other) noexcept |
| Swaps the contents of this bitSet with another.
|
|
u_integer | count () const |
| Counts the number of bits set to true.
|
|
bitSet | resize (u_integer new_size) const |
| Resizes the bitSet to the given size.
|
|
u_integer | size () const override |
| Gets the size of the bitSet.
|
|
Iterator * | begins () const override |
| Gets the iterator to the beginning of the bitSet.
|
|
Iterator * | ends () const override |
| Gets the iterator to the end of the bitSet.
|
|
bool | get (integer index) const override |
| Gets the value of a specific bit by index.
|
|
bool & | operator[] (integer index) override |
| Gets the reference of a specific bit by index.
|
|
void | set (integer index, const bool &e) override |
| Sets the value of a specific bit by index.
|
|
u_integer | indexOf (const bool &e) const override |
| Finds the index of the first occurrence of a specific value.
|
|
bitSet & | operator&= (const bitSet &other) |
| Performs a bitwise AND operation between two bitSets.
|
|
bitSet & | operator|= (const bitSet &other) |
| Performs a bitwise OR operation between two bitSets.
|
|
bitSet & | operator^= (const bitSet &other) |
| Performs a bitwise XOR operation between two bitSets.
|
|
std::string | className () const override |
| Gets the class name for the bitSet.
|
|
template<typename Callback = transform<bool>> |
void | forEach (Callback operation=Callback{})=delete |
| Deleted forEach method to prevent misuse.
|
|
virtual TYPE | getBegin () const |
| Retrieves the first element in the container.
|
|
virtual TYPE | getEnd () const |
| Retrieves the last element in the container.
|
|
virtual TYPE | operator[] (integer index) const |
| Retrieves the element at the specified index (const version).
|
|
virtual void | set (integer index, const TYPE &e)=0 |
| Sets the element at the specified index.
|
|
virtual u_integer | indexOf (const TYPE &e) const =0 |
| Finds the index of the specified element.
|
|
bool | contains (const TYPE &e) const override |
| Checks if the container contains the specified element.
|
|
bool | empty () const |
| Checks if the container is empty.
|
|
virtual | ~container ()=default |
| Destructor for the container class.
|
|
integer | compareTo (const iterationStream &other) const override |
| Compares the current iteration stream with another iteration stream.
|
|
u_integer | toHash () const noexcept override |
| Computes a hash value for the iteration stream.
|
|
std::string | className () const override |
| Returns the class name.
|
|
std::string | toString (bool enter) const override |
| Converts the iteration stream to a string representation.
|
|
| operator std::string () const |
| Explicit conversion to std::string.
|
|
| operator const char * () const |
| Explicit conversion to C-style string.
|
|
const char * | toCString (bool enter) const |
| Direct C-string access with formatting control.
|
|
template<typename TYPE > |
auto | formatString (const TYPE &t) -> std::string |
|
template<typename TYPE > |
auto | formatCString (const TYPE &t) -> const char * |
|
template<typename TYPE > |
auto | formatEnum (const TYPE &t) -> std::string |
|
template<typename TYPE > |
auto | formatString (TYPE *const &ptr) -> std::string |
|
iterAdaptor | begin () |
| Returns an iterator adapter pointing to the beginning of the container.
|
|
iterAdaptor | end () |
| Returns an iterator adapter pointing to the end sentinel of the container.
|
|
iterAdaptor | begin () const |
| Returns a const iterator adapter pointing to the beginning of the container.
|
|
iterAdaptor | end () const |
| Returns a const iterator adapter pointing to the end sentinel of the container.
|
|
iterAdaptor | first () |
| Returns an iterator adapter pointing to the first element.
|
|
iterAdaptor | last () |
| Returns an iterator adapter pointing to the last element.
|
|
iterAdaptor | first () const |
| Returns a const iterator adapter pointing to the first element.
|
|
iterAdaptor | last () const |
| Returns a const iterator adapter pointing to the last element.
|
|
template<typename Callback = transform<TYPE>>
requires Operation<Callback, TYPE> |
void | forEach (Callback operation=Callback{}) |
| Applies a given operation to each element in the iterable container.
|
|
template<typename Callback = transform<TYPE>>
requires Operation<Callback, TYPE> |
void | forEach (const Callback &operation=Callback{}) const |
| Applies a given operation to each element in the iterable container (const version).
|
|
coroutine::generator< T > | generator () const |
| Creates a coroutine generator that yields elements from this container.
|
|
template<typename Callback >
requires original::Operation<Callback, TYPE> |
auto | forEach (Callback operation) -> void |
|
template<typename Callback >
requires original::Operation<Callback, TYPE> |
auto | forEach (const Callback &operation) const -> void |
|
bool | operator== (const iterationStream< TYPE, DERIVED > &other) const |
| Checks if the current object is equal to another.
|
|
bool | operator!= (const iterationStream< TYPE, DERIVED > &other) const |
| Checks if the current object is not equal to another.
|
|
bool | operator< (const iterationStream< TYPE, DERIVED > &other) const |
| Checks if the current object is less than another.
|
|
bool | operator> (const iterationStream< TYPE, DERIVED > &other) const |
| Checks if the current object is greater than another.
|
|
bool | operator<= (const iterationStream< TYPE, DERIVED > &other) const |
| Checks if the current object is less than or equal to another.
|
|
bool | operator>= (const iterationStream< TYPE, DERIVED > &other) const |
| Checks if the current object is greater than or equal to another.
|
|
virtual | ~comparable ()=default |
| Virtual destructor for proper cleanup of derived objects.
|
|
virtual bool | equals (const iterationStream< TYPE, DERIVED > &other) const noexcept |
| Compares two objects for equality.
|
|
virtual | ~hashable ()=0 |
| Virtual destructor.
|
|
template<
typename ALLOC = allocator<bool>>
class original::bitSet< ALLOC >
A class representing a set of bits, offering functionality to manipulate and query individual bits.
- Template Parameters
-
ALLOC | Allocator type to use for memory management (default: allocator<bool>) |
The bitSet class allows efficient manipulation of individual bits using bitwise operations. It utilizes a dynamic array of 64-bit blocks to store bits and provides methods to access and modify them. Iterators are available for traversing through the bits. Memory management is handled through the specified allocator type.