![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
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 > |
| Pointer type used to address stored values. | |
Static Public Member Functions | |
| static GAIA_NODISCARD constexpr uint32_t | get_min_byte_size (uintptr_t addr, size_t cnt) noexcept |
| Calculates the bytes required for a value range. | |
| template<typename Allocator > | |
| static GAIA_NODISCARD uint8_t * | alloc (size_t cnt) noexcept |
| Allocates and default-constructs an AoS value range. | |
| template<typename Allocator > | |
| static void | free (void *pData, size_t cap, size_t cnt) noexcept |
| Destroys and releases an instrumented AoS value range. | |
| template<typename Allocator > | |
| static void | free (void *pData, size_t cnt) noexcept |
| Destroys and releases an AoS value range. | |
| GAIA_NODISCARD static constexpr ValueType | get_value (std::span< const ValueType > s, size_t idx) noexcept |
| Copies a value from an AoS span. | |
| GAIA_NODISCARD static constexpr const ValueType & | get (std::span< const ValueType > s, size_t idx) noexcept |
| Returns a read-only value reference from an AoS span. | |
| GAIA_NODISCARD static constexpr ValueType & | set (std::span< ValueType > s, size_t idx) noexcept |
| Returns a mutable value reference from an AoS span. | |
Static Public Attributes | |
| static constexpr DataLayout | Layout = data_layout_properties<DataLayout::AoS, ValueType>::Layout |
| Physical layout. | |
| static constexpr size_t | Alignment = data_layout_properties<DataLayout::AoS, ValueType>::Alignment |
| Required byte alignment. | |
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
|
inlinestaticnoexcept |
Allocates and default-constructs an AoS value range.
| Allocator | Allocator adaptor type. |
| cnt | Number of values. |
|
inlinestaticnoexcept |
Destroys and releases an instrumented AoS value range.
| Allocator | Allocator adaptor type. |
| pData | Allocated buffer, or null. |
| cap | Buffer capacity in values. |
| cnt | Number of live values. |
|
inlinestaticnoexcept |
Destroys and releases an AoS value range.
| Allocator | Allocator adaptor type. |
| pData | Allocated buffer, or null. |
| cnt | Number of live values. |
|
inlinestaticconstexprnoexcept |
Returns a read-only value reference from an AoS span.
| s | Source values. |
| idx | Value index. |
|
inlinestaticconstexprnoexcept |
Calculates the bytes required for a value range.
| addr | Starting address used for alignment calculations. |
| cnt | Number of values. |
|
inlinestaticconstexprnoexcept |
Copies a value from an AoS span.
| s | Source values. |
| idx | Value index. |
|
inlinestaticconstexprnoexcept |
Returns a mutable value reference from an AoS span.
| s | Destination values. |
| idx | Value index. |