ALib C++ Library
Library Version: 1912 R0
Documentation generated by doxygen
Public Methods | Private Fields | List of all members
ForwardListIterator< TElement > Struct Template Reference

#include <forwardlist.hpp>

Inheritance diagram for ForwardListIterator< TElement >:
[legend]
Collaboration diagram for ForwardListIterator< TElement >:
[legend]

Class Description

template<typename TElement>
struct aworx::lib::ForwardListIterator< TElement >


Implementation of std::iterator for types ForwardNode and ForwardList.

As the name of the class indicates, this iterator satisfies the C++ standard library concept ForwardIterator .

Note
Iterators of this type may be received with the common begin/end methods found in types ForwardNode and ForwardList, but also be created autonomously by passing a pointer to TElement to the corresponding public constructor.
Template Parameters
TElementThe "final" element type that by contract is derived from struct ForwardNode.

Definition at line 23 of file forwardlist.hpp.

Public Methods

 ForwardListIterator (TElement *start) noexcept
 
bool operator!= (ForwardListIterator other) const
 
TElement & operator* () const
 
ForwardListIteratoroperator++ ()
 
ForwardListIterator operator++ (int)
 
TElement * operator-> () const
 
bool operator== (ForwardListIterator other) const
 

Private Fields

TElement * element
 

Constructor & Destructor Documentation

◆ ForwardListIterator()

ForwardListIterator ( TElement *  start)
inlinenoexcept

Constructor.

Parameters
startPointer to the initial element.

Definition at line 338 of file forwardlist.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ operator!=()

bool operator!= ( ForwardListIterator< TElement >  other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and given iterator are not equal, false otherwise.

Definition at line 371 of file forwardlist.hpp.

◆ operator*()

TElement& operator* ( ) const
inline

Retrieves a reference to the referred element.

Returns
A reference to the referred element.

Definition at line 380 of file forwardlist.hpp.

◆ operator++() [1/2]

ForwardListIterator& operator++ ( )
inline

Prefix increment operator.

Returns
A reference to this object.

Definition at line 346 of file forwardlist.hpp.

◆ operator++() [2/2]

ForwardListIterator operator++ ( int  )
inline

Postfix increment operator.

Returns
An iterator value that is not increased, yet.

Definition at line 354 of file forwardlist.hpp.

Here is the call graph for this function:

◆ operator->()

TElement* operator-> ( ) const
inline

Retrieves a pointer to the referred element.

Returns
A pointer to the referred element.

Definition at line 387 of file forwardlist.hpp.

◆ operator==()

bool operator== ( ForwardListIterator< TElement >  other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and the given iterator are pointing to the same element, false otherwise.

Definition at line 363 of file forwardlist.hpp.

Member Data Documentation

◆ element

TElement* element
private

The current element this iterator refers to.

Definition at line 332 of file forwardlist.hpp.


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