12 std::unique_lock<std::mutex> lock(
mutex_);
15 return (it ==
storage_.end()) ?
nullptr : &(it->second->port_info);
21 {
static_cast<std::string
>(
internal), static_cast<std::string>(external)});
28 const auto& key = it.first;
29 const auto& entry = it.second;
31 auto port_type = entry->port_info.type();
34 port_type = &(entry->value.type());
37 std::cout << key <<
" (" <<
demangle(port_type) <<
") -> ";
44 std::cout <<
"remapped to parent [" << remapping_it->second <<
"]" << std::endl;
48 std::cout << ((entry->value.empty()) ?
"empty" :
"full") << std::endl;
58 std::vector<StringView> out;
60 for (
const auto& entry_it :
storage_)
62 out.push_back(entry_it.first);
67 std::shared_ptr<Blackboard::Entry>
70 std::unique_lock<std::mutex> lock(
mutex_);
75 auto storage_it =
storage_.find(key);
78 const auto old_type = storage_it->second->port_info.type();
79 if (old_type && info.
type() && old_type != info.
type())
81 throw LogicError(
"Blackboard: once declared, the type of a port " 82 "shall not change. Previously declared type [",
86 return storage_it->second;
89 std::shared_ptr<Entry> entry;
95 const auto& remapped_key = remapping_it->second;
98 entry = parent->createEntryImpl(remapped_key, info);
105 entry = parent->createEntryImpl(key, info);
110 entry = std::make_shared<Entry>(info);
std::shared_ptr< Entry > createEntryImpl(const std::string &key, const PortInfo &info)
const PortInfo * portInfo(const std::string &key)
const std::type_info * type() const
std::unordered_map< std::string, std::string > internal_to_external_
std::string demangle(char const *name)
nonstd::string_view StringView
std::weak_ptr< Blackboard > parent_bb_
std::unordered_map< std::string, std::shared_ptr< Entry > > storage_
void debugMessage() const
std::vector< StringView > getKeys() const
void addSubtreeRemapping(StringView internal, StringView external)
void enableAutoRemapping(bool remapping)