summaryrefslogtreecommitdiff
path: root/impl/ExpressionFactory.hpp
blob: 605dd9ec9669e8f3e4b3e66f63e99a65bb1651ca (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef EXPRESSION_FACTORY_HPP
#define EXPRESSION_FACTORY_HPP

#include "Expression.hpp"

template<typename T>
struct ExpressionFactory {
  ExpressionFactory() : id(0) { }
  Expression<T> createExpression(Operator<T>* op, std::vector< Expression<T> > args) {
    return Expression<T>(id++, op, args);
  }
  unsigned int count() const {
    return id;
  }
  private:
  unsigned int id;
};

#endif