NOLINTNEXTLINE(readability-make-member-function-const)
| 627 | |
| 628 | // NOLINTNEXTLINE(readability-make-member-function-const) |
| 629 | void Tree::haltTree() |
| 630 | { |
| 631 | if(rootNode() == nullptr) |
| 632 | { |
| 633 | return; |
| 634 | } |
| 635 | // the halt should propagate to all the node if the nodes |
| 636 | // have been implemented correctly |
| 637 | rootNode()->haltNode(); |
| 638 | |
| 639 | //but, just in case.... this should be no-op |
| 640 | auto visitor = [](BT::TreeNode* node) { node->haltNode(); }; |
| 641 | BT::applyRecursiveVisitor(rootNode(), visitor); |
| 642 | |
| 643 | rootNode()->resetStatus(); |
| 644 | } |
| 645 | |
| 646 | TreeNode* Tree::rootNode() const |
| 647 | { |