| 86 | } |
| 87 | |
| 88 | void pre_order_apply(const tree::NodeTree &nt, NodeID start, const NodeAction &action) |
| 89 | { |
| 90 | std::stack<NodeID> stk; |
| 91 | |
| 92 | stk.push(start); |
| 93 | |
| 94 | while (stk.size() > 0) |
| 95 | { |
| 96 | auto nid = stk.top(); |
| 97 | stk.pop(); |
| 98 | |
| 99 | action(nid); |
| 100 | |
| 101 | for (auto i = nt.childrenCount(nid) - 1; i >= 0; --i) |
| 102 | { |
| 103 | auto child = nt.getChild(nid, i); |
| 104 | stk.push(child); |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | bool is_right_most_child(const tree::NodeTree &nt, NodeID nid) |
| 110 | { |
no test coverage detected