MCPcopy Create free account
hub / github.com/JSBSim-Team/jsbsim / BuildPropertyCatalog

Method BuildPropertyCatalog

src/FGFDMExec.cpp:1083–1109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1082
1083void FGFDMExec::BuildPropertyCatalog(struct PropertyCatalogStructure* pcs)
1084{
1085 auto pcsNew = std::make_unique<struct PropertyCatalogStructure>();
1086 const SGPropertyNode* root_node = instance->GetNode();
1087 const string root_name = GetFullyQualifiedName(root_node) + "/";
1088 const size_t root_name_length = root_name.length();
1089
1090 for (int i=0; i<pcs->node->nChildren(); i++) {
1091 string access="";
1092 pcsNew->base_string = pcs->base_string + "/" + pcs->node->getChild(i)->getNameString();
1093 int node_idx = pcs->node->getChild(i)->getIndex();
1094 if (node_idx != 0) {
1095 pcsNew->base_string = CreateIndexedPropertyName(pcsNew->base_string, node_idx);
1096 }
1097 if (pcs->node->getChild(i)->nChildren() == 0) {
1098 if (pcsNew->base_string.substr(0, root_name_length) == root_name) {
1099 pcsNew->base_string = pcsNew->base_string.erase(0, root_name_length);
1100 }
1101 if (pcs->node->getChild(i)->getAttribute(SGPropertyNode::READ)) access="R";
1102 if (pcs->node->getChild(i)->getAttribute(SGPropertyNode::WRITE)) access+="W";
1103 PropertyCatalog.push_back(pcsNew->base_string+" ("+access+")");
1104 } else {
1105 pcsNew->node = pcs->node->getChild(i);
1106 BuildPropertyCatalog(pcsNew.get());
1107 }
1108 }
1109}
1110
1111//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1112

Callers

nothing calls this directly

Calls 5

GetFullyQualifiedNameFunction · 0.85
GetNodeMethod · 0.80
getChildMethod · 0.80
eraseMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected