Represents a property value which can use late binding.
- Author
- Jon Berndt, Anders Gidenstam
Definition at line 62 of file FGPropertyValue.h.
#include <FGPropertyValue.h>
◆ FGPropertyValue() [1/2]
Definition at line 66 of file FGPropertyValue.h.
67 : PropertyManager(nullptr), PropertyNode(propNode), Sign(1.0) {}
◆ FGPropertyValue() [2/2]
Definition at line 44 of file FGPropertyValue.cpp.
46 : PropertyManager(propertyManager), PropertyNode(nullptr), XML_def(el),
47 PropertyName(propName), Sign(1.0)
48{
49 if (PropertyName[0] == '-') {
50 PropertyName.erase(0,1);
51 Sign = -1.0;
52 }
53
54 if (PropertyManager->HasNode(PropertyName)) {
55 PropertyNode = PropertyManager->GetNode(PropertyName);
56
57 assert(PropertyNode);
58 XML_def = nullptr;
59 }
60}
◆ GetFullyQualifiedName()
std::string GetFullyQualifiedName |
( |
void |
| ) |
const |
|
virtual |
Definition at line 125 of file FGPropertyValue.cpp.
126{
127 if (PropertyNode)
128 return PropertyNode->GetFullyQualifiedName();
129 else
130 return PropertyName;
131}
◆ GetName()
std::string GetName |
( |
void |
| ) |
const |
|
overridevirtual |
Implements FGParameter.
Definition at line 102 of file FGPropertyValue.cpp.
103{
104 if (PropertyNode)
105 return PropertyNode->GetName();
106 else
107 return PropertyName;
108}
◆ GetNameWithSign()
std::string GetNameWithSign |
( |
void |
| ) |
const |
|
virtual |
Definition at line 112 of file FGPropertyValue.cpp.
113{
114 string name;
115
116 if (Sign < 0.0) name ="-";
117
118 name += GetName();
119
120 return name;
121}
◆ GetNode()
Definition at line 64 of file FGPropertyValue.cpp.
65{
66 if (PropertyNode) return PropertyNode;
67
68
69 PropertyNode = PropertyManager->GetNode(PropertyName);
70 if (!PropertyNode) {
71 if (XML_def)
72 cerr << XML_def->ReadFrom()
73 << "Property " << PropertyName << " does not exist" << endl;
74 throw BaseException("FGPropertyValue::GetValue() The property " +
75 PropertyName + " does not exist.");
76 }
77
78 XML_def = nullptr;
79
80 return PropertyNode;
81}
◆ GetPrintableName()
std::string GetPrintableName |
( |
void |
| ) |
const |
|
virtual |
Definition at line 135 of file FGPropertyValue.cpp.
136{
137 if (PropertyNode)
138 return PropertyNode->GetPrintableName();
139 else
140 return PropertyName;
141}
◆ GetValue()
double GetValue |
( |
void |
| ) |
const |
|
overridevirtual |
◆ IsConstant()
bool IsConstant |
( |
void |
| ) |
const |
|
inlineoverridevirtual |
Reimplemented from FGParameter.
Definition at line 72 of file FGPropertyValue.h.
72 {
73 return PropertyNode && (!PropertyNode->isTied()
74 && !PropertyNode->getAttribute(SGPropertyNode::WRITE));
75 }
◆ IsLateBound()
bool IsLateBound |
( |
void |
| ) |
const |
|
inline |
◆ SetNode()
◆ SetValue()
void SetValue |
( |
double |
value | ) |
|
Definition at line 92 of file FGPropertyValue.cpp.
93{
94
95
96 assert(Sign == 1);
97 GetNode()->setDoubleValue(value);
98}
The documentation for this class was generated from the following files: