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

Method getStamped

include/behaviortree_cpp/blackboard.h:410–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408
409template <typename T>
410inline Expected<Timestamp> Blackboard::getStamped(const std::string& key, T& value) const
411{
412 if(auto entry = getEntry(key))
413 {
414 std::unique_lock lk(entry->entry_mutex);
415 if(entry->value.empty())
416 {
417 return nonstd::make_unexpected(StrCat("Blackboard::getStamped() error. Entry [",
418 key, "] hasn't been initialized, yet"));
419 }
420 auto result = tryCastWithPolymorphicFallback<T>(&entry->value);
421 if(result)
422 {
423 value = result.value();
424 return Timestamp{ entry->sequence_id, entry->stamp };
425 }
426 return nonstd::make_unexpected(result.error());
427 }
428 return nonstd::make_unexpected(
429 StrCat("Blackboard::getStamped() error. Missing key [", key, "]"));
430}
431
432template <typename T>
433inline Expected<StampedValue<T>> Blackboard::getStamped(const std::string& key) const

Callers 1

TESTFunction · 0.80

Calls 4

make_unexpectedFunction · 0.85
StrCatFunction · 0.85
emptyMethod · 0.45
valueMethod · 0.45

Tested by 1

TESTFunction · 0.64