Skip to content

Commit 411e3f6

Browse files
committed
improves code commenting and redefines derived expression node types
1 parent f35547f commit 411e3f6

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

include/attwoodn/expression_tree.hpp

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,42 @@ namespace attwoodn::expression_tree {
5151
}
5252
}
5353

54-
namespace tree {
54+
namespace node {
5555

5656
/**
57-
* The base class representing expression tree nodes
57+
* @brief The base class representing all expression tree nodes.
5858
*/
5959
template<typename Obj>
6060
class expression_tree_node_base {
6161
public:
6262
virtual ~expression_tree_node_base() {};
63+
64+
/**
65+
* @brief Evaluates the given object to determine if it satisfies the expressions defined in this node and all child nodes.
66+
*
67+
* @returns True if the given object satisfied the expression in this node and all the expressions of all nodes
68+
* under this node in the expression tree;
69+
*
70+
* False if the given object did not satisfy the epression in this node and all the expressions of all
71+
* nodes under this node in the expression tree.
72+
*/
6373
virtual bool evaluate(const Obj& obj) = 0;
6474
};
6575

66-
class expression_tree_op_node;
67-
class expression_tree_leaf_node;
76+
/**
77+
*
78+
*/
79+
template<typename Obj, typename LeftChild, typename RightChild>
80+
class expression_tree_op_node : public expression_tree_node_base<Obj> {
81+
82+
};
6883

84+
template<typename Obj, typename Op, typename CompValue>
85+
class expression_tree_leaf_node : public expression_tree_node_base<Obj> {
86+
87+
};
6988

7089
}
90+
91+
7192
}

0 commit comments

Comments
 (0)