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

Forward iterator over an intrusive fwd_llist. More...

#include <fwd_llist.h>

Public Types

using iterator_category = core::forward_iterator_tag
 Iterator category tag.
 
using value_type = T
 Node value type.
 
using pointer = T *
 Pointer to a node.
 
using reference = T &
 Reference to a node.
 
using difference_type = uint32_t
 Type used for iterator distances.
 
using size_type = uint32_t
 Type used for sizes.
 
using iterator = fwd_llist_iterator
 Iterator type.
 

Public Member Functions

 fwd_llist_iterator (T *pNode)
 Constructs an iterator at a node.
 
reference operator* () const
 Dereferences the current node.
 
pointer operator-> () const
 Accesses the current node.
 
iteratoroperator++ ()
 Advances to the next linked node.
 
iterator operator++ (int)
 Advances to the next linked node.
 
GAIA_NODISCARD bool operator== (const iterator &other) const
 Compares iterator positions.
 
GAIA_NODISCARD bool operator!= (const iterator &other) const
 Compares iterator positions.
 

Detailed Description

template<typename T>
struct gaia::cnt::fwd_llist_iterator< T >

Forward iterator over an intrusive fwd_llist.

Template Parameters
TNode type, optionally const-qualified.

Constructor & Destructor Documentation

◆ fwd_llist_iterator()

template<typename T >
gaia::cnt::fwd_llist_iterator< T >::fwd_llist_iterator ( T pNode)
inlineexplicit

Constructs an iterator at a node.

Parameters
pNodeCurrent node, or nullptr for the end sentinel.

Member Function Documentation

◆ operator!=()

template<typename T >
GAIA_NODISCARD bool gaia::cnt::fwd_llist_iterator< T >::operator!= ( const iterator other) const
inline

Compares iterator positions.

Parameters
otherIterator to compare with.
Returns
True when the iterators refer to different nodes.

◆ operator*()

template<typename T >
reference gaia::cnt::fwd_llist_iterator< T >::operator* ( ) const
inline

Dereferences the current node.

Returns
Reference to the current node.

◆ operator++() [1/2]

template<typename T >
iterator & gaia::cnt::fwd_llist_iterator< T >::operator++ ( )
inline

Advances to the next linked node.

Returns
This iterator after advancement.

◆ operator++() [2/2]

template<typename T >
iterator gaia::cnt::fwd_llist_iterator< T >::operator++ ( int  )
inline

Advances to the next linked node.

Returns
Iterator value before advancement.

◆ operator->()

template<typename T >
pointer gaia::cnt::fwd_llist_iterator< T >::operator-> ( ) const
inline

Accesses the current node.

Returns
Pointer to the current node.

◆ operator==()

template<typename T >
GAIA_NODISCARD bool gaia::cnt::fwd_llist_iterator< T >::operator== ( const iterator other) const
inline

Compares iterator positions.

Parameters
otherIterator to compare with.
Returns
True when both iterators refer to the same node.

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