A class representing a list of tokens.
More...
#include <tokenList.hpp>
|
| | TokenList () |
| |
| | TokenList (const TokenList &) |
| |
| | TokenList (const std::vector< std::any > &data, size_t nextIndex=0) |
| | Construct a TokenList object from a vector of std::any.
|
| |
| | TokenList (const std::initializer_list< std::any > &initList) |
| | Construct a TokenList object from an initializer list of std::any.
|
| |
| void | insert (const std::any &value) |
| | Inserts a value into the token list.
|
| |
| void | remove (size_t index) |
| | Removes a value from the token list based on the specified index.
|
| |
| bool | empty () const |
| | Checks if the token list is empty.
|
| |
| template<typename ReturnType > |
| ReturnType | popFront () |
| | Removes first entry of TokenList and returns it.
|
| |
| size_t | size () const |
| | Retrieves the size of the token list.
|
| |
| template<typename ReturnType > |
| ReturnType & | get (const size_t &idx) |
| | Retrieves the value associated with the given index, casting it to the specified type.
|
| |
| template<typename ReturnType > |
| ReturnType & | next () |
| | Retrieves the value associated with the nextIndex, casting it to the specified type.
|
| |
| template<typename ReturnType > |
| const ReturnType & | get (const size_t &idx) const |
| | Retrieves the value associated with the given index, casting it to the specified type.
|
| |
| template<typename ReturnType > |
| const ReturnType & | next () const |
| | Retrieves the value associated with the nextIndex, casting it to the specified type.
|
| |
| std::any & | operator[] (const size_t &idx) |
| | Retrieves the value associated with the given index.
|
| |
| std::vector< std::any > & | tokens () |
| |
A class representing a list of tokens.
The TokenList class provides functionality to store and manipulate a list of tokens. It supports insertion, removal, and retrieval of tokens of any type using std::any.
Definition at line 28 of file tokenList.hpp.
◆ TokenList() [1/4]
| NeoN::TokenList::TokenList |
( |
| ) |
|
◆ TokenList() [2/4]
| NeoN::TokenList::TokenList |
( |
const TokenList & |
| ) |
|
◆ TokenList() [3/4]
| NeoN::TokenList::TokenList |
( |
const std::vector< std::any > & |
data, |
|
|
size_t |
nextIndex = 0 |
|
) |
| |
Construct a TokenList object from a vector of std::any.
- Parameters
-
| data | A vector of std::any. |
◆ TokenList() [4/4]
| NeoN::TokenList::TokenList |
( |
const std::initializer_list< std::any > & |
initList | ) |
|
Construct a TokenList object from an initializer list of std::any.
- Parameters
-
| initList | An initializer list of std::any. |
◆ empty()
| bool NeoN::TokenList::empty |
( |
| ) |
const |
Checks if the token list is empty.
- Returns
- True if the token list is empty, false otherwise.
◆ get() [1/2]
template<typename ReturnType >
| ReturnType & NeoN::TokenList::get |
( |
const size_t & |
idx | ) |
|
|
inline |
Retrieves the value associated with the given index, casting it to the specified type.
- Template Parameters
-
| T | The type to cast the value to. |
- Parameters
-
| idx | The index to retrieve the value for. |
- Returns
- A reference to the value associated with the index, casted to type T.
Definition at line 95 of file tokenList.hpp.
◆ get() [2/2]
template<typename ReturnType >
| const ReturnType & NeoN::TokenList::get |
( |
const size_t & |
idx | ) |
const |
|
inline |
Retrieves the value associated with the given index, casting it to the specified type.
- Template Parameters
-
| T | The type to cast the value to. |
- Parameters
-
| idx | The index to retrieve the value for. |
- Returns
- A const reference to the value associated with the index, casted to type T.
Definition at line 137 of file tokenList.hpp.
◆ insert()
| void NeoN::TokenList::insert |
( |
const std::any & |
value | ) |
|
Inserts a value into the token list.
- Parameters
-
| value | The value to insert. |
◆ next() [1/2]
template<typename ReturnType >
| ReturnType & NeoN::TokenList::next |
( |
| ) |
|
|
inline |
Retrieves the value associated with the nextIndex, casting it to the specified type.
- Template Parameters
-
| T | The type to cast the value to. |
- Returns
- A reference to the value associated with the index, casted to type T.
Definition at line 121 of file tokenList.hpp.
◆ next() [2/2]
template<typename ReturnType >
| const ReturnType & NeoN::TokenList::next |
( |
| ) |
const |
|
inline |
Retrieves the value associated with the nextIndex, casting it to the specified type.
- Template Parameters
-
| T | The type to cast the value to. |
- Returns
- A const reference to the value associated with the index, casted to type T.
Definition at line 163 of file tokenList.hpp.
◆ operator[]()
| std::any & NeoN::TokenList::operator[] |
( |
const size_t & |
idx | ) |
|
Retrieves the value associated with the given index.
- Parameters
-
| idx | The index to retrieve the value for. |
- Returns
- A reference to the value associated with the index.
◆ popFront()
template<typename ReturnType >
| ReturnType NeoN::TokenList::popFront |
( |
| ) |
|
|
inline |
Removes first entry of TokenList and returns it.
- Template Parameters
-
| T | The type to cast the value to. |
- Returns
- The first value.
Definition at line 73 of file tokenList.hpp.
◆ remove()
| void NeoN::TokenList::remove |
( |
size_t |
index | ) |
|
Removes a value from the token list based on the specified index.
- Parameters
-
| index | The index of the value to remove. |
◆ size()
| size_t NeoN::TokenList::size |
( |
| ) |
const |
Retrieves the size of the token list.
- Returns
- The size of the token list.
◆ tokens()
| std::vector< std::any > & NeoN::TokenList::tokens |
( |
| ) |
|
The documentation for this class was generated from the following file: