diff --git a/addition_node.h b/addition_node.h index e60f2143b..b03278a70 100644 --- a/addition_node.h +++ b/addition_node.h @@ -17,8 +17,8 @@ public: } float approximate() override { float result = 0.0f; - for (int i=0; iapproximate(); + for (int i=0; iapproximate(); } return result; } diff --git a/expression_node.h b/expression_node.h index 7cd7bdffd..433bb5ce7 100644 --- a/expression_node.h +++ b/expression_node.h @@ -5,13 +5,8 @@ class ExpressionNode : public TreeNode { public: - ExpressionNode() : TreeNode(TreePool::sharedPool()->generateIdentifier()) { - TreePool::sharedPool()->registerNode(this); - } - virtual float approximate() = 0; - int numberOfOperands() { return numberOfChildren(); } - ExpressionNode * operand(int i) { return static_cast(childAtIndex(i)); } + ExpressionNode * child(int i) { return static_cast(treeChildAtIndex(i)); } }; #endif diff --git a/tree_node.h b/tree_node.h index 0a0cdfc9d..f94978c70 100644 --- a/tree_node.h +++ b/tree_node.h @@ -100,7 +100,7 @@ public: return 0; } - TreeNode * childAtIndex(int i) const { + TreeNode * treeChildAtIndex(int i) const { assert(i >= 0); assert(i < numberOfChildren()); TreeNode * child = next();