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

Method onStart

src/actions/test_node.cpp:38–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38NodeStatus TestNode::onStart()
39{
40 if(_config->async_delay <= std::chrono::milliseconds(0))
41 {
42 return onCompleted();
43 }
44 // convert this in an asynchronous operation. Use another thread to count
45 // a certain amount of time.
46 _completed = false;
47 _timer.add(std::chrono::milliseconds(_config->async_delay), [this](bool aborted) {
48 if(!aborted)
49 {
50 _completed.store(true);
51 this->emitWakeUpSignal();
52 }
53 else
54 {
55 _completed.store(false);
56 }
57 });
58 return NodeStatus::RUNNING;
59}
60
61NodeStatus TestNode::onRunning()
62{

Callers

nothing calls this directly

Calls 2

addMethod · 0.45
emitWakeUpSignalMethod · 0.45

Tested by

no test coverage detected