PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::UnitIterator Class Reference

#include <Puma/UnitIterator.h>

Description

Token unit iterator supporting iteration from the beginning of a unit or any token within that unit.

Public Member Functions

 UnitIterator ()
 Construct an empty iterator.
 
 UnitIterator (Unit &unit)
 Constructor.
 
 UnitIterator (ListElement &token)
 Constructor.
 
UnitIteratoroperator= (Unit &unit)
 Reset the iterator to iterate a unit starting at its first token.
 
UnitIteratoroperator= (ListElement &token)
 Reset the iterator to iterate a unit starting at the given token.
 
UnitIteratoroperator++ ()
 Move on to the next token in the unit.
 
UnitIteratoroperator-- ()
 Go back to the previous token in the unit.
 
Tokenoperator* () const
 Get the current token in the unit.
 
Tokenoperator-> () const
 Call a member on the current token.
 

Constructor & Destructor Documentation

◆ UnitIterator() [1/3]

Puma::UnitIterator::UnitIterator ( )

Construct an empty iterator.

◆ UnitIterator() [2/3]

Puma::UnitIterator::UnitIterator ( Unit & unit)

Constructor.

Iterates a unit starting at its first token.

Parameters
unitThe unit to iterate.

◆ UnitIterator() [3/3]

Puma::UnitIterator::UnitIterator ( ListElement & token)

Constructor.

Iterates a unit starting at the given token.

Parameters
tokenThe token from which to start to iterate.

Member Function Documentation

◆ operator*()

Token * Puma::UnitIterator::operator* ( ) const

Get the current token in the unit.

Returns
A pointer to the current token.

◆ operator++()

UnitIterator & Puma::UnitIterator::operator++ ( )

Move on to the next token in the unit.

Returns
A reference to this iterator.

◆ operator--()

UnitIterator & Puma::UnitIterator::operator-- ( )

Go back to the previous token in the unit.

Returns
A reference to this iterator.

◆ operator->()

Token * Puma::UnitIterator::operator-> ( ) const

Call a member on the current token.

Returns
A pointer to the current token on which the member is called.

◆ operator=() [1/2]

UnitIterator & Puma::UnitIterator::operator= ( ListElement & token)

Reset the iterator to iterate a unit starting at the given token.

Parameters
tokenThe token from which to start to iterate.
Returns
A reference to this iterator.

◆ operator=() [2/2]

UnitIterator & Puma::UnitIterator::operator= ( Unit & unit)

Reset the iterator to iterate a unit starting at its first token.

Parameters
unitThe unit to iterate.
Returns
A reference to this iterator.