summaryrefslogtreecommitdiff
path: root/impl/Expression.h
diff options
context:
space:
mode:
Diffstat (limited to 'impl/Expression.h')
-rw-r--r--impl/Expression.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/impl/Expression.h b/impl/Expression.h
index 105ad28..38a5e65 100644
--- a/impl/Expression.h
+++ b/impl/Expression.h
@@ -1,12 +1,26 @@
#ifndef EXPRESSION_H
#define EXPRESSION_H
-#include <string>
#include <map>
+#include <string>
+#include <vector>
+template<typename T>
+struct Expression;
+#include "Operator.h"
-template<class T>
+template<typename T>
struct Expression {
- virtual T eval(const std::map<std::string, T>&) const = 0;
+ Expression(Operator<T>* o, std::vector< Expression<T> > a)
+ : _operator(o), _arguments(a) { }
+ virtual const T minvalue(std::map<std::string, T> m) const {
+ return _operator->eval(_arguments, m);
+ }
+ virtual const T maxvalue(std::map<std::string, T> m) const {
+ return _operator->eval(_arguments, m);
+ }
+ private:
+ Operator<T>* _operator;
+ std::vector< Expression<T> > _arguments;
};
#endif