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

Array of elements of type. More...

#include <sarray_ext_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_aos< T >
 
using difference_type = sarr_ext_detail::difference_type
 
using size_type = sarr_ext_detail::size_type
 
using iterator = pointer
 
using const_iterator = const_pointer
 
using iterator_category = core::random_access_iterator_tag
 

Public Member Functions

constexpr sarr_ext (core::zero_t) noexcept
 
constexpr sarr_ext (size_type count, const_reference value) noexcept
 
constexpr sarr_ext (size_type count) noexcept
 
template<typename InputIt >
constexpr sarr_ext (InputIt first, InputIt last) noexcept
 
constexpr sarr_ext (std::initializer_list< T > il)
 
constexpr sarr_ext (const sarr_ext &other)
 
constexpr sarr_ext (sarr_ext &&other) noexcept
 
sarr_extoperator= (std::initializer_list< T > il)
 
constexpr sarr_extoperator= (const sarr_ext &other)
 
constexpr sarr_extoperator= (sarr_ext &&other) noexcept
 
GAIA_NODISCARD constexpr pointer data () noexcept
 
GAIA_NODISCARD constexpr const_pointer data () const noexcept
 
GAIA_NODISCARD constexpr decltype(auto) operator[] (size_type pos) noexcept
 
GAIA_NODISCARD constexpr decltype(auto) operator[] (size_type pos) const noexcept
 
constexpr void push_back (const T &arg) noexcept
 
constexpr void push_back (T &&arg) noexcept
 
template<typename... Args>
constexpr decltype(auto) emplace_back (Args &&... args) noexcept
 
constexpr void pop_back () noexcept
 
iterator insert (iterator pos, const T &arg) noexcept
 Insert the element to the position given by iterator pos.
 
iterator insert (iterator pos, T &&arg) noexcept
 Insert the element to the position given by iterator pos.
 
constexpr 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)
 
iterator erase_at (size_type pos) noexcept
 Removes the element at index.
 
constexpr void clear () noexcept
 
constexpr void resize (size_type count) noexcept
 
template<typename Func >
auto retain (Func &&func) noexcept
 Removes all elements that fail the predicate.
 
GAIA_NODISCARD constexpr size_type size () const noexcept
 
GAIA_NODISCARD constexpr bool empty () const noexcept
 
GAIA_NODISCARD constexpr size_type capacity () const noexcept
 
GAIA_NODISCARD constexpr size_type max_size () const noexcept
 
GAIA_NODISCARD constexpr decltype(auto) front () noexcept
 
GAIA_NODISCARD constexpr decltype(auto) front () const noexcept
 
GAIA_NODISCARD constexpr decltype(auto) back () noexcept
 
GAIA_NODISCARD constexpr decltype(auto) back () const noexcept
 
GAIA_NODISCARD constexpr auto begin () noexcept
 
GAIA_NODISCARD constexpr auto begin () const noexcept
 
GAIA_NODISCARD constexpr auto cbegin () const noexcept
 
GAIA_NODISCARD constexpr auto rbegin () noexcept
 
GAIA_NODISCARD constexpr auto rbegin () const noexcept
 
GAIA_NODISCARD constexpr auto crbegin () const noexcept
 
GAIA_NODISCARD constexpr auto end () noexcept
 
GAIA_NODISCARD constexpr auto end () const noexcept
 
GAIA_NODISCARD constexpr auto cend () const noexcept
 
GAIA_NODISCARD constexpr auto rend () noexcept
 
GAIA_NODISCARD constexpr auto rend () const noexcept
 
GAIA_NODISCARD constexpr auto crend () const noexcept
 
GAIA_NODISCARD constexpr bool operator== (const sarr_ext &other) const noexcept
 
GAIA_NODISCARD constexpr bool operator!= (const sarr_ext &other) const noexcept
 

Static Public Attributes

static constexpr size_t value_size = sizeof(T)
 
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, sarr_ext_detail::size_type N>
class gaia::cnt::sarr_ext< T, N >

Array of elements of type.

Template Parameters
Twith fixed capacity
Nand variable size allocated on stack. Interface compatiblity with std::array where it matters.

Member Function Documentation

◆ erase() [1/2]

template<typename T , sarr_ext_detail::size_type N>
iterator gaia::cnt::sarr_ext< T, N >::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 , sarr_ext_detail::size_type N>
constexpr iterator gaia::cnt::sarr_ext< T, N >::erase ( iterator  pos)
inlineconstexprnoexcept

Removes the element at pos.

Parameters
posIterator to the element to remove

◆ erase_at()

template<typename T , sarr_ext_detail::size_type N>
iterator gaia::cnt::sarr_ext< T, N >::erase_at ( size_type  pos)
inlinenoexcept

Removes the element at index.

Parameters
pos

◆ insert() [1/2]

template<typename T , sarr_ext_detail::size_type N>
iterator gaia::cnt::sarr_ext< T, N >::insert ( iterator  pos,
const T &  arg 
)
inlinenoexcept

Insert the element to the position given by iterator pos.

Parameters
posPosition in the container
argData to insert

◆ insert() [2/2]

template<typename T , sarr_ext_detail::size_type N>
iterator gaia::cnt::sarr_ext< T, N >::insert ( iterator  pos,
T &&  arg 
)
inlinenoexcept

Insert the element to the position given by iterator pos.

Parameters
posPosition in the container
argData to insert

◆ retain()

template<typename T , sarr_ext_detail::size_type N>
template<typename Func >
auto gaia::cnt::sarr_ext< T, N >::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: