JSBSim Flight Dynamics Model
1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
|
Public Member Functions | |
FGPropertyManager (void) | |
Default constructor. | |
FGPropertyManager (FGPropertyNode *_root) | |
Constructor. | |
virtual | ~FGPropertyManager (void) |
Destructor. | |
template<class T > | |
simgear::PropertyObject< T > | CreatePropertyObject (const std::string &path) |
FGPropertyNode * | GetNode (void) const |
FGPropertyNode * | GetNode (const std::string &path, bool create=false) |
FGPropertyNode * | GetNode (const std::string &relpath, int index, bool create=false) |
bool | HasNode (const std::string &path) const |
std::string | mkPropertyName (std::string name, bool lowercase) |
Property-ify a name replaces spaces with '-' and, optionally, makes name all lower case. More... | |
void | Tie (const std::string &name, bool *pointer, bool useDefault=true) |
Tie a property to an external bool variable. More... | |
void | Tie (const std::string &name, int *pointer, bool useDefault=true) |
Tie a property to an external int variable. More... | |
void | Tie (const std::string &name, long *pointer, bool useDefault=true) |
Tie a property to an external long variable. More... | |
void | Tie (const std::string &name, float *pointer, bool useDefault=true) |
Tie a property to an external float variable. More... | |
void | Tie (const std::string &name, double *pointer, bool useDefault=true) |
Tie a property to an external double variable. More... | |
template<class V > | |
void | Tie (const std::string &name, V(*getter)(), void(*setter)(V)=0, bool useDefault=true) |
Tie a property to a pair of simple functions. More... | |
template<class V > | |
void | Tie (const std::string &name, int index, V(*getter)(int), void(*setter)(int, V)=0, bool useDefault=true) |
Tie a property to a pair of indexed functions. More... | |
template<class T , class V > | |
void | Tie (const std::string &name, T *obj, V(T::*getter)() const, void(T::*setter)(V)=0, bool useDefault=true) |
Tie a property to a pair of object methods. More... | |
template<class T , class V > | |
void | Tie (const std::string &name, T *obj, int index, V(T::*getter)(int) const, void(T::*setter)(int, V)=0, bool useDefault=true) |
Tie a property to a pair of indexed object methods. More... | |
void | Unbind (void) |
Unbind all properties bound by this manager to an external data source. More... | |
void | Untie (const std::string &name) |
Untie a property from an external data source. More... | |
Definition at line 379 of file FGPropertyManager.h.
string mkPropertyName | ( | std::string | name, |
bool | lowercase | ||
) |
Property-ify a name replaces spaces with '-' and, optionally, makes name all lower case.
name | string to change |
lowercase | true to change all upper case chars to lower NOTE: this function changes its argument and thus relies on pass by value |
Definition at line 65 of file FGPropertyManager.cpp.
void Tie | ( | const std::string & | name, |
bool * | pointer, | ||
bool | useDefault = true |
||
) |
Tie a property to an external bool variable.
The property's value will automatically mirror the variable's value, and vice-versa, until the property is untied.
name | The property name to tie (full path). |
pointer | A pointer to the variable. |
useDefault | true if any existing property value should be copied to the variable; false if the variable should not be modified; defaults to true. |
Definition at line 330 of file FGPropertyManager.cpp.
void Tie | ( | const std::string & | name, |
int * | pointer, | ||
bool | useDefault = true |
||
) |
Tie a property to an external int variable.
The property's value will automatically mirror the variable's value, and vice-versa, until the property is untied.
name | The property name to tie (full path). |
pointer | A pointer to the variable. |
useDefault | true if any existing property value should be copied to the variable; false if the variable should not be modified; defaults to true. |
Definition at line 348 of file FGPropertyManager.cpp.
void Tie | ( | const std::string & | name, |
long * | pointer, | ||
bool | useDefault = true |
||
) |
Tie a property to an external long variable.
The property's value will automatically mirror the variable's value, and vice-versa, until the property is untied.
name | The property name to tie (full path). |
pointer | A pointer to the variable. |
useDefault | true if any existing property value should be copied to the variable; false if the variable should not be modified; defaults to true. |
Definition at line 367 of file FGPropertyManager.cpp.
void Tie | ( | const std::string & | name, |
float * | pointer, | ||
bool | useDefault = true |
||
) |
Tie a property to an external float variable.
The property's value will automatically mirror the variable's value, and vice-versa, until the property is untied.
name | The property name to tie (full path). |
pointer | A pointer to the variable. |
useDefault | true if any existing property value should be copied to the variable; false if the variable should not be modified; defaults to true. |
Definition at line 386 of file FGPropertyManager.cpp.
void Tie | ( | const std::string & | name, |
double * | pointer, | ||
bool | useDefault = true |
||
) |
Tie a property to an external double variable.
The property's value will automatically mirror the variable's value, and vice-versa, until the property is untied.
name | The property name to tie (full path). |
pointer | A pointer to the variable. |
useDefault | true if any existing property value should be copied to the variable; false if the variable should not be modified; defaults to true. |
Definition at line 405 of file FGPropertyManager.cpp.
|
inline |
Tie a property to a pair of simple functions.
Every time the property value is queried, the getter (if any) will be invoked; every time the property value is modified, the setter (if any) will be invoked. The getter can be 0 to make the property unreadable, and the setter can be 0 to make the property unmodifiable.
name | The property name to tie (full path). |
getter | The getter function, or 0 if the value is unreadable. |
setter | The setter function, or 0 if the value is unmodifiable. |
useDefault | true if the setter should be invoked with any existing property value should be; false if the old value should be discarded; defaults to true. |
Definition at line 555 of file FGPropertyManager.h.
|
inline |
Tie a property to a pair of indexed functions.
Every time the property value is queried, the getter (if any) will be invoked with the index provided; every time the property value is modified, the setter (if any) will be invoked with the index provided. The getter can be 0 to make the property unreadable, and the setter can be 0 to make the property unmodifiable.
name | The property name to tie (full path). |
index | The integer argument to pass to the getter and setter functions. |
getter | The getter function, or 0 if the value is unreadable. |
setter | The setter function, or 0 if the value is unmodifiable. |
useDefault | true if the setter should be invoked with any existing property value should there be one; false if the old value should be discarded; defaults to true. |
Definition at line 592 of file FGPropertyManager.h.
|
inline |
Tie a property to a pair of object methods.
Every time the property value is queried, the getter (if any) will be invoked; every time the property value is modified, the setter (if any) will be invoked. The getter can be 0 to make the property unreadable, and the setter can be 0 to make the property unmodifiable.
name | The property name to tie (full path). |
obj | The object whose methods should be invoked. |
getter | The object's getter method, or 0 if the value is unreadable. |
setter | The object's setter method, or 0 if the value is unmodifiable. |
useDefault | true if the setter should be invoked with any existing property value should there be one; false if the old value should be discarded; defaults to true. |
Definition at line 632 of file FGPropertyManager.h.
|
inline |
Tie a property to a pair of indexed object methods.
Every time the property value is queried, the getter (if any) will be invoked with the index provided; every time the property value is modified, the setter (if any) will be invoked with the index provided. The getter can be 0 to make the property unreadable, and the setter can be 0 to make the property unmodifiable.
name | The property name to tie (full path). |
obj | The object whose methods should be invoked. |
index | The integer argument to pass to the getter and setter methods. |
getter | The getter method, or 0 if the value is unreadable. |
setter | The setter method, or 0 if the value is unmodifiable. |
useDefault | true if the setter should be invoked with any existing property value should be; false if the old value should be discarded; defaults to true. |
Definition at line 671 of file FGPropertyManager.h.
void Unbind | ( | void | ) |
Unbind all properties bound by this manager to an external data source.
Classes should use this function to release control of any properties they have bound using this property manager.
Definition at line 53 of file FGPropertyManager.cpp.
void Untie | ( | const std::string & | name | ) |
Untie a property from an external data source.
Classes should use this function to release control of any properties they are managing.
Definition at line 306 of file FGPropertyManager.cpp.