Implements iterator for user data collection
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -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(){}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user