39 #include "FGParameter.h"
40 #include "input_output/FGPropertyManager.h"
49 class FGPropertyValue;
759 : cached(false), cachedValue(-HUGE_VAL), pNode(nullptr), pCopyTo(nullptr) {}
761 explicit FGFunction(std::shared_ptr<FGPropertyManager> pm)
763 { PropertyManager = pm; }
782 FGFunction(FGFDMExec* fdmex, Element* element,
const std::string& prefix=
"",
783 FGPropertyValue* var=0L);
792 double GetValue(
void)
const override;
799 std::string
GetName(
void)
const override {
return Name;}
815 enum class OddEven {Either, Odd, Even};
820 std::vector <FGParameter_ptr> Parameters;
821 std::shared_ptr<FGPropertyManager> PropertyManager;
822 FGPropertyNode_ptr pNode;
824 void Load(Element* element, FGPropertyValue* var, FGFDMExec* fdmex,
825 const std::string& prefix=
"");
826 virtual void bind(Element*,
const std::string&);
827 void CheckMinArguments(Element* el,
unsigned int _min);
828 void CheckMaxArguments(Element* el,
unsigned int _max);
829 void CheckOddOrEvenArguments(Element* el, OddEven odd_even);
830 std::string CreateOutputNode(Element* el,
const std::string& Prefix);
834 FGPropertyNode_ptr pCopyTo;
836 void Debug(
int from);
Represents a mathematical function.
FGFunction()
Default constructor.
double GetValue(void) const override
Retrieves the value of the function object.
bool IsConstant(void) const override
Does the function always return the same result (i.e.
void cacheValue(bool shouldCache)
Specifies whether to cache the value of the function, so it is calculated only once per frame.
std::string GetName(void) const override
Retrieves the name of the function.
std::string GetValueAsString(void) const
The value that the function evaluates to, as a string.
~FGFunction(void) override
Destructor Make sure the function is untied before destruction.
Represents various types of parameters.