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

Read-only iterator over elements in paged storage. More...

#include <paged_storage.h>

Public Types

using value_type = T
 Element type.
 
using pointer = const T *
 Pointer to a read-only element.
 
using reference = const T &
 Reference to a read-only 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 = const_page_iterator
 Iterator type.
 
using iterator_category = core::bidirectional_iterator_tag
 Iterator category tag.
 

Public Member Functions

 const_page_iterator (const page_type *pPage)
 Constructs an end iterator at a page boundary.
 
 const_page_iterator (const page_type *pPage, const page_type *pPageLast)
 Constructs a read-only 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::const_page_iterator< T, Allocator, IsFwd >

Read-only iterator over elements in paged storage.

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

Constructor & Destructor Documentation

◆ const_page_iterator() [1/2]

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

Constructs an end iterator at a page boundary.

Parameters
pPageBoundary page.

◆ const_page_iterator() [2/2]

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

Constructs a read-only 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::const_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::const_page_iterator< T, Allocator, IsFwd >::operator* ( ) const
inline

Accesses the current element.

Returns
Read-only reference to the current element.

◆ operator++() [1/2]

template<typename T , typename Allocator , bool IsFwd>
iterator & gaia::cnt::const_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::const_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::const_page_iterator< T, Allocator, IsFwd >::operator-> ( ) const
inline

Accesses the current element through a pointer.

Returns
Read-only pointer to the current element.

◆ operator==()

template<typename T , typename Allocator , bool IsFwd>
GAIA_NODISCARD bool gaia::cnt::const_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: