Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::cnt::page_iterator< T, Allocator, IsFwd > Struct Template Reference

Iterator over elements in paged storage. More...

#include <paged_storage.h>

Public Types

using value_type = T
 Element type.
 
using pointer = T *
 Pointer to an element.
 
using reference = T &
 Reference to an element.
 
using difference_type = detail::difference_type
 Type used for iterator distances.
 
using size_type = detail::size_type
 Type used for sizes and indices.
 
using iterator = page_iterator
 Iterator type.
 
using iterator_category = core::bidirectional_iterator_tag
 Iterator category tag.
 

Public Member Functions

 page_iterator (page_type *pPage)
 Constructs an end iterator at a page boundary.
 
 page_iterator (page_type *pPage, page_type *pPageLast)
 Constructs an iterator over a page range.
 
reference operator* () const
 Accesses the current element.
 
pointer operator-> () const
 Accesses the current element through a pointer.
 
iteratoroperator++ ()
 Advances to the next element.
 
iterator operator++ (int)
 Advances to the next element.
 
GAIA_NODISCARD bool operator== (const iterator &other) const
 Checks whether two iterators have the same position.
 
GAIA_NODISCARD bool operator!= (const iterator &other) const
 Checks whether two iterators have different positions.
 

Detailed Description

template<typename T, typename Allocator, bool IsFwd>
struct gaia::cnt::page_iterator< T, Allocator, IsFwd >

Iterator over elements in paged storage.

Template Parameters
TElement type.
AllocatorPage allocator type.
IsFwdWhether iteration proceeds forward.

Constructor & Destructor Documentation

◆ page_iterator() [1/2]

template<typename T , typename Allocator , bool IsFwd>
gaia::cnt::page_iterator< T, Allocator, IsFwd >::page_iterator ( page_type *  pPage)
inline

Constructs an end iterator at a page boundary.

Parameters
pPageBoundary page.

◆ page_iterator() [2/2]

template<typename T , typename Allocator , bool IsFwd>
gaia::cnt::page_iterator< T, Allocator, IsFwd >::page_iterator ( page_type *  pPage,
page_type *  pPageLast 
)
inline

Constructs an iterator over a page range.

Parameters
pPageFirst page to inspect.
pPageLastPage marking the range boundary.

Member Function Documentation

◆ operator!=()

template<typename T , typename Allocator , bool IsFwd>
GAIA_NODISCARD bool gaia::cnt::page_iterator< T, Allocator, IsFwd >::operator!= ( const iterator other) const
inline

Checks whether two iterators have different positions.

Parameters
otherIterator to compare with.
Returns
True if the iterators have different positions.

◆ operator*()

template<typename T , typename Allocator , bool IsFwd>
reference gaia::cnt::page_iterator< T, Allocator, IsFwd >::operator* ( ) const
inline

Accesses the current element.

Returns
Reference to the current element.

◆ operator++() [1/2]

template<typename T , typename Allocator , bool IsFwd>
iterator & gaia::cnt::page_iterator< T, Allocator, IsFwd >::operator++ ( )
inline

Advances to the next element.

Returns
Reference to this advanced iterator.

◆ operator++() [2/2]

template<typename T , typename Allocator , bool IsFwd>
iterator gaia::cnt::page_iterator< T, Allocator, IsFwd >::operator++ ( int  )
inline

Advances to the next element.

Returns
Iterator value before advancement.

◆ operator->()

template<typename T , typename Allocator , bool IsFwd>
pointer gaia::cnt::page_iterator< T, Allocator, IsFwd >::operator-> ( ) const
inline

Accesses the current element through a pointer.

Returns
Pointer to the current element.

◆ operator==()

template<typename T , typename Allocator , bool IsFwd>
GAIA_NODISCARD bool gaia::cnt::page_iterator< T, Allocator, IsFwd >::operator== ( const iterator other) const
inline

Checks whether two iterators have the same position.

Parameters
otherIterator to compare with.
Returns
True if both iterators have the same position.

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