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

View policy for accessing and storing data in the AoS way. Good for random access and when accessing data that needs to be close together. More...

#include <data_layout_policy.h>

+ Inheritance diagram for gaia::mem::data_view_policy_aos< ValueType >:

Public Types

using TargetCastType = std::add_pointer_t< ValueType >
 

Static Public Member Functions

static GAIA_NODISCARD 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
 
template<typename Allocator >
static void free (void *pData, size_t cnt) noexcept
 
GAIA_NODISCARD static constexpr ValueType get_value (std::span< const ValueType > s, size_t idx) noexcept
 
GAIA_NODISCARD static constexpr const ValueType & get (std::span< const ValueType > s, size_t idx) noexcept
 
GAIA_NODISCARD static constexpr ValueType & set (std::span< ValueType > s, size_t idx) noexcept
 

Static Public Attributes

static constexpr DataLayout Layout = data_layout_properties<DataLayout::AoS, ValueType>::Layout
 
static constexpr size_t Alignment = data_layout_properties<DataLayout::AoS, ValueType>::Alignment
 

Detailed Description

template<typename ValueType>
struct gaia::mem::data_view_policy_aos< ValueType >

View policy for accessing and storing data in the AoS way. Good for random access and when accessing data that needs to be close together.

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

Memory organized as: xyz xyz xyz xyz


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