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

Method getPortsRecursively

src/xml_parsing.cpp:1264–1284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1262}
1263
1264void XMLParser::PImpl::getPortsRecursively(const XMLElement* element,
1265 std::vector<std::string>& output_ports)
1266{
1267 for(const XMLAttribute* attr = element->FirstAttribute(); attr != nullptr;
1268 attr = attr->Next())
1269 {
1270 const char* attr_name = attr->Name();
1271 const char* attr_value = attr->Value();
1272 if(IsAllowedPortName(attr_name) && TreeNode::isBlackboardPointer(attr_value))
1273 {
1274 auto port_name = TreeNode::stripBlackboardPointer(attr_value);
1275 output_ports.push_back(static_cast<std::string>(port_name));
1276 }
1277 }
1278
1279 for(auto child_element = element->FirstChildElement(); child_element != nullptr;
1280 child_element = child_element->NextSiblingElement())
1281 {
1282 getPortsRecursively(child_element, output_ports);
1283 }
1284}
1285
1286namespace
1287{

Callers

nothing calls this directly

Calls 6

IsAllowedPortNameFunction · 0.85
NameMethod · 0.80
ValueMethod · 0.80
push_backMethod · 0.80
FirstChildElementMethod · 0.80
NextSiblingElementMethod · 0.80

Tested by

no test coverage detected