instruction.hpp 572 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
#ifndef GUARD_RTGLIB_INSTRUCTION_HPP
#define GUARD_RTGLIB_INSTRUCTION_HPP

Paul's avatar
Paul committed
4
#include <rtg/literal.hpp>
Paul's avatar
Paul committed
5
#include <rtg/shape.hpp>
Paul's avatar
Paul committed
6
#include <string>
Paul's avatar
Paul committed
7
8
9
10
11

namespace rtg {

struct instruction
{
Paul's avatar
Paul committed
12
13
14
15
16
17
18
19
20
21
    instruction() {}

    instruction(std::string n, shape r, std::vector<instruction*> args)
    : name(std::move(n)), result(std::move(r)), arguments(std::move(args))
    {}

    instruction(literal l)
    : name("literal"), result(l.get_shape()), lit(std::move(l))
    {}

Paul's avatar
Paul committed
22
23
24
    std::string name;
    shape result;
    std::vector<instruction*> arguments;
Paul's avatar
Paul committed
25
    literal lit;
Paul's avatar
Paul committed
26
27
28
29
30
};

}

#endif