Skip to main content

SparseSetBase Class

Abstract base class for type-erased sparse set access. More...

Declaration

class helios::engine::ecs::SparseSetBase { ... }

Derived Classes

classSparseSet<T>

A generic sparse set providing O(1) insertion, lookup, and removal. More...

classSparseSet<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

boolremove (helios::engine::ecs::types::EntityId id)=0

Removes the element at the given index. More...

boolcontains (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

SparseSet

See Also

EntityManager

Definition at line 29 of file SparseSet.ixx.

Public Destructor

~SparseSetBase()

virtual helios::engine::ecs::SparseSetBase::~SparseSetBase ()
virtual default

Virtual destructor for proper cleanup of derived classes.

Definition at line 36 of file SparseSet.ixx.

Public Member Functions

contains()

virtual bool helios::engine::ecs::SparseSetBase::contains (helios::engine::ecs::types::EntityId id)
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()

virtual void * helios::engine::ecs::SparseSetBase::raw (helios::engine::ecs::types::EntityId id)
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()

virtual bool helios::engine::ecs::SparseSetBase::remove (helios::engine::ecs::types::EntityId id)

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.