Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::cnt::darr_ext_soa< T, N, Allocator > Class Template Reference

Array of elements of type. More...

#include <darray_ext_soa_impl.h>

Public Types

using value_type = T
 
using reference = T &
 
using const_reference = const T &
 
using pointer = T *
 
using const_pointer = const T *
 
using view_policy = mem::data_view_policy_soa< T::gaia_Data_Layout, T >
 
using difference_type = darr_ext_soa_detail::difference_type
 
using size_type = darr_ext_soa_detail::size_type
 
using iterator = darr_ext_soa_iterator< T >
 
using const_iterator = const_darr_ext_soa_iterator< T >
 
using iterator_category = core::random_access_iterator_tag
 

Public Member Functions

 darr_ext_soa (core::zero_t) noexcept
 
 darr_ext_soa (size_type count, const T &value)
 
 darr_ext_soa (size_type count)
 
template<typename InputIt >
 darr_ext_soa (InputIt first, InputIt last)
 
 darr_ext_soa (std::initializer_list< T > il)
 
 darr_ext_soa (const darr_ext_soa &other)
 
 darr_ext_soa (darr_ext_soa &&other) noexcept
 
darr_ext_soaoperator= (std::initializer_list< T > il)
 
darr_ext_soaoperator= (const darr_ext_soa &other)
 
darr_ext_soaoperator= (darr_ext_soa &&other) noexcept
 
GAIA_NODISCARD pointer data () noexcept
 
GAIA_NODISCARD const_pointer data () const noexcept
 
GAIA_NODISCARD decltype(auto) operator[] (size_type pos) noexcept
 
GAIA_NODISCARD decltype(auto) operator[] (size_type pos) const noexcept
 
void reserve (size_type cap)
 
void resize (size_type count)
 
void push_back (const T &arg)
 
void push_back (T &&arg)
 
template<typename... Args>
decltype(auto) emplace_back (Args &&... args)
 
void pop_back () noexcept
 
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
 
void shrink_to_fit ()
 
template<typename Func >
auto retain (Func &&func) noexcept
 Removes all elements that fail the predicate.
 
GAIA_NODISCARD size_type size () const noexcept
 
GAIA_NODISCARD bool empty () const noexcept
 
GAIA_NODISCARD size_type capacity () const noexcept
 
GAIA_NODISCARD size_type max_size () const noexcept
 
GAIA_NODISCARD decltype(auto) front () noexcept
 
GAIA_NODISCARD decltype(auto) front () const noexcept
 
GAIA_NODISCARD decltype(auto) back () noexcept
 
GAIA_NODISCARD decltype(auto) back () const noexcept
 
GAIA_NODISCARD auto begin () noexcept
 
GAIA_NODISCARD auto begin () const noexcept
 
GAIA_NODISCARD auto cbegin () const noexcept
 
GAIA_NODISCARD auto rbegin () noexcept
 
GAIA_NODISCARD auto rbegin () const noexcept
 
GAIA_NODISCARD auto crbegin () const noexcept
 
GAIA_NODISCARD auto end () noexcept
 
GAIA_NODISCARD auto end () const noexcept
 
GAIA_NODISCARD auto cend () const noexcept
 
GAIA_NODISCARD auto rend () noexcept
 
GAIA_NODISCARD auto rend () const noexcept
 
GAIA_NODISCARD auto crend () const noexcept
 
GAIA_NODISCARD bool operator== (const darr_ext_soa &other) const noexcept
 
GAIA_NODISCARD constexpr bool operator!= (const darr_ext_soa &other) const noexcept
 
template<size_t Item>
auto view_mut () noexcept
 
template<size_t Item>
auto view () const noexcept
 

Static Public Attributes

static constexpr size_type extent = N
 
static constexpr uint32_t allocated_bytes = view_policy::get_min_byte_size(0, N)
 

Detailed Description

template<typename T, darr_ext_soa_detail::size_type N, typename Allocator = mem::DefaultAllocatorAdaptor>
class gaia::cnt::darr_ext_soa< T, N, Allocator >

Array of elements of type.

Template Parameters
Tallocated on heap or stack. Stack capacity is
Nelements. If the number of elements is bellow
Nthe stack storage is used. If the number of elements is above
Nthe heap storage is used. Interface compatiblity with std::vector and std::array where it matters.

Member Function Documentation

◆ erase() [1/2]

template<typename T , darr_ext_soa_detail::size_type N, typename Allocator = mem::DefaultAllocatorAdaptor>
iterator gaia::cnt::darr_ext_soa< T, N, Allocator >::erase ( iterator  first,
iterator  last 
)
inlinenoexcept

Removes the elements in the range [first, last)

Parameters
firstIterator to the element to remove
lastIterator to the one beyond the last element to remove

◆ erase() [2/2]

template<typename T , darr_ext_soa_detail::size_type N, typename Allocator = mem::DefaultAllocatorAdaptor>
iterator gaia::cnt::darr_ext_soa< T, N, Allocator >::erase ( iterator  pos)
inlinenoexcept

Removes the element at pos.

Parameters
posIterator to the element to remove

◆ insert() [1/2]

template<typename T , darr_ext_soa_detail::size_type N, typename Allocator = mem::DefaultAllocatorAdaptor>
iterator gaia::cnt::darr_ext_soa< T, N, Allocator >::insert ( iterator  pos,
const T &  arg 
)
inline

Insert the element to the position given by iterator pos.

Parameters
posPosition in the container
argData to insert

◆ insert() [2/2]

template<typename T , darr_ext_soa_detail::size_type N, typename Allocator = mem::DefaultAllocatorAdaptor>
iterator gaia::cnt::darr_ext_soa< T, N, Allocator >::insert ( iterator  pos,
T &&  arg 
)
inline

Insert the element to the position given by iterator pos.

Parameters
posPosition in the container
argData to insert

◆ retain()

template<typename T , darr_ext_soa_detail::size_type N, typename Allocator = mem::DefaultAllocatorAdaptor>
template<typename Func >
auto gaia::cnt::darr_ext_soa< T, N, Allocator >::retain ( Func &&  func)
inlinenoexcept

Removes all elements that fail the predicate.

Parameters
funcA lambda or a functor with the bool operator()(Container::value_type&) overload.
Returns
The new size of the array.

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