Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::mem::data_view_policy_soa_erased Struct Reference

Type-erased policy for addressing one field value in SoA storage. The field arrays use the same alignment and capacity rules as data_view_policy_soa. More...

#include <data_layout_policy.h>

Static Public Member Functions

static GAIA_NODISCARD const uint8_t * get (const void *pData, uint32_t alignment, std::span< const uint8_t > fieldSizes, uint32_t fieldIdx, uint32_t row, uint32_t capacity) noexcept
 Returns one read-only field value from type-erased SoA storage.
 
static GAIA_NODISCARD uint8_t * set (void *pData, uint32_t alignment, std::span< const uint8_t > fieldSizes, uint32_t fieldIdx, uint32_t row, uint32_t capacity) noexcept
 Returns one mutable field value from type-erased SoA storage.
 

Detailed Description

Type-erased policy for addressing one field value in SoA storage. The field arrays use the same alignment and capacity rules as data_view_policy_soa.

Member Function Documentation

◆ get()

static GAIA_NODISCARD const uint8_t * gaia::mem::data_view_policy_soa_erased::get ( const void *  pData,
uint32_t  alignment,
std::span< const uint8_t >  fieldSizes,
uint32_t  fieldIdx,
uint32_t  row,
uint32_t  capacity 
)
inlinestaticnoexcept

Returns one read-only field value from type-erased SoA storage.

Parameters
pDataBase address of the SoA storage.
alignmentAlignment shared by all field arrays.
fieldSizesByte size of each field value in storage order.
fieldIdxField array index.
rowValue index inside the selected field array.
capacityNumber of values reserved in every field array.
Returns
Pointer to the selected field value.

◆ set()

static GAIA_NODISCARD uint8_t * gaia::mem::data_view_policy_soa_erased::set ( void *  pData,
uint32_t  alignment,
std::span< const uint8_t >  fieldSizes,
uint32_t  fieldIdx,
uint32_t  row,
uint32_t  capacity 
)
inlinestaticnoexcept

Returns one mutable field value from type-erased SoA storage.

Parameters
pDataBase address of the SoA storage.
alignmentAlignment shared by all field arrays.
fieldSizesByte size of each field value in storage order.
fieldIdxField array index.
rowValue index inside the selected field array.
capacityNumber of values reserved in every field array.
Returns
Pointer to the selected field value.

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