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

Mutable byte view over AoS values. More...

#include <data_layout_policy.h>

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

Public Types

using view_policy = data_view_policy_aos< ValueType >
 Underlying storage policy.
 

Public Member Functions

 data_view_policy_aos_set (std::span< uint8_t > data)
 Creates a mutable view over bytes.
 
 data_view_policy_aos_set (std::span< const uint8_t > data)
 Creates a mutable view from a byte span.
 
template<typename C >
 data_view_policy_aos_set (const C &c)
 Creates a mutable view over a contiguous container.
 
GAIA_NODISCARD ValueType & operator[] (size_t idx) noexcept
 Returns a mutable value by index.
 
GAIA_NODISCARD const ValueType & operator[] (size_t idx) const noexcept
 Returns a read-only value by index.
 
GAIA_NODISCARD auto data () const noexcept
 Returns the backing byte address.
 
GAIA_NODISCARD auto size () const noexcept
 Returns the backing span size.
 

Public Attributes

std::span< uint8_t > m_data
 Raw data pointed to by the view policy.
 

Detailed Description

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

Mutable byte view over AoS values.

Template Parameters
ValueTypeStored value type.

Constructor & Destructor Documentation

◆ data_view_policy_aos_set() [1/3]

template<typename ValueType >
gaia::mem::data_view_policy_aos_set< ValueType >::data_view_policy_aos_set ( std::span< uint8_t >  data)
inline

Creates a mutable view over bytes.

Parameters
dataBacking byte span.

◆ data_view_policy_aos_set() [2/3]

template<typename ValueType >
gaia::mem::data_view_policy_aos_set< ValueType >::data_view_policy_aos_set ( std::span< const uint8_t >  data)
inline

Creates a mutable view from a byte span.

Parameters
dataBacking byte span whose constness is intentionally erased.

◆ data_view_policy_aos_set() [3/3]

template<typename ValueType >
template<typename C >
gaia::mem::data_view_policy_aos_set< ValueType >::data_view_policy_aos_set ( const C &  c)
inline

Creates a mutable view over a contiguous container.

Template Parameters
CContiguous container type.
Parameters
cBacking container.

Member Function Documentation

◆ data()

template<typename ValueType >
GAIA_NODISCARD auto gaia::mem::data_view_policy_aos_set< ValueType >::data ( ) const
inlinenoexcept

Returns the backing byte address.

Returns
Mutable byte pointer.

◆ operator[]() [1/2]

template<typename ValueType >
GAIA_NODISCARD const ValueType & gaia::mem::data_view_policy_aos_set< ValueType >::operator[] ( size_t  idx) const
inlinenoexcept

Returns a read-only value by index.

Parameters
idxValue index.
Returns
Read-only reference to the value.

◆ operator[]() [2/2]

template<typename ValueType >
GAIA_NODISCARD ValueType & gaia::mem::data_view_policy_aos_set< ValueType >::operator[] ( size_t  idx)
inlinenoexcept

Returns a mutable value by index.

Parameters
idxValue index.
Returns
Mutable reference to the value.

◆ size()

template<typename ValueType >
GAIA_NODISCARD auto gaia::mem::data_view_policy_aos_set< ValueType >::size ( ) const
inlinenoexcept

Returns the backing span size.

Returns
Span size in bytes.

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