MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / haltTree

Method haltTree

src/bt_factory.cpp:629–644  ·  view source on GitHub ↗

NOLINTNEXTLINE(readability-make-member-function-const)

Source from the content-addressed store, hash-verified

627
628// NOLINTNEXTLINE(readability-make-member-function-const)
629void 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
646TreeNode* Tree::rootNode() const
647{

Callers 5

TESTFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 3

applyRecursiveVisitorFunction · 0.85
haltNodeMethod · 0.80
resetStatusMethod · 0.80

Tested by 5

TESTFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64