Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::cnt::paged_ilist_iterator< TPagedIList, IsConst > Class Template Reference

Forward iterator used by paged_ilist. Kept outside the container template so the container body stays smaller to compile. More...

#include <ilist.h>

Public Types

using value_type = typename TPagedIList::value_type
 Stored payload type.
 
using reference = std::conditional_t< IsConst, typename TPagedIList::const_reference, typename TPagedIList::reference >
 Reference type selected from iterator constness.
 
using pointer = std::conditional_t< IsConst, typename TPagedIList::const_pointer, typename TPagedIList::pointer >
 Pointer type selected from iterator constness.
 
using difference_type = typename TPagedIList::difference_type
 Type used for iterator distances.
 
using iterator_category = core::forward_iterator_tag
 Iterator category tag.
 

Public Member Functions

 paged_ilist_iterator (owner_pointer pOwner, typename TPagedIList::size_type index)
 
GAIA_NODISCARD reference operator* () const
 Dereferences the current live payload.
 
GAIA_NODISCARD pointer operator-> () const
 Accesses the current live payload.
 
paged_ilist_iteratoroperator++ ()
 Advances to the next live payload.
 
paged_ilist_iterator operator++ (int)
 Advances to the next live payload.
 
GAIA_NODISCARD bool operator== (const paged_ilist_iterator &other) const
 Compares iterator positions and owners.
 
GAIA_NODISCARD bool operator!= (const paged_ilist_iterator &other) const
 Compares iterator positions and owners.
 

Detailed Description

template<typename TPagedIList, bool IsConst>
class gaia::cnt::paged_ilist_iterator< TPagedIList, IsConst >

Forward iterator used by paged_ilist. Kept outside the container template so the container body stays smaller to compile.

Template Parameters
TPagedIListOwning paged_ilist type.
IsConstWhether the iterator yields const references.

Constructor & Destructor Documentation

◆ paged_ilist_iterator()

template<typename TPagedIList , bool IsConst>
gaia::cnt::paged_ilist_iterator< TPagedIList, IsConst >::paged_ilist_iterator ( owner_pointer  pOwner,
typename TPagedIList::size_type  index 
)
inline
Parameters
pOwnerOwning paged list.
indexInitial slot index.

Member Function Documentation

◆ operator!=()

template<typename TPagedIList , bool IsConst>
GAIA_NODISCARD bool gaia::cnt::paged_ilist_iterator< TPagedIList, IsConst >::operator!= ( const paged_ilist_iterator< TPagedIList, IsConst > &  other) const
inline

Compares iterator positions and owners.

Parameters
otherIterator to compare with.
Returns
True when the iterators differ.

◆ operator*()

template<typename TPagedIList , bool IsConst>
GAIA_NODISCARD reference gaia::cnt::paged_ilist_iterator< TPagedIList, IsConst >::operator* ( ) const
inline

Dereferences the current live payload.

Returns
Reference to the current payload.

◆ operator++() [1/2]

Advances to the next live payload.

Returns
This iterator after advancement.

◆ operator++() [2/2]

Advances to the next live payload.

Returns
Iterator value before advancement.

◆ operator->()

template<typename TPagedIList , bool IsConst>
GAIA_NODISCARD pointer gaia::cnt::paged_ilist_iterator< TPagedIList, IsConst >::operator-> ( ) const
inline

Accesses the current live payload.

Returns
Pointer to the current payload.

◆ operator==()

template<typename TPagedIList , bool IsConst>
GAIA_NODISCARD bool gaia::cnt::paged_ilist_iterator< TPagedIList, IsConst >::operator== ( const paged_ilist_iterator< TPagedIList, IsConst > &  other) const
inline

Compares iterator positions and owners.

Parameters
otherIterator to compare with.
Returns
True when both iterators have the same owner and slot index.

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