Collection

class zhetapi::CollectionIterator : public zhetapi::Iterator

Iterator for the Collection primitive type.

Public Functions

virtual Token *value() const override
Returns

the value of the iterator.

virtual Token *copy() const override

Returns a copy of the Token (with the same data: the resulting Token should equal the original with ==). Pure virtual because any Tokens used will be copied at some point.

class zhetapi::Collection : public zhetapi::Generator, public zhetapi::Indexable

Public Functions

virtual Iterator *begin() override
Returns

the starting iterator.

virtual Iterator *next(Iterator*) override

Get the next iterator.

Parameters

itr – the current iterator.

Returns

the iterator ahead of the one passed, or nullptr if it was the end.

virtual Token *index(Token*, bool) override

The indexing function that must be overriden by any primitive type that is to be indexable.

Parameters
  • tptr – the “index” to be taken.

  • cref – determines whether to return a reference to the indexed value.

Returns

the value at the specified “index”.

virtual Token *copy() const override

Returns a copy of the Token (with the same data: the resulting Token should equal the original with ==). Pure virtual because any Tokens used will be copied at some point.