![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Array with variable size of elements of type. More...
#include <darray_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 = const 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 = darr_soa_detail::difference_type |
| Type used for iterator differences. | |
| using | size_type = darr_soa_detail::size_type |
| Unsigned type used for sizes and indices. | |
| using | iterator = darr_soa_iterator< T > |
| Mutable random-access iterator type. | |
| using | const_iterator = const_darr_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 | |
| darr_soa (core::zero_t) noexcept | |
| Constructs a value-initialized container. | |
| darr_soa (size_type count, const_reference value) | |
| Constructs a container with copies of a value. | |
| darr_soa (size_type count) | |
| Constructs a container with the requested number of value-initialized elements. | |
| template<typename InputIt > | |
| darr_soa (InputIt first, InputIt last) | |
| Constructs a container from an iterator range. | |
| darr_soa (std::initializer_list< T > il) | |
| Constructs a container from an initializer list. | |
| darr_soa (const darr_soa &other) | |
| Copy-constructs a container. | |
| darr_soa (darr_soa &&other) noexcept | |
| Move-constructs a container. | |
| darr_soa & | operator= (std::initializer_list< T > il) |
| Replaces the elements from an initializer list. | |
| darr_soa & | operator= (const darr_soa &other) |
| Copy-assigns the container. | |
| darr_soa & | operator= (darr_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. | |
| void | reserve (size_type cap) |
| Ensures storage for at least the requested number of elements. | |
| void | resize (size_type count) |
| Changes the number of elements. | |
| void | resize (size_type count, const_reference value) |
| Changes the size and initializes new elements from a value. | |
| void | push_back (const T &arg) |
| Appends an element. | |
| void | push_back (T &&arg) |
| Appends an element. | |
| template<typename... Args> | |
| decltype(auto) | emplace_back (Args &&... args) |
| Constructs and appends an element. | |
| void | pop_back () noexcept |
| Removes the last element. | |
| iterator | insert (iterator pos, const T &arg) |
| Insert the element to the position given by iterator pos. | |
| iterator | insert (iterator pos, T &&arg) |
| Insert the element to the position given by iterator pos. | |
| iterator | erase (iterator pos) noexcept |
| Removes the element at pos. | |
| iterator | erase (iterator first, iterator last) noexcept |
| Removes the elements in the range [first, last) | |
| void | clear () noexcept |
| Removes all elements. | |
| void | shrink_to_fit () |
| Reduces allocated storage to match the current size when possible. | |
| template<typename Func > | |
| auto | retain (Func &&func) noexcept |
| Removes all elements that fail the predicate. | |
| GAIA_NODISCARD size_type | size () const noexcept |
| Returns the number of elements. | |
| GAIA_NODISCARD bool | empty () const noexcept |
| Checks whether the container has no elements. | |
| GAIA_NODISCARD size_type | capacity () const noexcept |
| Returns the number of elements that fit without reallocation. | |
| GAIA_NODISCARD 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 darr_soa &other) const noexcept |
| Compares two containers element by element. | |
| GAIA_NODISCARD constexpr bool | operator!= (const darr_soa &other) const noexcept |
| 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. | |
Array with variable size of elements of type.
| T | allocated on heap. Interface compatiblity with std::vector where it matters. Can be used only with SoA types. |
|
inline |
Constructs a container with copies of a value.
| count | Number of elements. |
| value | Value assigned to each new element. |
|
inline |
Constructs a container with the requested number of value-initialized elements.
| count | Number of elements. |
|
inline |
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. |
|
inline |
Copy-constructs a container.
| other | Container to copy or move from. |
|
inlinenoexcept |
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.
|
inlinenoexcept |
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.
|
inline |
Constructs and appends an element.
| Args | Types of the forwarded constructor arguments. |
| args | Arguments forwarded to the element constructor. |
|
inlinenoexcept |
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 |
Removes the elements in the range [first, last)
| first | Iterator to the element to remove |
| last | Iterator to the one beyond the last element to remove |
|
inlinenoexcept |
Removes the element at pos.
| pos | Iterator to the element to remove |
|
inlinenoexcept |
Accesses the first element.
|
inlinenoexcept |
Accesses the first element.
Insert the element to the position given by iterator pos.
| pos | Position in the container |
| arg | Data to insert |
|
inline |
Insert the element to the position given by iterator pos.
| pos | Position in the container |
| arg | Data to insert |
|
inlinenoexcept |
Returns the maximum number of elements supported by this container.
|
inlineconstexprnoexcept |
Checks whether two containers differ.
| other | Container to copy or move from. |
|
inline |
Copy-assigns the container.
| other | Container to copy or move from. |
|
inlinenoexcept |
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. |
|
inlinenoexcept |
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. |
|
inline |
Appends an element.
| arg | Element value to append. |
|
inline |
Appends an element.
| arg | Element value to append. |
|
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.
|
inline |
Ensures storage for at least the requested number of elements.
| cap | Requested element capacity. |
|
inline |
Changes the number of elements.
| count | Number of elements. |
|
inline |
Changes the size and initializes new elements from a value.
| count | Number of elements. |
| value | Value assigned to each new element. |
|
inlinenoexcept |
Removes all elements that fail the predicate.
| Func | Predicate callable type. |
| func | A lambda or a functor with the bool operator()(Container::value_type&) overload. |
|
inlinenoexcept |
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. |