summaryrefslogtreecommitdiffhomepage
path: root/flowgraph/node.h
diff options
context:
space:
mode:
Diffstat (limited to 'flowgraph/node.h')
-rw-r--r--flowgraph/node.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/flowgraph/node.h b/flowgraph/node.h
index 89f6088..853b017 100644
--- a/flowgraph/node.h
+++ b/flowgraph/node.h
@@ -17,7 +17,12 @@ namespace FlowGraph {
class Node
{
public:
+ Node(){}
+ Node(std::vector<Data> operands): mOperands(operands) {}
+ std::vector<Data>& operands() { return mOperands; }
virtual ~Node() {}; // force class to be polymorphic (e.g. in a container)
+ private:
+ std::vector<Data> mOperands;
};
// Memory on Heap: new and delete
@@ -146,13 +151,11 @@ namespace FlowGraph {
{
public:
BinaryOperation(BinaryOperationType type, Data& destination, Data& source0, Data& source1):
- m_type(type), m_destination(destination), m_source0(source0), m_source1(source1)
+ Node(std::vector<Data>({destination, source0, source1})), m_type(type)
{}
+ BinaryOperationType type() {return m_type;}
private:
BinaryOperationType m_type;
- Data m_destination;
- Data m_source0;
- Data m_source1;
};
} // namespace FlowGraph