IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
ice::Array< Type, Logic > Struct Template Reference

A simple container storing items in continuous memory. More...

#include <ice/array.hxx>

Inheritance diagram for ice::Array< Type, Logic >:
ice::container::ContiguousContainer ice::container::ResizableContainer ice::container::BasicContainer

Public Types

using ValueType = Type
using ConstContainerValueType = Type const
using Iterator = Type*
using ReverseIterator = std::reverse_iterator<Type*>
using ConstIterator = Type const*
using ConstReverseIterator = std::reverse_iterator<Type const*>
using SizeType = ice::ncount
using ContainerTag = ice::concepts::ContiguousContainerTag

Public Member Functions

 Array (ice::Allocator &alloc) noexcept
 ~Array () noexcept
 Array (Array &&other) noexcept
 Array (Array const &other) noexcept
 Array (ice::Allocator &alloc, ice::Span< Type const > values) noexcept
auto operator= (Array &&other) noexcept -> Array &
auto operator= (Array const &other) noexcept -> Array &
constexpr auto size () const noexcept -> SizeType
template<typename Self>
constexpr auto data (this Self &self) noexcept -> ice::container::ValuePtr< Self >
constexpr auto capacity () const noexcept -> SizeType
constexpr void set_capacity (SizeType new_capacity) noexcept
constexpr void resize (SizeType new_size) noexcept
constexpr void clear () noexcept
template<typename ItemType = Type>
requires std::convertible_to<ItemType, Type> && std::is_constructible_v<Type, ItemType>
void push_back (ItemType &&item) noexcept
template<ice::concepts::IterableContainer ContainerT>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
void push_back (ContainerT const &other) noexcept
void pop_back (ice::ncount count=1_count) noexcept
void remove_at (ice::nindex index) noexcept
constexpr auto data_view (this Array const &self) noexcept -> ice::Data
constexpr auto memory_view (this Array &self) noexcept -> ice::Memory
 operator ice::Span< Type > () noexcept
 operator ice::Span< Type const > () const noexcept
Public Member Functions inherited from ice::container::ContiguousContainer
template<ice::concepts::ContiguousContainer Self>
constexpr auto first (this Self &&self) noexcept -> ice::container::ValueRef< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto last (this Self &&self) noexcept -> ice::container::ValueRef< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto subspan (this Self &&self, ice::nindex from, ice::ncount count=ice::ncount_none) noexcept -> ice::container::SpanType< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto subspan (this Self &&self, ice::ref32 refval) noexcept -> ice::container::SpanType< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto headspan (this Self &&self, ice::ncount count=1) noexcept -> ice::container::SpanType< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto tailspan (this Self &&self, ice::nindex offset=1) noexcept -> ice::container::SpanType< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto begin (this Self &&self) noexcept -> ice::container::Iterator< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto end (this Self &&self) noexcept -> ice::container::Iterator< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto rbegin (this Self &&self) noexcept -> ice::container::ReverseIterator< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto rend (this Self &&self) noexcept -> ice::container::ReverseIterator< Self >
template<ice::concepts::ContiguousContainer Self>
constexpr auto index_of (this Self const &self, ice::container::ValueRef< Self > value) noexcept -> ice::nindex
template<ice::concepts::ContiguousContainer Self, typename Predicate, typename... Args>
constexpr auto index_of (this Self const &self, Predicate const &predicate, Args const &... args) noexcept -> ice::nindex
template<ice::concepts::ContiguousContainer Self>
constexpr auto operator[] (this Self &&self, ice::nindex index) noexcept -> ice::container::ValueRef< Self >
template<ice::concepts::ContiguousContainer Self>
auto meminfo (this Self const &self) noexcept -> ice::meminfo
template<ice::concepts::ContiguousResizableContainer Self>
requires (ice::concepts::TrivialContainerLogic<Self>)
auto memset (this Self const &self, ice::u8 value) noexcept -> ice::Memory
Public Member Functions inherited from ice::container::BasicContainer
template<ice::concepts::Container Self>
constexpr bool is_empty (this Self const &self) noexcept
template<ice::concepts::Container Self>
constexpr bool not_empty (this Self const &self) noexcept
Public Member Functions inherited from ice::container::ResizableContainer
template<ice::concepts::ResizableContainer Self>
constexpr bool is_full (this Self const &self) noexcept
template<ice::concepts::ResizableContainer Self>
constexpr bool not_full (this Self const &self) noexcept
template<ice::concepts::ResizableContainer Self>
constexpr void reserve (this Self &self, ice::ncount min_capacity) noexcept
template<ice::concepts::ResizableContainer Self>
constexpr void grow (this Self &self, ice::ncount min_capacity=ice::ncount_none) noexcept
template<ice::concepts::ResizableContainer Self>
constexpr void shrink (this Self &self) noexcept

Public Attributes

ice::Allocator_allocator
ice::u32 _capacity
ice::u32 _count
ValueType_data

Detailed Description

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
struct ice::Array< Type, Logic >

A simple container storing items in continuous memory.

Manages a memory block big enough to hold the items that it holds.

Template Parameters
LogicThe logic used during memory operations for the given type. The user can set this value to enforce expected behavior for stored types.

Member Typedef Documentation

◆ ConstContainerValueType

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::ConstContainerValueType = Type const

◆ ConstIterator

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::ConstIterator = Type const*

◆ ConstReverseIterator

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::ConstReverseIterator = std::reverse_iterator<Type const*>

◆ ContainerTag

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::ContainerTag = ice::concepts::ContiguousContainerTag

◆ Iterator

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::Iterator = Type*

◆ ReverseIterator

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::ReverseIterator = std::reverse_iterator<Type*>

◆ SizeType

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::SizeType = ice::ncount

◆ ValueType

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
using ice::Array< Type, Logic >::ValueType = Type

Constructor & Destructor Documentation

◆ Array() [1/4]

template<typename Type, ice::ContainerLogic Logic>
ice::Array< Type, Logic >::Array ( ice::Allocator & alloc)
inlineexplicitnoexcept

◆ ~Array()

template<typename Type, ice::ContainerLogic Logic>
ice::Array< Type, Logic >::~Array ( )
inlinenoexcept

◆ Array() [2/4]

template<typename Type, ice::ContainerLogic Logic>
ice::Array< Type, Logic >::Array ( Array< Type, Logic > && other)
inlinenoexcept

◆ Array() [3/4]

template<typename Type, ice::ContainerLogic Logic>
requires std::copy_constructible<Type>
ice::Array< Type, Logic >::Array ( Array< Type, Logic > const & other)
inlinenoexcept

◆ Array() [4/4]

template<typename Type, ice::ContainerLogic Logic>
requires std::copy_constructible<Type>
ice::Array< Type, Logic >::Array ( ice::Allocator & alloc,
ice::Span< Type const > values )
inlinenoexcept

Member Function Documentation

◆ capacity()

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
auto ice::Array< Type, Logic >::capacity ( ) const -> SizeType
inlineconstexprnoexcept

◆ clear()

template<typename Type, ice::ContainerLogic Logic>
void ice::Array< Type, Logic >::clear ( )
inlineconstexprnoexcept

◆ data()

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
template<typename Self>
auto ice::Array< Type, Logic >::data ( this Self & self) -> ice::container::ValuePtr< Self >
inlineconstexprnoexcept

◆ data_view()

template<typename Type, ice::ContainerLogic Logic>
auto ice::Array< Type, Logic >::data_view ( this Array< Type, Logic > const & self) -> ice::Data
inlineconstexprnoexcept

◆ memory_view()

template<typename Type, ice::ContainerLogic Logic>
auto ice::Array< Type, Logic >::memory_view ( this Array< Type, Logic > & self) -> ice::Memory
inlineconstexprnoexcept

◆ operator ice::Span< Type >()

template<typename Type, ice::ContainerLogic Logic>
ice::Array< Type, Logic >::operator ice::Span< Type > ( )
inlinenoexcept

◆ operator ice::Span< Type const >()

template<typename Type, ice::ContainerLogic Logic>
ice::Array< Type, Logic >::operator ice::Span< Type const > ( ) const
inlinenoexcept

◆ operator=() [1/2]

template<typename Type, ice::ContainerLogic Logic>
auto ice::Array< Type, Logic >::operator= ( Array< Type, Logic > && other) -> Array &
inlinenoexcept

◆ operator=() [2/2]

template<typename Type, ice::ContainerLogic Logic>
requires std::copy_constructible<Type>
auto ice::Array< Type, Logic >::operator= ( Array< Type, Logic > const & other) -> Array &
inlinenoexcept

◆ pop_back()

template<typename Type, ice::ContainerLogic Logic>
void ice::Array< Type, Logic >::pop_back ( ice::ncount count = 1_count)
inlinenoexcept

◆ push_back() [1/2]

template<typename Type, ice::ContainerLogic Logic>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
template<ice::concepts::IterableContainer ContainerT>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
void ice::Array< Type, Logic >::push_back ( ContainerT const & other)
inlinenoexcept

◆ push_back() [2/2]

template<typename Type, ice::ContainerLogic Logic>
requires std::convertible_to<ItemType, Type> && std::is_constructible_v<Type, ItemType>
template<typename ItemType>
requires std::convertible_to<ItemType, Type> && std::is_constructible_v<Type, ItemType>
void ice::Array< Type, Logic >::push_back ( ItemType && item)
inlinenoexcept

◆ remove_at()

template<typename Type, ice::ContainerLogic Logic>
void ice::Array< Type, Logic >::remove_at ( ice::nindex index)
inlinenoexcept

◆ resize()

template<typename Type, ice::ContainerLogic Logic>
void ice::Array< Type, Logic >::resize ( SizeType new_size)
inlineconstexprnoexcept

◆ set_capacity()

template<typename Type, ice::ContainerLogic Logic>
void ice::Array< Type, Logic >::set_capacity ( SizeType new_capacity)
inlineconstexprnoexcept

◆ size()

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
auto ice::Array< Type, Logic >::size ( ) const -> SizeType
inlineconstexprnoexcept

Member Data Documentation

◆ _allocator

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
ice::Allocator* ice::Array< Type, Logic >::_allocator

◆ _capacity

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
ice::u32 ice::Array< Type, Logic >::_capacity

◆ _count

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
ice::u32 ice::Array< Type, Logic >::_count

◆ _data

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
ValueType* ice::Array< Type, Logic >::_data

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