| 499 | } |
| 500 | |
| 501 | AnyPtrLocked BT::TreeNode::getLockedPortContent(const std::string& key) |
| 502 | { |
| 503 | if(auto remapped_key = getRemappedKey(key, getRawPortValue(key))) |
| 504 | { |
| 505 | const auto bb_key = std::string(*remapped_key); |
| 506 | auto result = _p->config.blackboard->getAnyLocked(bb_key); |
| 507 | if(!result && _p->config.manifest != nullptr) |
| 508 | { |
| 509 | // Entry doesn't exist yet. Create it using the port's type info |
| 510 | // from the manifest so that getLockedPortContent works even when |
| 511 | // the port is not explicitly declared in XML. Issue #942. |
| 512 | auto port_it = _p->config.manifest->ports.find(key); |
| 513 | if(port_it != _p->config.manifest->ports.end()) |
| 514 | { |
| 515 | _p->config.blackboard->createEntry(bb_key, port_it->second); |
| 516 | result = _p->config.blackboard->getAnyLocked(bb_key); |
| 517 | } |
| 518 | } |
| 519 | return result; |
| 520 | } |
| 521 | return {}; |
| 522 | } |
| 523 | |
| 524 | } // namespace BT |
nothing calls this directly
no test coverage detected