Class CTokenList#

Inheritance Relationships#

Base Type#

  • public std::list< CToken >

Class Documentation#

class CTokenList : public std::list<CToken>#

Token list class with extra functions to navigate through the list safely.

Unnamed Group

void push_front(const CToken &rToken)#

Add a token to the front of the list. Overload of std::list::push_front.

Parameters:

rToken[inout] Reference to the token to insert.

void push_front(CToken &&rToken)#

Add a token to the front of the list. Overload of std::list::push_front.

Parameters:

rToken[inout] Reference to the token to insert.

Unnamed Group

void push_back(const CToken &rToken)#

Add a token to the end of the list. Overload of std::list::push_back.

Parameters:

rToken[inout] Reference to the token to insert.

void push_back(CToken &&rToken)#

Add a token to the end of the list. Overload of std::list::push_back.

Parameters:

rToken[inout] Reference to the token to insert.

Unnamed Group

void insert(const CToken &rToken)#

Insert a token at the current position in the list, moving the current position to the newly inserted token. Loose overload of std::list::insert.

Parameters:

rToken[inout] Reference to the token to insert.

void insert(CToken &&rToken)#

Insert a token at the current position in the list, moving the current position to the newly inserted token. Loose overload of std::list::insert.

Parameters:

rToken[inout] Reference to the token to insert.

Public Functions

CTokenList()#

Default constructor.

CTokenList(const CTokenList &rlstTokens)#

Copy constructor.

Parameters:

rlstTokens[in] Reference to the token list.

CTokenList(CTokenList &&rlstTokens) noexcept#

Move constructor.

Parameters:

rlstTokens[in] Reference to the token list.

CTokenList &operator=(const CTokenList &rlstTokens)#

Assignment operator.

Parameters:

rlstTokens[in] Reference to the token list.

Returns:

Reference to this tokenlist.

CTokenList &operator=(CTokenList &&rlstTokens) noexcept#

Move operator.

Parameters:

rlstTokens[in] Reference to the token list.

Returns:

Reference to this tokenlist.

const CToken &Current(size_t nIndex = 0) const#

Get the token relative to the current position or if not valid an empty token.

Parameters:

nIndex[in] The amount of tokens to skip before returning the token.

Returns:

Reference to the token.

const CToken &LastValid() const#

Get the current or last valid token. If there is no token, get an empty token.

Returns:

Reference to the current token.

CTokenList operator++(int) const#

Increase the current token to the next position in the tokenlist.

Returns:

Copy of this tokenlist before incrementation.

const CTokenList &operator++() const#

Increase the current token to the next position in the tokenlist.

Returns:

Reference to this tokenlist.

bool End() const#

Returns whether the current token has reached the end of the list or whether the list is empty.

Returns:

Returns ‘true’ when the end of the token list has been reached; otherwise ‘false’.

void pop_front()#

Removes the first element of the container. Overload of std::list::pop_front.

void pop_back()#

Removes the last element of the container. Overload of std::list::pop_front.

template<class ...Args>
CToken &emplace_back(Args&&... args)#

Create a token with the supplied arguments and place it at the end of the list.

Template Parameters:

Args – The argument types

Parameters:

args[in] The arguments

Returns:

Reference to the token added.