PUMA Library Reference Manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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. More...
 
 UnitIterator (Unit &unit)
 Constructor. More...
 
 UnitIterator (ListElement &token)
 Constructor. More...
 
UnitIteratoroperator= (Unit &unit)
 Reset the iterator to iterate a unit starting at its first token. More...
 
UnitIteratoroperator= (ListElement &token)
 Reset the iterator to iterate a unit starting at the given token. More...
 
UnitIteratoroperator++ ()
 Move on to the next token in the unit. More...
 
UnitIteratoroperator-- ()
 Go back to the previous token in the unit. More...
 
Tokenoperator* () const
 Get the current token in the unit. More...
 
Tokenoperator-> () const
 Call a member on the current token. More...
 

Constructor & Destructor Documentation

Puma::UnitIterator::UnitIterator ( )

Construct an empty iterator.

Puma::UnitIterator::UnitIterator ( Unit unit)

Constructor.

Iterates a unit starting at its first token.

Parameters
unitThe unit to iterate.
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

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

Get the current token in the unit.

Returns
A pointer to the current token.
UnitIterator& Puma::UnitIterator::operator++ ( )

Move on to the next token in the unit.

Returns
A reference to this iterator.
UnitIterator& Puma::UnitIterator::operator-- ( )

Go back to the previous token in the unit.

Returns
A reference to this iterator.
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.
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.
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.