Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::mem::data_view_policy_soa< TDataLayout, ValueType > Struct Template Reference

View policy for accessing and storing data in the SoA way. Good for SIMD processing. More...

#include <data_layout_policy.h>

Classes

class  accessor
 

Public Types

using TTuple = decltype(meta::struct_to_tuple(std::declval< ValueType >()))
 
using TargetCastType = uint8_t *
 
template<size_t Item>
using value_type = typename std::tuple_element< Item, TTuple >::type
 
template<size_t Item>
using const_value_type = typename std::add_const< value_type< Item > >::type
 

Static Public Member Functions

GAIA_NODISCARD static constexpr uint32_t get_min_byte_size (uintptr_t addr, size_t cnt) noexcept
 
template<typename Allocator >
static GAIA_NODISCARD uint8_t * alloc (size_t cnt) noexcept
 
template<typename Allocator >
static void free (void *pData, size_t cap, size_t cnt) noexcept
 
static void mem_add_block (void *pData, size_t cap, size_t count)
 
static void mem_del_block (void *pData, size_t cap, size_t count)
 
static void mem_push_block (void *pData, size_t cap, size_t count, size_t n)
 
static void mem_pop_block (void *pData, size_t cap, size_t count, size_t n)
 
GAIA_NODISCARD static constexpr ValueType get (std::span< const uint8_t > s, size_t idx) noexcept
 
template<size_t Item>
GAIA_NODISCARD static constexpr auto get (std::span< const uint8_t > s, size_t idx=0) noexcept
 
GAIA_NODISCARD static constexpr auto set (std::span< uint8_t > s, size_t idx) noexcept
 
template<size_t Item>
GAIA_NODISCARD static constexpr auto set (std::span< uint8_t > s, size_t idx=0) noexcept
 

Static Public Attributes

static constexpr DataLayout Layout = data_layout_properties<TDataLayout, ValueType>::Layout
 
static constexpr size_t Alignment = data_layout_properties<TDataLayout, ValueType>::Alignment
 
static constexpr size_t TTupleItems = std::tuple_size<TTuple>::value
 

Detailed Description

template<DataLayout TDataLayout, typename ValueType>
struct gaia::mem::data_view_policy_soa< TDataLayout, ValueType >

View policy for accessing and storing data in the SoA way. Good for SIMD processing.

struct Foo { int x; int y; int z; }; using fooViewPolicy = data_view_policy<DataLayout::SoA, Foo>;

Memory organized as: xxxx yyyy zzzz


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