summaryrefslogtreecommitdiff
path: root/impl/Variable.hpp
blob: c46db02c506b49ddbf763d57fc1db5a4723bf9ac (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
27
28
#ifndef VARIABLE_HPP
#define VARIABLE_HPP

#include <string>
#include "Operator.hpp"

template<typename T>
struct Variable : public Operator<T> {
  Variable(unsigned int id, const std::string& name)
    : _id(id), _name(name) { }
  Variable(const Variable& other)
    : _id(other._id) { }
  unsigned int id() const {
    return _id;
  }
  std::string name() const {
    return _name;
  }
  T operator() (const std::vector< Expression<T>* >& args, const VariableAssignment<T>& ass) const {
    //assert(args.size() == 0)
    return ass[*this];
  }
  private:
  const unsigned int _id;
  const std::string _name;
};

#endif