Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::ComponentDesc Struct Referencefinal

Plain component registration descriptor shared by typed and runtime component paths. Typed registration produces this descriptor from detail::ComponentDesc, while runtime registration can fill it from data loaded at runtime. More...

#include <component_desc.h>

Public Types

using FuncCtor = void(void *, uint32_t)
 Component constructor callback for a contiguous range of payload slots.
 
using FuncDtor = void(void *, uint32_t)
 Component destructor callback for a contiguous range of payload slots.
 
using FuncFrom = void(void *, void *, uint32_t, uint32_t, uint32_t, uint32_t)
 Component migration callback used when copying or moving from one layout stride to another.
 
using FuncCopy = void(void *, const void *, uint32_t, uint32_t, uint32_t, uint32_t)
 Component copy callback used by typed registration and storage moves.
 
using FuncMove = void(void *, void *, uint32_t, uint32_t, uint32_t, uint32_t)
 Component move callback used by typed registration and storage moves.
 
using FuncSwap = void(void *, void *, uint32_t, uint32_t, uint32_t, uint32_t)
 Component swap callback used by storage operations that exchange payload ranges.
 
using FuncCmp = bool(const void *, const void *)
 Component equality callback for comparing two payload values.
 
using FuncSave = void(ser::serializer &, const void *, uint32_t, uint32_t, uint32_t)
 Component serializer callback for typed component save operations.
 
using FuncLoad = void(ser::serializer &, void *, uint32_t, uint32_t, uint32_t)
 Component serializer callback for typed component load operations.
 

Public Attributes

util::str_view name
 Registered component symbol.
 
uint32_t size = 0
 Component payload size in bytes.
 
uint32_t alig = 0
 Component payload alignment in bytes.
 
DataStorageType storageType = DataStorageType::Table
 Component storage mode.
 
uint32_t soa = 0
 Number of SoA elements, 0 means AoS.
 
const uint8_t * pSoaSizes = nullptr
 Per-element SoA sizes when soa is non-zero. The array must contain soa non-zero entries and their sum must not exceed size.
 
ComponentLookupHash hashLookup {}
 Optional explicit lookup hash. When empty, the symbol hash is used.
 
RuntimeTypeDesc runtimeType {}
 Runtime reflection metadata copied during registration.
 
FuncCtorfuncCtor = nullptr
 Optional constructor callback. Runtime byte-only components leave this null.
 
FuncMovefuncMoveCtor = nullptr
 Optional move-constructor callback. Runtime byte-only components leave this null.
 
FuncCopyfuncCopyCtor = nullptr
 Optional copy-constructor callback. Runtime byte-only components leave this null.
 
FuncDtorfuncDtor = nullptr
 Optional destructor callback. Runtime byte-only components leave this null.
 
FuncCopyfuncCopy = nullptr
 Optional copy-assignment callback. Runtime byte-only components leave this null.
 
FuncMovefuncMove = nullptr
 Optional move-assignment callback. Runtime byte-only components leave this null.
 
FuncSwapfuncSwap = nullptr
 Optional swap callback. Runtime byte-only components leave this null.
 
FuncCmpfuncCmp = nullptr
 Optional equality callback. Runtime byte-only components leave this null.
 
FuncSavefuncSave = nullptr
 Optional typed serialization save callback. Semantic runtime JSON uses field metadata instead.
 
FuncLoadfuncLoad = nullptr
 Optional typed serialization load callback. Semantic runtime JSON uses field metadata instead.
 

Detailed Description

Plain component registration descriptor shared by typed and runtime component paths. Typed registration produces this descriptor from detail::ComponentDesc, while runtime registration can fill it from data loaded at runtime.


The documentation for this struct was generated from the following file: