JSBSim Flight Dynamics Model 1.3.0 (09 Apr 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
FGParameterValue Class Reference

Detailed Description

Represents a either a real value or a property value.

Author
Bertrand Coconnier

Definition at line 62 of file FGParameterValue.h.

#include <FGParameterValue.h>

+ Inheritance diagram for FGParameterValue:
+ Collaboration diagram for FGParameterValue:

Public Member Functions

 FGParameterValue (const std::string &value, std::shared_ptr< FGPropertyManager > pm, Element *el)
 
 FGParameterValue (Element *el, std::shared_ptr< FGPropertyManager > pm)
 
std::string GetName (void) const override
 
double GetValue (void) const override
 
bool IsConstant (void) const override
 
bool IsLateBound (void) const
 
- Public Member Functions inherited from FGParameter
double getDoubleValue (void) const
 

Constructor & Destructor Documentation

◆ FGParameterValue() [1/2]

FGParameterValue ( Element el,
std::shared_ptr< FGPropertyManager >  pm 
)
inline

Definition at line 65 of file FGParameterValue.h.

66 : FGParameterValue(el->GetDataLine(), pm, el)
67 {
68 std::string value = el->GetDataLine();
69
70 if (el->GetNumDataLines() != 1 || value.empty()) {
71 XMLLogException err(el);
72 err << "The element <" << el->GetName()
73 << "> must either contain a value number or a property name.\n";
74 throw err;
75 }
76 }

◆ FGParameterValue() [2/2]

FGParameterValue ( const std::string &  value,
std::shared_ptr< FGPropertyManager >  pm,
Element el 
)
inline

Definition at line 78 of file FGParameterValue.h.

79 {
80 try {
81 param = new FGRealValue(atof_locale_c(value.c_str()));
82 } catch (InvalidNumber&) {
83 // "value" must be a property if execution passes to here.
84 param = new FGPropertyValue(value, pm, el);
85 }
86 }

Member Function Documentation

◆ GetName()

std::string GetName ( void  ) const
inlineoverridevirtual

Implements FGParameter.

Definition at line 91 of file FGParameterValue.h.

91 {
92 FGPropertyValue* v = dynamic_cast<FGPropertyValue*>(param.ptr());
93 if (v)
94 return v->GetNameWithSign();
95 else
96 return param->GetName();
97 }

◆ GetValue()

double GetValue ( void  ) const
inlineoverridevirtual

Implements FGParameter.

Definition at line 88 of file FGParameterValue.h.

88{ return param->GetValue(); }

◆ IsConstant()

bool IsConstant ( void  ) const
inlineoverridevirtual

Reimplemented from FGParameter.

Definition at line 89 of file FGParameterValue.h.

89{ return param->IsConstant(); }

◆ IsLateBound()

bool IsLateBound ( void  ) const
inline

Definition at line 99 of file FGParameterValue.h.

99 {
100 FGPropertyValue* v = dynamic_cast<FGPropertyValue*>(param.ptr());
101 return v != nullptr && v->IsLateBound();
102 }

The documentation for this class was generated from the following file: