#include "NumericalTableEvalValue.hpp" #include "../Iterator/NumericalKeyIterator.hpp" #include "../../Utilities/Random.hpp" inline Porygon::Evaluation::Iterator *Porygon::Evaluation::NumericalTableEvalValue::GetKeyIterator() const { return new NumericalKeyIterator(this); } Porygon::Evaluation::NumericalTableEvalValue::NumericalTableEvalValue(shared_ptr> table) : _table(std::move(table)), _hash(Utilities::Random::Get()) { } Porygon::Evaluation::EvalValue * Porygon::Evaluation::NumericalTableEvalValue::UnaryOperation(Porygon::Binder::BoundUnaryOperation operation) const { if (operation == Porygon::Binder::BoundUnaryOperation::Count){ return new NumericEvalValue(static_cast(this->_table->size())); } return EvalValue::UnaryOperation(operation); }