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

Method CreateOutputNode

src/math/FGFunction.cpp:1009–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1007//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1008
1009string FGFunction::CreateOutputNode(Element* el, const string& Prefix)
1010{
1011 string nName;
1012
1013 if ( !Name.empty() ) {
1014 if (Prefix.empty())
1015 nName = PropertyManager->mkPropertyName(Name, false);
1016 else {
1017 if (is_number(Prefix)) {
1018 if (Name.find("#") != string::npos) { // if "#" is found
1019 Name = replace(Name,"#",Prefix);
1020 nName = PropertyManager->mkPropertyName(Name, false);
1021 } else {
1022 FGXMLLogging log(el, LogLevel::ERROR);
1023 log << "Malformed function name with number: " << Prefix
1024 << " and property name: " << Name
1025 << " but no \"#\" sign for substitution.\n";
1026 }
1027 } else {
1028 nName = PropertyManager->mkPropertyName(Prefix + "/" + Name, false);
1029 }
1030 }
1031
1032 pNode = PropertyManager->GetNode(nName, true);
1033 if (pNode->isTied()) {
1034 XMLLogException err(el);
1035 err << "Property " << nName << " has already been successfully bound (late).\n";
1036 throw err;
1037 }
1038 }
1039
1040 return nName;
1041}
1042
1043//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1044

Callers

nothing calls this directly

Calls 6

is_numberFunction · 0.85
replaceFunction · 0.85
emptyMethod · 0.80
mkPropertyNameMethod · 0.80
GetNodeMethod · 0.80
isTiedMethod · 0.80

Tested by

no test coverage detected