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

#include <bidilist.hpp>

Inheritance diagram for BidiListIterator< TConstOrMutableElement >:
[legend]
Collaboration diagram for BidiListIterator< TConstOrMutableElement >:
[legend]

Class Description

template<typename TConstOrMutableElement>
struct aworx::lib::BidiListIterator< TConstOrMutableElement >


Implementation of std::iterator for types BidiNode and BidiList.

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

Note
Iterators of this type may be received with the common begin/end methods found in type BidiList, but also be created autonomously by passing a pointer to TElement to the corresponding public constructor.
Template Parameters
TConstOrMutableElementThe "final" element type that by contract is derived from struct BidiNode in either constant or mutable version.

Definition at line 25 of file bidilist.hpp.

Public Types

using TMutableNode = BidiNode< typename std::remove_const< TConstOrMutableElement >::type >
 

Public Methods

 BidiListIterator () noexcept=default
 
template<typename TMutable >
 BidiListIterator (const TMutable &mutableIt)
 
 BidiListIterator (TConstOrMutableElement *start) noexcept
 
bool operator!= (BidiListIterator other) const noexcept
 
TConstOrMutableElement & operator* () const
 
BidiListIteratoroperator++ () noexcept
 
BidiListIterator operator++ (int) noexcept
 
BidiListIteratoroperator-- ()
 
BidiListIterator operator-- (int)
 
TConstOrMutableElement * operator-> () const
 
BidiListIteratoroperator= (TConstOrMutableElement *elem) noexcept
 
bool operator== (BidiListIterator other) const noexcept
 

Private Fields

TConstOrMutableElement * element
 

Member Typedef Documentation

◆ TMutableNode

using TMutableNode = BidiNode<typename std::remove_const<TConstOrMutableElement>::type>

The element type: either const or mutable Element.

Definition at line 204 of file bidilist.hpp.

Constructor & Destructor Documentation

◆ BidiListIterator() [1/3]

BidiListIterator ( )
defaultnoexcept

Default constructor creating an invalid iterator.

Here is the caller graph for this function:

◆ BidiListIterator() [2/3]

BidiListIterator ( TConstOrMutableElement *  start)
inlinenoexcept

Constructor.

Parameters
startPointer to the initial element.

Definition at line 218 of file bidilist.hpp.

◆ BidiListIterator() [3/3]

BidiListIterator ( const TMutable &  mutableIt)
inline

Copy constructor accepting a mutable iterator. Available only for the constant version of this iterator.

Template Parameters
TMutableThe type of this constructor's argument.
Parameters
mutableItMutable iterator to copy from.

Member Function Documentation

◆ operator!=()

bool operator!= ( BidiListIterator< TConstOrMutableElement >  other) const
inlinenoexcept

Comparison operator.

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

Definition at line 281 of file bidilist.hpp.

◆ operator*()

TConstOrMutableElement& operator* ( ) const
inline

Retrieves a reference to the referred element.

Returns
A reference to the referred element.

Definition at line 309 of file bidilist.hpp.

◆ operator++() [1/2]

BidiListIterator& operator++ ( )
inlinenoexcept

Prefix increment operator.

Returns
A reference to this object.

Definition at line 256 of file bidilist.hpp.

◆ operator++() [2/2]

BidiListIterator operator++ ( int  )
inlinenoexcept

Postfix increment operator.

Returns
An iterator value that is not increased, yet.

Definition at line 264 of file bidilist.hpp.

Here is the call graph for this function:

◆ operator--() [1/2]

BidiListIterator& operator-- ( )
inline

Prefix decrement operator.

Returns
A reference to this object.

Definition at line 290 of file bidilist.hpp.

◆ operator--() [2/2]

BidiListIterator operator-- ( int  )
inline

Postfix decrement operator.

Returns
The iterator value prior the decrement operation.

Definition at line 298 of file bidilist.hpp.

◆ operator->()

TConstOrMutableElement* operator-> ( ) const
inline

Retrieves a pointer to the referred element.

Returns
A pointer to the referred element.

Definition at line 316 of file bidilist.hpp.

◆ operator=()

BidiListIterator& operator= ( TConstOrMutableElement *  elem)
inlinenoexcept

Assign operator from element type.

Parameters
elemThe element to refer to.
Returns
A reference to this.

Definition at line 243 of file bidilist.hpp.

◆ operator==()

bool operator== ( BidiListIterator< TConstOrMutableElement >  other) const
inlinenoexcept

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 273 of file bidilist.hpp.

Member Data Documentation

◆ element

TConstOrMutableElement* element
private

The start of the list.

Definition at line 208 of file bidilist.hpp.


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