Skip to main content

SparseSetBase Class

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

Declaration

class helios::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 (EntityId id)=0

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

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

SparseSet

Definition at line 30 of file SparseSet.ixx.

Public Destructor

~SparseSetBase()

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

Virtual destructor for proper cleanup of derived classes.

Definition at line 37 of file SparseSet.ixx.

Public Member Functions

contains()

virtual bool helios::ecs::SparseSetBase::contains (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.

Definition at line 56 of file SparseSet.ixx.

raw()

virtual void * helios::ecs::SparseSetBase::raw (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 65 of file SparseSet.ixx.

remove()

virtual bool helios::ecs::SparseSetBase::remove (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 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.