summaryrefslogtreecommitdiff
path: root/impl/Expression.h
blob: 38a5e650a4659e80bd20fe389faede11f9cad07b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef EXPRESSION_H
#define EXPRESSION_H

#include <map>
#include <string>
#include <vector>
template<typename T>
struct Expression;
#include "Operator.h"

template<typename T>
struct Expression {
  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