SparseSetBase Class
Abstract base class for type-erased sparse set access. More...
Declaration
Derived Classes
| class | SparseSet<T> |
|
A generic sparse set providing O(1) insertion, lookup, and removal. More... | |
| class | SparseSet<T> |
|
A generic sparse set providing O(1) insertion, lookup, and removal. More... | |
Public Destructor Index
| ~SparseSetBase ()=default | |
|
Virtual destructor for proper cleanup of derived classes. More... | |
Public Member Functions Index
| bool | remove (helios::engine::ecs::types::EntityId id)=0 |
|
Removes the element at the given index. More... | |
| bool | contains (helios::engine::ecs::types::EntityId id) const =0 |
|
Checks whether an element exists for the specified EntityId. More... | |
| void * | raw (helios::engine::ecs::types::EntityId id)=0 |
|
Returns a raw void pointer to the element at the given index. More... | |
Description
Abstract base class for type-erased sparse set access.
`SparseSetBase` provides a non-templated interface for polymorphic operations on sparse sets. This enables containers like `EntityManager` to store heterogeneous component pools and perform common operations (e.g., removal) without knowing the concrete component type.
- See Also
- See Also
Definition at line 29 of file SparseSet.ixx.
Public Destructor
~SparseSetBase()
| virtual default |
Virtual destructor for proper cleanup of derived classes.
Definition at line 36 of file SparseSet.ixx.
Public Member Functions
contains()
| nodiscard |
Checks whether an element exists for the specified EntityId.
- Parameters
-
id The EntityId to test.
- Returns
`true` if the set contains the EntityId, `false` otherwise.
Definition at line 55 of file SparseSet.ixx.
raw()
| nodiscard |
Returns a raw void pointer to the element at the given index.
- Parameters
-
id The EntityId to look up.
- Returns
Raw pointer to the element, or `nullptr` if not found.
Definition at line 64 of file SparseSet.ixx.
remove()
|
Removes the element at the given index.
- Parameters
-
id The EntityId of the element to remove.
- Returns
`true` if the element was removed, `false` if not found or removal was cancelled.
Definition at line 46 of file SparseSet.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.