Brunot
Loading...
Searching...
No Matches
gobj::Path< Gobj >::iterator Class Reference

iterator member class for Path. More...

#include <Path.h>

Collaboration diagram for gobj::Path< Gobj >::iterator:
[legend]

Public Types

using difference_type = std::ptrdiff_t
using value_type = Gobj

Public Member Functions

 iterator ()=default
 defaults initializes iterator as a sentinel "Past the End" iterator
auto get () const -> Gobj *
auto operator++ () -> iterator &
 pre-increments the iterator, getting the next GameObject in the range.
auto operator++ (int) -> iterator
 post-increments the iterator, getting the next GameObject in the range
auto operator== (iterator other) const -> bool
 compares if two iterators point to the same object.
auto operator* () const -> std::add_lvalue_reference_t< Gobj >
 Gets a reference to the GameObject the iterator refers to, and casts it to Gobj as well.
auto operator-> () const -> Gobj *
 allows for calling functions on the objects an iterator refers to.

Public Attributes

friend Path

Private Member Functions

 iterator (PathNode::path_iterator itr)
 constructs a Path::iterator from a PathNode::path_iterator, which is an internal type used for logic

Private Attributes

PathNode::path_iterator itr
 Internal iterator type that is used by PathNode, and only refers to GameObjects as GameObjects.

Detailed Description

template<typename Gobj = GameObject>
class gobj::Path< Gobj >::iterator

iterator member class for Path.

iterator is both a public interface, and a wrapper class for an internal iterator type, and handles casting from GameObjects to Gobj.

Member Typedef Documentation

◆ difference_type

template<typename Gobj = GameObject>
using gobj::Path< Gobj >::iterator::difference_type = std::ptrdiff_t

◆ value_type

template<typename Gobj = GameObject>
using gobj::Path< Gobj >::iterator::value_type = Gobj

Constructor & Destructor Documentation

◆ iterator() [1/2]

template<typename Gobj = GameObject>
gobj::Path< Gobj >::iterator::iterator ( PathNode::path_iterator itr)
inlineexplicitprivate

constructs a Path::iterator from a PathNode::path_iterator, which is an internal type used for logic

Parameters
itra PathNode::iterator from
Here is the caller graph for this function:

◆ iterator() [2/2]

template<typename Gobj = GameObject>
gobj::Path< Gobj >::iterator::iterator ( )
default

defaults initializes iterator as a sentinel "Past the End" iterator

Member Function Documentation

◆ get()

template<typename Gobj = GameObject>
auto gobj::Path< Gobj >::iterator::get ( ) const->Gobj *
inline
Exceptions
PathExceptionif improper type
Returns
a pointer to the GameObject the iterator refers to, cast to the Gobj type
Here is the caller graph for this function:

◆ operator*()

template<typename Gobj = GameObject>
auto gobj::Path< Gobj >::iterator::operator* ( ) const->std::add_lvalue_reference_t< Gobj >
inline

Gets a reference to the GameObject the iterator refers to, and casts it to Gobj as well.

Exceptions
PathExceptionif the iterator points to nothing
Returns
a reference to the Gobj that the iterator refers to

◆ operator++() [1/2]

template<typename Gobj = GameObject>
auto gobj::Path< Gobj >::iterator::operator++ ( ) ->iterator &
inline

pre-increments the iterator, getting the next GameObject in the range.

If iterator at the back of the range, or range of 1, then it iterates to a "past the end" iterator

Exceptions
PathExceptionif incrementing a "past the end" iterator
Returns
a reference to this iterator
Here is the call graph for this function:

◆ operator++() [2/2]

template<typename Gobj = GameObject>
auto gobj::Path< Gobj >::iterator::operator++ ( int ) ->iterator
inline

post-increments the iterator, getting the next GameObject in the range

If iterator at the back of the range, or range of 1, then it iterates to a "past the end" iterator

Exceptions
PathExceptionif incrementing a "past the end" iterator
Returns
a reference to this iterator
a copy of this iterator, that doesn't get incremented
Here is the call graph for this function:

◆ operator->()

template<typename Gobj = GameObject>
auto gobj::Path< Gobj >::iterator::operator-> ( ) const->Gobj *
inline

allows for calling functions on the objects an iterator refers to.

Returns
a pointer to the GameObject the iterator points to
Here is the call graph for this function:

◆ operator==()

template<typename Gobj = GameObject>
auto gobj::Path< Gobj >::iterator::operator== ( iterator other) const->bool
inline

compares if two iterators point to the same object.

Parameters
otheriterator to compare with
Returns
true if iterators point to the same GameObject, false otherwise.
Here is the call graph for this function:

Member Data Documentation

◆ itr

template<typename Gobj = GameObject>
PathNode::path_iterator gobj::Path< Gobj >::iterator::itr
private

Internal iterator type that is used by PathNode, and only refers to GameObjects as GameObjects.

◆ Path

template<typename Gobj = GameObject>
friend gobj::Path< Gobj >::iterator::Path

The documentation for this class was generated from the following file:
  • /home/egrazil/sites/Brunot/The House/source/Utility/Path/Path.h