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

A double ended queue, build on a circular buffer. More...

#include <ice/queue.hxx>

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

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

 Queue (ice::Allocator &alloc) noexcept
 Queue (Queue &&other) noexcept
 Queue (Queue const &other) noexcept
 ~Queue () noexcept
constexpr auto size () const noexcept -> ice::ncount
constexpr auto capacity () const noexcept -> ice::ncount
constexpr void set_capacity (ice::ncount new_capacity) noexcept
constexpr void resize (ice::ncount new_size) noexcept
constexpr void clear () noexcept
template<typename ItemType = Type>
requires std::convertible_to<ItemType, Type> && std::is_constructible_v<Type, ItemType>
constexpr void push_front (ItemType &&item) noexcept
template<typename ItemType = Type>
requires std::convertible_to<ItemType, Type> && std::is_constructible_v<Type, ItemType>
constexpr void push_back (ItemType &&item) noexcept
template<ice::concepts::ContiguousContainer ContainerT>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
constexpr void push_front (ContainerT const &other) noexcept
template<ice::concepts::ContiguousContainer ContainerT>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
constexpr void push_back (ContainerT const &other) noexcept
constexpr void pop_front (ice::ncount count=1_count) noexcept
constexpr void pop_back (ice::ncount count=1_count) noexcept
template<typename Self>
constexpr auto front (this Self &&self) noexcept -> ice::container::ValueRef< Self >
template<typename Self>
constexpr auto back (this Self &&self) noexcept -> ice::container::ValueRef< Self >
template<typename Self, typename Fn>
constexpr void for_each (this Self &&self, Fn &&fn) noexcept
template<typename Self, typename Fn>
constexpr void for_each_reverse (this Self &&self, Fn &&fn) noexcept
template<typename Self>
constexpr auto take_front (this Self &&self, ice::Span< Type > out_values) noexcept -> ice::ncount
constexpr auto memory_view (this Queue &self) noexcept -> ice::Memory
auto operator= (Queue &&other) noexcept -> Queue &
auto operator= (Queue const &other) noexcept -> Queue &
template<typename Self>
constexpr auto operator[] (this Self &&self, ice::nindex idx) noexcept -> ice::container::ValueRef< Self >
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
ice::u32 _offset
Type * _data

Detailed Description

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

A double ended queue, build on a circular buffer.

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. This value is set by the user to enforce expected behavior for stored types.

Member Typedef Documentation

◆ ConstContainerValueType

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

◆ ConstIterator

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

◆ ConstReverseIterator

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

◆ ContainerTag

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

◆ Iterator

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

◆ ReverseIterator

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

◆ SizeType

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

◆ ValueType

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

Constructor & Destructor Documentation

◆ Queue() [1/3]

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

◆ Queue() [2/3]

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

◆ Queue() [3/3]

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

◆ ~Queue()

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

Member Function Documentation

◆ back()

template<typename Type, ice::ContainerLogic Logic>
template<typename Self>
auto ice::Queue< Type, Logic >::back ( this Self && self) -> ice::container::ValueRef< Self >
inlineconstexprnoexcept

◆ capacity()

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

◆ clear()

template<typename Type, ice::ContainerLogic Logic>
void ice::Queue< Type, Logic >::clear ( )
constexprnoexcept

◆ for_each()

template<typename Type, ice::ContainerLogic Logic>
template<typename Self, typename Fn>
void ice::Queue< Type, Logic >::for_each ( this Self && self,
Fn && fn )
inlineconstexprnoexcept

◆ for_each_reverse()

template<typename Type, ice::ContainerLogic Logic>
template<typename Self, typename Fn>
void ice::Queue< Type, Logic >::for_each_reverse ( this Self && self,
Fn && fn )
inlineconstexprnoexcept

◆ front()

template<typename Type, ice::ContainerLogic Logic>
template<typename Self>
auto ice::Queue< Type, Logic >::front ( this Self && self) -> ice::container::ValueRef< Self >
inlineconstexprnoexcept

◆ memory_view()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator[]()

template<typename Type, ice::ContainerLogic Logic>
template<typename Self>
auto ice::Queue< Type, Logic >::operator[] ( this Self && self,
ice::nindex idx ) -> ice::container::ValueRef< Self >
constexprnoexcept

◆ pop_back()

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

◆ pop_front()

template<typename Type, ice::ContainerLogic Logic>
void ice::Queue< Type, Logic >::pop_front ( ice::ncount count = 1_count)
inlineconstexprnoexcept

◆ push_back() [1/2]

template<typename Type, ice::ContainerLogic Logic>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
template<ice::concepts::ContiguousContainer ContainerT>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
void ice::Queue< Type, Logic >::push_back ( ContainerT const & other)
inlineconstexprnoexcept

◆ 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::Queue< Type, Logic >::push_back ( ItemType && item)
inlineconstexprnoexcept

◆ push_front() [1/2]

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
template<ice::concepts::ContiguousContainer ContainerT>
requires (ice::concepts::CompatibleContainer<Type, ContainerT>)
void ice::Queue< Type, Logic >::push_front ( ContainerT const & other)
constexprnoexcept

◆ push_front() [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::Queue< Type, Logic >::push_front ( ItemType && item)
inlineconstexprnoexcept

◆ resize()

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

◆ set_capacity()

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

◆ size()

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

◆ take_front()

template<typename Type, ice::ContainerLogic Logic>
template<typename Self>
auto ice::Queue< Type, Logic >::take_front ( this Self && self,
ice::Span< Type > out_values ) -> ice::ncount
inlineconstexprnoexcept

Member Data Documentation

◆ _allocator

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

◆ _capacity

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

◆ _count

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

◆ _data

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

◆ _offset

template<typename Type, ice::ContainerLogic Logic = ice::Constant_DefaultContainerLogic<Type>>
ice::u32 ice::Queue< Type, Logic >::_offset

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