Implements iterator for user data collection
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2019-08-15 11:43:08 +02:00
parent 5387cd15ff
commit 471dbac3b9
15 changed files with 151 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ using namespace std;
namespace Porygon::Evaluation{
class Iterator {
public:
virtual EvalValue* GetCurrent() = 0;
virtual const EvalValue* GetCurrent() = 0;
virtual bool MoveNext() = 0;
virtual void Reset() = 0;
virtual ~Iterator(){}

View File

@@ -16,7 +16,7 @@ namespace Porygon::Evaluation{
explicit NumericalKeyIterator(const NumericalTableEvalValue* table)
: _vec(table->GetTable()), _size(_vec->size() + 1){}
inline EvalValue* GetCurrent() final{
inline const EvalValue* GetCurrent() final{
return new IntegerEvalValue(_position);
}

View File

@@ -15,7 +15,7 @@ namespace Porygon::Evaluation{
explicit TableKeyIterator(const TableEvalValue* table)
: _iterator(table->GetTableIterator()), _end(table->GetTableIteratorEnd()){}
inline EvalValue* GetCurrent() final{
inline const EvalValue* GetCurrent() final{
return new StringEvalValue(*_iterator->first.GetString());
}