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

#include <Puma/UnitTokenSrc.h>

+ Inheritance diagram for Puma::UnitTokenSrc:

Description

Token unit iterator implementing the token source interface.

Public Member Functions

 UnitTokenSrc (Unit &unit)
 Constructor. More...
 
void current (Token *token)
 Set the current token in the unit that is iterated. More...
 
Tokennext ()
 Get the next token in the unit. More...
 
Tokencurrent () const
 Get the current token in the unit. More...
 
Unitunit () const
 Get the token being iterated. More...
 
bool hasNext () const
 Check if the current token is not the last in the unit. More...
 
- Public Member Functions inherited from Puma::TokenSource
virtual ~TokenSource ()
 Destructor. More...
 
virtual Tokennext ()=0
 Get the next token. More...
 

Constructor & Destructor Documentation

◆ UnitTokenSrc()

Puma::UnitTokenSrc::UnitTokenSrc ( Unit unit)
inline

Constructor.

Parameters
unitThe unit to iterate.

Member Function Documentation

◆ current() [1/2]

Token * Puma::UnitTokenSrc::current ( ) const
inline

Get the current token in the unit.

Returns
A pointer to the current token.

◆ current() [2/2]

void Puma::UnitTokenSrc::current ( Token token)
inline

Set the current token in the unit that is iterated.

Parameters
tokenThe new current token.

◆ hasNext()

bool Puma::UnitTokenSrc::hasNext ( ) const
inline

Check if the current token is not the last in the unit.

Returns
True, if the end of the unit isn't reached yet.

◆ next()

Token * Puma::UnitTokenSrc::next ( )
inlinevirtual

Get the next token in the unit.

Returns
A pointer to the next token.

Implements Puma::TokenSource.

◆ unit()

Unit * Puma::UnitTokenSrc::unit ( ) const
inline

Get the token being iterated.

Returns
A pointer to the unit.