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 (EntityId id)=0 |
|
Removes the element at the given index. More... | |
| bool | contains (EntityId id) const =0 |
|
Checks whether an element exists for the specified EntityId. More... | |
| void * | raw (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 to store heterogeneous pools and perform common operations (e.g., removal) without knowing the concrete element type.
- See Also
Definition at line 30 of file SparseSet.ixx.
Public Destructor
~SparseSetBase()
| virtual default |
Virtual destructor for proper cleanup of derived classes.
Definition at line 37 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.
Definition at line 56 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 65 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 47 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.