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

Method getEntry

src/blackboard.cpp:53–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53const std::shared_ptr<Blackboard::Entry>
54Blackboard::getEntry(const std::string& key) const
55{
56 // special syntax: "@" will always refer to the root BB
57 if(StartWith(key, '@'))
58 {
59 return rootBlackboard()->getEntry(key.substr(1, key.size() - 1));
60 }
61
62 {
63 const std::shared_lock<std::shared_mutex> storage_lock(storage_mutex_);
64 auto it = storage_.find(key);
65 if(it != storage_.end())
66 {
67 return it->second;
68 }
69 }
70 // not found. Try autoremapping
71 if(auto parent = parent_bb_.lock())
72 {
73 auto remap_it = internal_to_external_.find(key);
74 if(remap_it != internal_to_external_.cend())
75 {
76 auto const& new_key = remap_it->second;
77 return parent->getEntry(new_key);
78 }
79 if(autoremapping_ && !IsPrivateKey(key))
80 {
81 return parent->getEntry(key);
82 }
83 }
84 return {};
85}
86
87std::shared_ptr<Blackboard::Entry> Blackboard::getEntry(const std::string& key)
88{

Callers 10

debugMessageMethod · 0.80
ImportBlackboardFromJSONFunction · 0.80
tickMethod · 0.80
tickMethod · 0.80
TESTFunction · 0.80
TESTFunction · 0.80
getInputStampedMethod · 0.80
tickMethod · 0.80
evaluateMethod · 0.80
fuzzSingleBBMethod · 0.80

Calls 6

StartWithFunction · 0.85
IsPrivateKeyFunction · 0.85
lockMethod · 0.80
cendMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45

Tested by 2

TESTFunction · 0.64
TESTFunction · 0.64