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

Method removeAllHooks

src/loggers/groot2_publisher.cpp:698–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696}
697
698void Groot2Publisher::removeAllHooks()
699{
700 std::vector<uint16_t> uids;
701
702 for(auto pos : { Position::PRE, Position::POST })
703 {
704 uids.clear();
705 auto* hooks = pos == Position::PRE ? &_p->pre_hooks : &_p->post_hooks;
706 std::unique_lock<std::mutex> lk(_p->hooks_map_mutex);
707 if(!hooks->empty())
708 {
709 uids.reserve(hooks->size());
710 for(const auto& [node_uid, hook_ptr] : *hooks)
711 {
712 std::ignore = hook_ptr; // unused in this loop
713 uids.push_back(node_uid);
714 }
715
716 lk.unlock();
717 for(auto node_uid : uids)
718 {
719 removeHook(pos, node_uid);
720 }
721 }
722 }
723}
724
725Monitor::Hook::Ptr Groot2Publisher::getHook(Position pos, uint16_t node_uid)
726{

Callers

nothing calls this directly

Calls 5

push_backMethod · 0.80
unlockMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected