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

Method notify

include/behaviortree_cpp/utils/signal.h:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 using Subscriber = std::shared_ptr<CallableFunction>;
20
21 void notify(CallableArgs... args)
22 {
23 for(size_t i = 0; i < subscribers_.size();)
24 {
25 if(auto sub = subscribers_[i].lock())
26 {
27 (*sub)(args...);
28 i++;
29 }
30 else
31 {
32 subscribers_.erase(subscribers_.begin() + i);
33 }
34 }
35 }
36
37 Subscriber subscribe(CallableFunction func)
38 {

Callers 2

setStatusMethod · 0.45
resetStatusMethod · 0.45

Calls 3

lockMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected