IComponentColumn
Type-erased column: one per ComponentID an Archetype tracks. Components are stored contiguously and matched 1:1 with the archetype's entity list by row index, so World can hold heterogeneous columns in one map without losing SoA.
- Module
- ECS
- Header
#include "ECS/Archetype.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
virtual ~IComponentColumn() = default | ~IComponentColumn |
Public functions
| Returns | Name | Description |
|---|---|---|
size_t | Size | |
size_t | EmplaceDefault | Appends a default-constructed slot for migration to fill; returns its row. |
void | PopBack | |
void | MoveAssignFromOther | Both columns must hold the same component type — the caller checks ComponentID equality. |
void | MoveAssignInternal | Swap-remove: move the last row into the removed row's slot, then PopBack. |
void* | Raw | Callers that know the type cast to T*; World hides the cast behind GetComponent<T>(). |
const void* | Raw | |
void* | Data | Start of the contiguous buffer, for iteration without a per-row indirection. |
const void* | Data | |
size_t | ElementSize | |
ComponentID | ComponentId | |
std::unique_ptr<IComponentColumn> | MakeEmptyOfSameType | A migration target needs columns for every component in the source's signature but can't know the C++ types; only the source column does. |
std::unique_ptr<IComponentColumn> | CloneDeep |
Function details
~IComponentColumn
virtual ~IComponentColumn() = defaultSize
virtual size_t Size() const = 0EmplaceDefault
virtual size_t EmplaceDefault() = 0Appends a default-constructed slot for migration to fill; returns its row.
PopBack
virtual void PopBack() = 0MoveAssignFromOther
virtual void MoveAssignFromOther(size_t dstRow, IComponentColumn& src, size_t srcRow) = 0Both columns must hold the same component type — the caller checks ComponentID equality. Used for cross-archetype migration.
MoveAssignInternal
virtual void MoveAssignInternal(size_t dstRow, size_t srcRow) = 0Swap-remove: move the last row into the removed row's slot, then PopBack.
Raw
virtual void* Raw(size_t row) = 0Callers that know the type cast to T*; World hides the cast behind GetComponent<T>().
Raw
virtual const void* Raw(size_t row) const = 0Data
virtual void* Data() = 0Start of the contiguous buffer, for iteration without a per-row indirection.
Data
virtual const void* Data() const = 0ElementSize
virtual size_t ElementSize() const = 0ComponentId
virtual ComponentID ComponentId() const = 0MakeEmptyOfSameType
virtual std::unique_ptr<IComponentColumn> MakeEmptyOfSameType() const = 0A migration target needs columns for every component in the source's signature but can't know the C++ types; only the source column does.
CloneDeep
virtual std::unique_ptr<IComponentColumn> CloneDeep() const = 0