Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::ComponentCacheItem Struct Referencefinal

Public Types

using SymbolLookupKey = core::StringLookupKey< 512 >
 
using FuncCtor = void(void *, uint32_t)
 
using FuncDtor = void(void *, uint32_t)
 
using FuncFrom = void(void *, void *, uint32_t, uint32_t, uint32_t, uint32_t)
 
using FuncCopy = void(void *, const void *, uint32_t, uint32_t, uint32_t, uint32_t)
 
using FuncMove = void(void *, void *, uint32_t, uint32_t, uint32_t, uint32_t)
 
using FuncSwap = void(void *, void *, uint32_t, uint32_t, uint32_t, uint32_t)
 
using FuncCmp = bool(const void *, const void *)
 
using FuncSave = void(ser::ISerializer *, const void *, uint32_t, uint32_t, uint32_t)
 
using FuncLoad = void(ser::ISerializer *, void *, uint32_t, uint32_t, uint32_t)
 
using FuncOnAdd = void(const World &world, const ComponentCacheItem &, Entity)
 
using FuncOnDel = void(const World &world, const ComponentCacheItem &, Entity)
 
using FuncOnSet = void(const World &world, const ComponentRecord &, Chunk &chunk)
 

Public Member Functions

 ComponentCacheItem (const ComponentCacheItem &)=delete
 
 ComponentCacheItem (ComponentCacheItem &&)=delete
 
ComponentCacheItemoperator= (const ComponentCacheItem &)=delete
 
ComponentCacheItemoperator= (ComponentCacheItem &&)=delete
 
void ctor_move (void *pDst, void *pSrc, uint32_t idxDst, uint32_t idxSrc, uint32_t sizeDst, uint32_t sizeSrc) const
 
void ctor_copy (void *pDst, const void *pSrc, uint32_t idxDst, uint32_t idxSrc, uint32_t sizeDst, uint32_t sizeSrc) const
 
void dtor (void *pSrc) const
 
void copy (void *pDst, const void *pSrc, uint32_t idxDst, uint32_t idxSrc, uint32_t sizeDst, uint32_t sizeSrc) const
 
void move (void *pDst, void *pSrc, uint32_t idxDst, uint32_t idxSrc, uint32_t sizeDst, uint32_t sizeSrc) const
 
void swap (void *pLeft, void *pRight, uint32_t idxLeft, uint32_t idxRight, uint32_t sizeDst, uint32_t sizeSrc) const
 
bool cmp (const void *pLeft, const void *pRight) const
 
void save (ser::ISerializer *pSerializer, const void *pSrc, uint32_t from, uint32_t to, uint32_t cap) const
 
void load (ser::ISerializer *pSerializer, void *pDst, uint32_t from, uint32_t to, uint32_t cap) const
 
GAIA_NODISCARD uint32_t calc_new_mem_offset (uint32_t addr, size_t cnt) const noexcept
 

Static Public Member Functions

template<typename T >
static GAIA_NODISCARD ComponentCacheItemcreate (Entity entity)
 
static void destroy (ComponentCacheItem *pItem)
 

Public Attributes

Entity entity
 Component entity.
 
Component comp
 Unique component identifier.
 
ComponentLookupHash hashLookup
 Complex hash used for look-ups.
 
uint8_t soaSizes [meta::StructToTupleMaxTypes]
 If component is SoA, this stores how many bytes each of the elements take.
 
SymbolLookupKey name
 Component name.
 
FuncCtor * func_ctor {}
 Function to call when the component needs to be constructed.
 
FuncMove * func_move_ctor {}
 Function to call when the component needs to be move constructed.
 
FuncCopy * func_copy_ctor {}
 Function to call when the component needs to be copy constructed.
 
FuncDtor * func_dtor {}
 Function to call when the component needs to be destroyed.
 
FuncCopy * func_copy {}
 Function to call when the component needs to be copied.
 
FuncMove * func_move {}
 Function to call when the component needs to be moved.
 
FuncSwap * func_swap {}
 Function to call when the component needs to swap.
 
FuncCmp * func_cmp {}
 Function to call when comparing two components of the same type for equality.
 
FuncSave * func_save {}
 Function to call when saving component to a buffer.
 
FuncLoad * func_load {}
 

Static Public Attributes

static constexpr uint32_t MaxNameLength = 256
 

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