Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::ecs::ComponentMetadata Struct Reference

Runtime metadata for a registered component type. More...

#include <manager.hpp>

Public Types

using InitColumnFn = void (*)(container::TypedBufferArray<>&)
 Type-erased function to initialize a column with the correct concrete type.
using MoveColumnElementFn
 Type-erased function to move one element from a source column row into the back of a target column.
using DefaultPushFn = void (*)(container::TypedBufferArray<>&)
 Type-erased function to push a default-constructed element onto a column.

Static Public Member Functions

template<ComponentTrait T>
static consteval ComponentMetadata From () noexcept
 Creates metadata for a component type.

Public Attributes

ComponentTypeIndex type_index
std::string_view name
size_t size = 0
size_t alignment = 0
ComponentStorageType storage_type = ComponentStorageType::kArchetype
bool is_tag = false
InitColumnFn init_column = nullptr
MoveColumnElementFn move_column_element = nullptr
DefaultPushFn default_push = nullptr

Detailed Description

Runtime metadata for a registered component type.

Stores runtime information required for type-erased component storage and migration between archetypes.

Definition at line 42 of file manager.hpp.

Member Typedef Documentation

◆ DefaultPushFn

Type-erased function to push a default-constructed element onto a column.

Definition at line 62 of file manager.hpp.

◆ InitColumnFn

Type-erased function to initialize a column with the correct concrete type.

Definition at line 52 of file manager.hpp.

◆ MoveColumnElementFn

Initial value:
size_t src_row)
Type-erased sequential byte storage for a single type (array variant).

Type-erased function to move one element from a source column row into the back of a target column.

Definition at line 56 of file manager.hpp.

Member Function Documentation

◆ From()

template<ComponentTrait T>
ComponentMetadata helios::ecs::ComponentMetadata::From ( )
staticnodiscardconstevalnoexcept

Creates metadata for a component type.

Template Parameters
TComponent type
Returns
Populated metadata

Definition at line 78 of file manager.hpp.

Member Data Documentation

◆ alignment

size_t helios::ecs::ComponentMetadata::alignment = 0

Definition at line 46 of file manager.hpp.

◆ default_push

DefaultPushFn helios::ecs::ComponentMetadata::default_push = nullptr

Definition at line 66 of file manager.hpp.

◆ init_column

InitColumnFn helios::ecs::ComponentMetadata::init_column = nullptr

Definition at line 64 of file manager.hpp.

◆ is_tag

bool helios::ecs::ComponentMetadata::is_tag = false

Definition at line 48 of file manager.hpp.

◆ move_column_element

MoveColumnElementFn helios::ecs::ComponentMetadata::move_column_element = nullptr

Definition at line 65 of file manager.hpp.

◆ name

std::string_view helios::ecs::ComponentMetadata::name

Definition at line 44 of file manager.hpp.

◆ size

size_t helios::ecs::ComponentMetadata::size = 0

Definition at line 45 of file manager.hpp.

◆ storage_type

ComponentStorageType helios::ecs::ComponentMetadata::storage_type = ComponentStorageType::kArchetype

Definition at line 47 of file manager.hpp.

◆ type_index

ComponentTypeIndex helios::ecs::ComponentMetadata::type_index

Definition at line 43 of file manager.hpp.