| 102 | } |
| 103 | |
| 104 | void Blackboard::debugMessage() const |
| 105 | { |
| 106 | // Lock storage_mutex_ (shared) to prevent iterator invalidation from |
| 107 | // concurrent modifications (BUG-5 fix). |
| 108 | const std::shared_lock storage_lock(storage_mutex_); |
| 109 | for(const auto& [key, entry] : storage_) |
| 110 | { |
| 111 | auto port_type = entry->info.type(); |
| 112 | if(port_type == typeid(void)) |
| 113 | { |
| 114 | port_type = entry->value.type(); |
| 115 | } |
| 116 | |
| 117 | std::cout << key << " (" << BT::demangle(port_type) << ")" << std::endl; |
| 118 | } |
| 119 | |
| 120 | for(const auto& [from, to] : internal_to_external_) |
| 121 | { |
| 122 | std::cout << "[" << from << "] remapped to port of parent tree [" << to << "]"; |
| 123 | // Show the type of the remapped entry from the parent. Issue #408. |
| 124 | if(auto parent = parent_bb_.lock()) |
| 125 | { |
| 126 | if(auto entry = parent->getEntry(to)) |
| 127 | { |
| 128 | auto port_type = entry->info.type(); |
| 129 | if(port_type == typeid(void)) |
| 130 | { |
| 131 | port_type = entry->value.type(); |
| 132 | } |
| 133 | std::cout << " (" << BT::demangle(port_type) << ")"; |
| 134 | } |
| 135 | } |
| 136 | std::cout << std::endl; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | std::vector<StringView> Blackboard::getKeys() const |
| 141 | { |