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

Method tick

src/actions/updated_action.cpp:40–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40NodeStatus EntryUpdatedAction::tick()
41{
42 if(auto entry = config().blackboard->getEntry(entry_key_))
43 {
44 const std::unique_lock lk(entry->entry_mutex);
45 const uint64_t current_id = entry->sequence_id;
46 const uint64_t previous_id = sequence_id_;
47 sequence_id_ = current_id;
48 /*
49 uint64_t previous_id = 0;
50 auto& previous_id_registry = details::GlobalSequenceRegistry();
51
52 // find the previous id in the registry.
53 auto it = previous_id_registry.find(entry.get());
54 if(it != previous_id_registry.end())
55 {
56 previous_id = it->second;
57 }
58 if(previous_id != current_id)
59 {
60 previous_id_registry[entry.get()] = current_id;
61 }*/
62 return (previous_id != current_id) ? NodeStatus::SUCCESS : NodeStatus::FAILURE;
63 }
64 else
65 {
66 return NodeStatus::FAILURE;
67 }
68}
69
70} // namespace BT

Callers

nothing calls this directly

Calls 1

getEntryMethod · 0.80

Tested by

no test coverage detected