qb
2.0.0.0
C++17 Actor Framework
|
Efficient representation of a set of core IDs using a bitset. More...
#include <ActorId.h>
Classes | |
class | iterator |
Iterator for traversing set bits in a CoreIdBitSet. More... |
Public Member Functions | |
CoreIdBitSet ()=default | |
Default constructor - creates an empty set. | |
CoreIdBitSet (const qb::unordered_set< CoreId > &coreIds) | |
Constructor from a set of core IDs. | |
CoreIdBitSet (std::initializer_list< CoreId > ids) | |
Constructor from an initializer list. | |
const std::bitset< MaxCores > & | bits () const noexcept |
Get the raw bitset. | |
bool | contains (CoreId id) const noexcept |
Check if a core ID is in the set. | |
void | insert (CoreId id) noexcept |
Add a core ID to the set. | |
void | emplace (CoreId id) noexcept |
Add a core ID to the set (emplace version) | |
void | remove (CoreId id) noexcept |
Remove a core ID from the set. | |
void | clear () noexcept |
Clear all core IDs from the set. | |
bool | empty () const noexcept |
Check if the set is empty. | |
size_t | size () const noexcept |
Get the number of core IDs in the set. | |
std::vector< CoreId > | to_vector () const |
Convert the set to a vector of core IDs. | |
qb::unordered_set< CoreId > | to_unordered_set () const |
Get an unordered_set of the core IDs. | |
qb::unordered_set< CoreId > | raw () const |
Get a reference to the raw set for internal use. | |
iterator | begin () const |
Get an iterator to the beginning of the set. | |
iterator | end () const |
Get an iterator to the end of the set. |
Efficient representation of a set of core IDs using a bitset.
This class provides bitset-based storage for core IDs, which is more memory efficient and provides faster set operations than unordered_set.
|
inlinenodiscardnoexcept |
Get the raw bitset.
|
inlinenodiscardnoexcept |
Check if a core ID is in the set.
id | Core ID to check |
|
inlinenoexcept |
Add a core ID to the set.
id | Core ID to add |
|
inlinenoexcept |
Add a core ID to the set (emplace version)
id | Core ID to add |
|
inlinenoexcept |
Remove a core ID from the set.
id | Core ID to remove |
|
inlinenodiscardnoexcept |
Check if the set is empty.
|
inlinenodiscardnoexcept |
Get the number of core IDs in the set.
|
inlinenodiscard |
Convert the set to a vector of core IDs.
|
inlinenodiscard |
Get an unordered_set of the core IDs.
|
inlinenodiscard |
Get a reference to the raw set for internal use.
|
inlinenodiscard |
Get an iterator to the beginning of the set.
|
inlinenodiscard |
Get an iterator to the end of the set.