![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Fixed-size stack array with SoA storage. Interface compatiblity with std::array where it matters. More...
#include <sarray_soa_impl.h>
Public Types | |
| using | value_type = T |
| Element type stored by the container. | |
| using | reference = T & |
| Mutable element reference type. | |
| using | const_reference = const T & |
| Read-only element reference type. | |
| using | pointer = T * |
| Mutable element pointer type. | |
| using | const_pointer = T * |
| Read-only element pointer type. | |
| using | view_policy = mem::data_view_policy_soa< T::gaia_Data_Layout, T > |
| Data-layout access policy used by the container. | |
| using | difference_type = sarr_soa_detail::difference_type |
| Type used for iterator differences. | |
| using | size_type = sarr_soa_detail::size_type |
| Unsigned type used for sizes and indices. | |
| using | iterator = sarr_soa_iterator< T > |
| Mutable random-access iterator type. | |
| using | const_iterator = const_sarr_soa_iterator< T > |
| Read-only random-access iterator type. | |
| using | iterator_category = core::random_access_iterator_tag |
| Iterator category exposed by the container. | |
Public Member Functions | |
| sarr_soa (core::zero_t) noexcept | |
| Zero-initialization constructor. Because sarr_soa is not aggretate type, doing: sarr_soa<int,10> tmp{} does not zero-initialize its internals. We need to be explicit about our intent and use a special constructor. | |
| template<typename InputIt > | |
| sarr_soa (InputIt first, InputIt last) noexcept | |
| Constructs a container from an iterator range. | |
| sarr_soa (std::initializer_list< T > il) | |
| Constructs a container from an initializer list. | |
| sarr_soa (const sarr_soa &other) | |
| Copy-constructs a container. | |
| sarr_soa (sarr_soa &&other) noexcept | |
| Move-constructs a container. | |
| sarr_soa & | operator= (std::initializer_list< T > il) |
| Replaces the elements from an initializer list. | |
| sarr_soa & | operator= (const sarr_soa &other) |
| Copy-assigns the container. | |
| sarr_soa & | operator= (sarr_soa &&other) noexcept |
| Move-assigns the container. | |
| GAIA_NODISCARD pointer | data () noexcept |
| Returns a pointer to the element storage. | |
| GAIA_NODISCARD const_pointer | data () const noexcept |
| Returns a pointer to the element storage. | |
| GAIA_NODISCARD decltype(auto) | operator[] (size_type pos) noexcept |
| Accesses an element without bounds checking in optimized builds. | |
| GAIA_NODISCARD decltype(auto) | operator[] (size_type pos) const noexcept |
| Accesses an element without bounds checking in optimized builds. | |
| GAIA_NODISCARD constexpr size_type | size () const noexcept |
| Returns the number of elements. | |
| GAIA_NODISCARD constexpr bool | empty () const noexcept |
| Checks whether the container has no elements. | |
| GAIA_NODISCARD constexpr size_type | capacity () const noexcept |
| Returns the number of elements that fit without reallocation. | |
| GAIA_NODISCARD constexpr size_type | max_size () const noexcept |
| Returns the maximum number of elements supported by this container. | |
| GAIA_NODISCARD decltype(auto) | front () noexcept |
| Accesses the first element. | |
| GAIA_NODISCARD decltype(auto) | front () const noexcept |
| Accesses the first element. | |
| GAIA_NODISCARD decltype(auto) | back () noexcept |
| Accesses the last element. | |
| GAIA_NODISCARD decltype(auto) | back () const noexcept |
| Accesses the last element. | |
| GAIA_NODISCARD auto | begin () noexcept |
| Returns an iterator to the first element. | |
| GAIA_NODISCARD auto | begin () const noexcept |
| Returns an iterator to the first element. | |
| GAIA_NODISCARD auto | cbegin () const noexcept |
| Returns a read-only iterator to the first element. | |
| GAIA_NODISCARD auto | rbegin () noexcept |
| Returns a reverse traversal iterator to the last element. | |
| GAIA_NODISCARD auto | rbegin () const noexcept |
| Returns a reverse traversal iterator to the last element. | |
| GAIA_NODISCARD auto | crbegin () const noexcept |
| Returns a read-only reverse traversal iterator to the last element. | |
| GAIA_NODISCARD auto | end () noexcept |
| Returns an iterator one past the last element. | |
| GAIA_NODISCARD auto | end () const noexcept |
| Returns an iterator one past the last element. | |
| GAIA_NODISCARD auto | cend () const noexcept |
| Returns a read-only iterator one past the last element. | |
| GAIA_NODISCARD auto | rend () noexcept |
| Returns the reverse traversal sentinel preceding the first element. | |
| GAIA_NODISCARD auto | rend () const noexcept |
| Returns the reverse traversal sentinel preceding the first element. | |
| GAIA_NODISCARD auto | crend () const noexcept |
| Returns the read-only reverse traversal sentinel preceding the first element. | |
| GAIA_NODISCARD bool | operator== (const sarr_soa &other) const |
| Compares two containers element by element. | |
| GAIA_NODISCARD bool | operator!= (const sarr_soa &other) const |
| Checks whether two containers differ. | |
| template<size_t Item> | |
| auto | view_mut () noexcept |
| Returns a mutable view of one structure-of-arrays member. | |
| template<size_t Item> | |
| auto | view () const noexcept |
| Returns a read-only view of one structure-of-arrays member. | |
Public Attributes | |
| mem::raw_data_holder< T, allocated_bytes > | m_data |
| Inline storage backing the container elements. | |
Static Public Attributes | |
| static constexpr size_type | extent = N |
| Fixed capacity of the container. | |
| static constexpr uint32_t | allocated_bytes = view_policy::get_min_byte_size(0, N) |
| Number of bytes reserved by the inline storage. | |
Fixed-size stack array with SoA storage. Interface compatiblity with std::array where it matters.
| T | Element type stored directly in the array. |
| N | Number of elements and fixed capacity. |
|
inlinenoexcept |
Constructs a container from an iterator range.
| InputIt | Input iterator type. |
| first | Iterator to the first source element. |
| last | Iterator one past the last source element. |
|
inline |
Constructs a container from an initializer list.
| il | Initializer list supplying the elements. |
Copy-constructs a container.
| other | Container to copy or move from. |
Move-constructs a container.
| other | Container to copy or move from. |
|
inlinenoexcept |
Accesses the last element.
|
inlinenoexcept |
Accesses the last element.
|
inlinenoexcept |
Returns an iterator to the first element.
|
inlinenoexcept |
Returns an iterator to the first element.
|
inlineconstexprnoexcept |
Returns the number of elements that fit without reallocation.
|
inlinenoexcept |
Returns a read-only iterator to the first element.
|
inlinenoexcept |
Returns a read-only iterator one past the last element.
|
inlinenoexcept |
Returns a read-only reverse traversal iterator to the last element.
|
inlinenoexcept |
Returns the read-only reverse traversal sentinel preceding the first element.
|
inlinenoexcept |
Returns a pointer to the element storage.
|
inlinenoexcept |
Returns a pointer to the element storage.
|
inlineconstexprnoexcept |
Checks whether the container has no elements.
|
inlinenoexcept |
Returns an iterator one past the last element.
|
inlinenoexcept |
Returns an iterator one past the last element.
|
inlinenoexcept |
Accesses the first element.
|
inlinenoexcept |
Accesses the first element.
|
inlineconstexprnoexcept |
Returns the maximum number of elements supported by this container.
|
inline |
Checks whether two containers differ.
| other | Container to copy or move from. |
Copy-assigns the container.
| other | Container to copy or move from. |
Move-assigns the container.
| other | Container to copy or move from. |
|
inline |
Replaces the elements from an initializer list.
| il | Initializer list supplying the elements. |
|
inline |
Compares two containers element by element.
| other | Container to copy or move from. |
|
inlinenoexcept |
Accesses an element without bounds checking in optimized builds.
| pos | Zero-based element index. |
|
inlinenoexcept |
Accesses an element without bounds checking in optimized builds.
| pos | Zero-based element index. |
|
inlinenoexcept |
Returns a reverse traversal iterator to the last element.
|
inlinenoexcept |
Returns a reverse traversal iterator to the last element.
|
inlinenoexcept |
Returns the reverse traversal sentinel preceding the first element.
|
inlinenoexcept |
Returns the reverse traversal sentinel preceding the first element.
|
inlineconstexprnoexcept |
Returns the number of elements.
|
inlinenoexcept |
Returns a read-only view of one structure-of-arrays member.
| Item | Zero-based member index in the structure-of-arrays element. |
|
inlinenoexcept |
Returns a mutable view of one structure-of-arrays member.
| Item | Zero-based member index in the structure-of-arrays element. |