FlightGear next
fg_props.hxx File Reference
#include <iosfwd>
#include <algorithm>
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/props/tiedpropertylist.hxx>
#include <Main/globals.hxx>

Go to the source code of this file.

Classes

class  FGProperties
 

Functions

bool fgSaveFlight (std::ostream &output, bool write_all=false)
 Save a flight to disk.
 
bool fgLoadFlight (std::istream &input)
 Load a flight from disk.
 
bool fgLoadProps (const std::string &path, SGPropertyNode *props, bool in_fg_root=true, int default_mode=0)
 Load properties from a file.
 
void setLoggingClasses (const char *c)
 Set the logging classes.
 
void setLoggingPriority (const char *p)
 Set the logging priority.
 
SGPropertyNode * fgGetNode (const char *path, bool create=false)
 Get a property node.
 
SGPropertyNode * fgGetNode (const std::string &path, bool create=false)
 Get a property node.
 
SGPropertyNode * fgGetNode (const char *path, int index, bool create=false)
 Get a property node with separate index.
 
SGPropertyNode * fgGetNode (const std::string &path, int index, bool create=false)
 Get a property node with separate index.
 
bool fgHasNode (const char *path)
 Test whether a given node exists.
 
bool fgHasNode (const std::string &path)
 Test whether a given node exists.
 
void fgAddChangeListener (SGPropertyChangeListener *listener, const char *path)
 Add a listener to a node.
 
void fgAddChangeListener (SGPropertyChangeListener *listener, const std::string &path)
 Add a listener to a node.
 
void fgAddChangeListener (SGPropertyChangeListener *listener, const char *path, int index)
 Add a listener to a node.
 
void fgAddChangeListener (SGPropertyChangeListener *listener, const std::string &path, int index)
 Add a listener to a node.
 
bool fgGetBool (const char *name, bool defaultValue=false)
 Get a bool value for a property.
 
bool fgGetBool (const std::string &name, bool defaultValue=false)
 Get a bool value for a property.
 
int fgGetInt (const char *name, int defaultValue=0)
 Get an int value for a property.
 
int fgGetInt (const std::string &name, int defaultValue=0)
 Get an int value for a property.
 
long fgGetLong (const char *name, long defaultValue=0L)
 Get a long value for a property.
 
long fgGetLong (const std::string &name, long defaultValue=0L)
 Get a long value for a property.
 
float fgGetFloat (const char *name, float defaultValue=0.0)
 Get a float value for a property.
 
float fgGetFloat (const std::string &name, float defaultValue=0.0)
 Get a float value for a property.
 
double fgGetDouble (const char *name, double defaultValue=0.0)
 Get a double value for a property.
 
double fgGetDouble (const std::string &name, double defaultValue=0.0)
 Get a double value for a property.
 
std::string fgGetString (const char *name, const char *defaultValue="")
 Get a string value for a property.
 
std::string fgGetString (const std::string &name, const std::string &defaultValue=std::string(""))
 Get a string value for a property.
 
bool fgSetBool (const char *name, bool val)
 Set a bool value for a property.
 
bool fgSetBool (const std::string &name, bool val)
 Set a bool value for a property.
 
bool fgSetInt (const char *name, int val)
 Set an int value for a property.
 
bool fgSetInt (const std::string &name, int val)
 Set an int value for a property.
 
bool fgSetLong (const char *name, long val)
 Set a long value for a property.
 
bool fgSetLong (const std::string &name, long val)
 Set a long value for a property.
 
bool fgSetFloat (const char *name, float val)
 Set a float value for a property.
 
bool fgSetFloat (const std::string &name, float val)
 Set a float value for a property.
 
bool fgSetDouble (const char *name, double val)
 Set a double value for a property.
 
bool fgSetDouble (const std::string &name, double val)
 Set a double value for a property.
 
bool fgSetString (const char *name, const char *val)
 Set a string value for a property.
 
bool fgSetString (const std::string &name, const std::string &val)
 Set a string value for a property.
 
void fgSetArchivable (const char *name, bool state=true)
 Set the state of the archive attribute for a property.
 
void fgSetReadable (const char *name, bool state=true)
 Set the state of the read attribute for a property.
 
void fgSetWritable (const char *name, bool state=true)
 Set the state of the write attribute for a property.
 
void fgUntie (const char *name)
 Untie a property from an external data source.
 
void fgUntieIfDefined (const std::string &name)
 @brfief variant of the above which doesn't warn if the property does not exist
 
template<class V>
void fgTie (const char *name, V(*getter)(), void(*setter)(V)=0, bool useDefault=true)
 Tie a property to a pair of simple functions.
 
template<class V>
void fgTie (const char *name, int index, V(*getter)(int), void(*setter)(int, V)=0, bool useDefault=true)
 Tie a property to a pair of indexed functions.
 
template<class T, class V>
void fgTie (const char *name, T *obj, V(T::*getter)() const, void(T::*setter)(V)=0, bool useDefault=true)
 Tie a property to a pair of object methods.
 
template<class T, class V>
void fgTie (const char *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.
 

Function Documentation

◆ fgAddChangeListener() [1/4]

void fgAddChangeListener ( SGPropertyChangeListener * listener,
const char * path )
extern

Add a listener to a node.

Parameters
listenerThe listener to add to the node.
pathThe path of the node, relative to root.
indexThe index for the last member of the path (overrides any given in the string).

Definition at line 513 of file fg_props.cxx.

◆ fgAddChangeListener() [2/4]

void fgAddChangeListener ( SGPropertyChangeListener * listener,
const char * path,
int index )
extern

Add a listener to a node.

Parameters
listenerThe listener to add to the node.
pathThe path of the node, relative to root.
indexThe index for the last member of the path (overrides any given in the string).

Definition at line 519 of file fg_props.cxx.

◆ fgAddChangeListener() [3/4]

void fgAddChangeListener ( SGPropertyChangeListener * listener,
const std::string & path )
inline

Add a listener to a node.

Parameters
listenerThe listener to add to the node.
pathThe path of the node, relative to root.
indexThe index for the last member of the path (overrides any given in the string).

Definition at line 211 of file fg_props.hxx.

◆ fgAddChangeListener() [4/4]

void fgAddChangeListener ( SGPropertyChangeListener * listener,
const std::string & path,
int index )
inline

Add a listener to a node.

Parameters
listenerThe listener to add to the node.
pathThe path of the node, relative to root.
indexThe index for the last member of the path (overrides any given in the string).

Definition at line 237 of file fg_props.hxx.

◆ fgGetBool() [1/2]

bool fgGetBool ( const char * name,
bool defaultValue = false )
extern

Get a bool value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getBoolValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a bool, or the default value provided.

Definition at line 25 of file proptest.cpp.

◆ fgGetBool() [2/2]

bool fgGetBool ( const std::string & name,
bool defaultValue = false )
inline

Get a bool value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getBoolValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a bool, or the default value provided.

Definition at line 274 of file fg_props.hxx.

◆ fgGetDouble() [1/2]

double fgGetDouble ( const char * name,
double defaultValue = 0.0 )
extern

Get a double value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getDoubleValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a double, or the default value provided.

Definition at line 30 of file proptest.cpp.

◆ fgGetDouble() [2/2]

double fgGetDouble ( const std::string & name,
double defaultValue = 0.0 )
inline

Get a double value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getDoubleValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a double, or the default value provided.

Definition at line 418 of file fg_props.hxx.

◆ fgGetFloat() [1/2]

float fgGetFloat ( const char * name,
float defaultValue = 0.0 )
extern

Get a float value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getFloatValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a float, or the default value provided.

Definition at line 29 of file proptest.cpp.

◆ fgGetFloat() [2/2]

float fgGetFloat ( const std::string & name,
float defaultValue = 0.0 )
inline

Get a float value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getFloatValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a float, or the default value provided.

Definition at line 382 of file fg_props.hxx.

◆ fgGetInt() [1/2]

int fgGetInt ( const char * name,
int defaultValue = 0 )
extern

Get an int value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getIntValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as an int, or the default value provided.

Definition at line 532 of file fg_props.cxx.

◆ fgGetInt() [2/2]

int fgGetInt ( const std::string & name,
int defaultValue = 0 )
inline

Get an int value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getIntValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as an int, or the default value provided.

Definition at line 310 of file fg_props.hxx.

◆ fgGetLong() [1/2]

long fgGetLong ( const char * name,
long defaultValue = 0L )
extern

Get a long value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getLongValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a long, or the default value provided.

Definition at line 538 of file fg_props.cxx.

◆ fgGetLong() [2/2]

long fgGetLong ( const std::string & name,
long defaultValue = 0L )
inline

Get a long value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getLongValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a long, or the default value provided.

Definition at line 346 of file fg_props.hxx.

◆ fgGetNode() [1/4]

SGPropertyNode * fgGetNode ( const char * path,
bool create = false )
extern

Get a property node.

Parameters
pathThe path of the node, relative to root.
createtrue to create the node if it doesn't exist.
Returns
The node, or 0 if none exists and none was created.

Definition at line 27 of file proptest.cpp.

◆ fgGetNode() [2/4]

SGPropertyNode * fgGetNode ( const char * path,
int index,
bool create = false )
extern

Get a property node with separate index.

This method separates the index from the path string, to make it easier to iterate through multiple components without using sprintf to add indices. For example, fgGetNode("foo[1]/bar", 3) will return the same result as fgGetNode("foo[1]/bar[3]").

Parameters
pathThe path of the node, relative to root.
indexThe index for the last member of the path (overrides any given in the string).
createtrue to create the node if it doesn't exist.
Returns
The node, or 0 if none exists and none was created.

Definition at line 28 of file proptest.cpp.

◆ fgGetNode() [3/4]

SGPropertyNode * fgGetNode ( const std::string & path,
bool create = false )
inline

Get a property node.

Parameters
pathThe path of the node, relative to root.
createtrue to create the node if it doesn't exist.
Returns
The node, or 0 if none exists and none was created.

Definition at line 128 of file fg_props.hxx.

◆ fgGetNode() [4/4]

SGPropertyNode * fgGetNode ( const std::string & path,
int index,
bool create = false )
inline

Get a property node with separate index.

This method separates the index from the path string, to make it easier to iterate through multiple components without using sprintf to add indices. For example, fgGetNode("foo[1]/bar", 3) will return the same result as fgGetNode("foo[1]/bar[3]").

Parameters
pathThe path of the node, relative to root.
indexThe index for the last member of the path (overrides any given in the string).
createtrue to create the node if it doesn't exist.
Returns
The node, or 0 if none exists and none was created.

Definition at line 165 of file fg_props.hxx.

◆ fgGetString() [1/2]

std::string fgGetString ( const char * name,
const char * defaultValue = "" )
extern

Get a string value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getStringValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a string, or the default value provided.

Definition at line 556 of file fg_props.cxx.

◆ fgGetString() [2/2]

std::string fgGetString ( const std::string & name,
const std::string & defaultValue = std::string("") )
inline

Get a string value for a property.

This method is convenient but inefficient. It should be used infrequently (i.e. for initializing, loading, saving, etc.), not in the main loop. If you need to get a value frequently, it is better to look up the node itself using fgGetNode and then use the node's getStringValue() method, to avoid the lookup overhead.

Parameters
nameThe property name.
defaultValueThe default value to return if the property does not exist.
Returns
The property's value as a string, or the default value provided.

Definition at line 455 of file fg_props.hxx.

◆ fgHasNode() [1/2]

bool fgHasNode ( const char * path)
extern

Test whether a given node exists.

Parameters
pathThe path of the node, relative to root.
Returns
true if the node exists, false otherwise.

Definition at line 507 of file fg_props.cxx.

◆ fgHasNode() [2/2]

bool fgHasNode ( const std::string & path)
inline

Test whether a given node exists.

Parameters
pathThe path of the node, relative to root.
Returns
true if the node exists, false otherwise.

Definition at line 186 of file fg_props.hxx.

◆ fgLoadFlight()

bool fgLoadFlight ( std::istream & input)
extern

Load a flight from disk.

This function loads an XML save file from a stream to restore a flight.

Parameters
inputThe input stream to read the XML from.
Returns
true if the flight was restored successfully.

Load a flight from disk.

Definition at line 448 of file fg_props.cxx.

◆ fgLoadProps()

bool fgLoadProps ( const std::string & path,
SGPropertyNode * props,
bool in_fg_root = true,
int default_mode = 0 )
extern

Load properties from a file.

Parameters
fileThe relative or absolute filename.
propsThe property node to load the properties into.
in_fg_rootIf true, look for the file relative to $FG_ROOT; otherwise, look for the file relative to the current working directory.
Returns
true if the properties loaded successfully, false otherwise.

Definition at line 469 of file fg_props.cxx.

◆ fgSaveFlight()

bool fgSaveFlight ( std::ostream & output,
bool write_all )
extern

Save a flight to disk.

This function saves all of the archivable properties to a stream so that the current flight can be restored later.

Parameters
outputThe output stream to write the XML save file to.
write_allIf true, write all properties rather than just the ones flagged as archivable.
Returns
true if the flight was saved successfully.

Save a flight to disk.

Definition at line 424 of file fg_props.cxx.

◆ fgSetArchivable()

void fgSetArchivable ( const char * name,
bool state = true )
extern

Set the state of the archive attribute for a property.

If the archive attribute is true, the property will be written when a flight is saved; if it is false, the property will be skipped.

A warning message will be printed if the property does not exist.

Parameters
nameThe property name.
stateThe state of the archive attribute (defaults to true).

Definition at line 598 of file fg_props.cxx.

◆ fgSetBool() [1/2]

bool fgSetBool ( const char * name,
bool val )
extern

Set a bool value for a property.

Assign a bool value to a property. If the property does not yet exist, it will be created and its type will be set to BOOL; if it has a type of UNKNOWN, the type will also be set to BOOL; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 24 of file proptest.cpp.

◆ fgSetBool() [2/2]

bool fgSetBool ( const std::string & name,
bool val )
inline

Set a bool value for a property.

Assign a bool value to a property. If the property does not yet exist, it will be created and its type will be set to BOOL; if it has a type of UNKNOWN, the type will also be set to BOOL; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 490 of file fg_props.hxx.

◆ fgSetDouble() [1/2]

bool fgSetDouble ( const char * name,
double val )
extern

Set a double value for a property.

Assign a double value to a property. If the property does not yet exist, it will be created and its type will be set to DOUBLE; if it has a type of UNKNOWN, the type will also be set to DOUBLE; otherwise, the double value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 31 of file proptest.cpp.

◆ fgSetDouble() [2/2]

bool fgSetDouble ( const std::string & name,
double val )
inline

Set a double value for a property.

Assign a double value to a property. If the property does not yet exist, it will be created and its type will be set to DOUBLE; if it has a type of UNKNOWN, the type will also be set to DOUBLE; otherwise, the double value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 625 of file fg_props.hxx.

◆ fgSetFloat() [1/2]

bool fgSetFloat ( const char * name,
float val )
extern

Set a float value for a property.

Assign a float value to a property. If the property does not yet exist, it will be created and its type will be set to FLOAT; if it has a type of UNKNOWN, the type will also be set to FLOAT; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 23 of file proptest.cpp.

◆ fgSetFloat() [2/2]

bool fgSetFloat ( const std::string & name,
float val )
inline

Set a float value for a property.

Assign a float value to a property. If the property does not yet exist, it will be created and its type will be set to FLOAT; if it has a type of UNKNOWN, the type will also be set to FLOAT; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 591 of file fg_props.hxx.

◆ fgSetInt() [1/2]

bool fgSetInt ( const char * name,
int val )
extern

Set an int value for a property.

Assign an int value to a property. If the property does not yet exist, it will be created and its type will be set to INT; if it has a type of UNKNOWN, the type will also be set to INT; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 568 of file fg_props.cxx.

◆ fgSetInt() [2/2]

bool fgSetInt ( const std::string & name,
int val )
inline

Set an int value for a property.

Assign an int value to a property. If the property does not yet exist, it will be created and its type will be set to INT; if it has a type of UNKNOWN, the type will also be set to INT; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 524 of file fg_props.hxx.

◆ fgSetLong() [1/2]

bool fgSetLong ( const char * name,
long val )
extern

Set a long value for a property.

Assign a long value to a property. If the property does not yet exist, it will be created and its type will be set to LONG; if it has a type of UNKNOWN, the type will also be set to LONG; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 574 of file fg_props.cxx.

◆ fgSetLong() [2/2]

bool fgSetLong ( const std::string & name,
long val )
inline

Set a long value for a property.

Assign a long value to a property. If the property does not yet exist, it will be created and its type will be set to LONG; if it has a type of UNKNOWN, the type will also be set to LONG; otherwise, the bool value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 557 of file fg_props.hxx.

◆ fgSetReadable()

void fgSetReadable ( const char * name,
bool state = true )
extern

Set the state of the read attribute for a property.

If the read attribute is true, the property value will be readable; if it is false, the property value will always be the default value for its type.

A warning message will be printed if the property does not exist.

Parameters
nameThe property name.
stateThe state of the read attribute (defaults to true).

Definition at line 610 of file fg_props.cxx.

◆ fgSetString() [1/2]

bool fgSetString ( const char * name,
const char * val )
extern

Set a string value for a property.

Assign a string value to a property. If the property does not yet exist, it will be created and its type will be set to STRING; if it has a type of UNKNOWN, the type will also be set to STRING; otherwise, the string value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 26 of file proptest.cpp.

◆ fgSetString() [2/2]

bool fgSetString ( const std::string & name,
const std::string & val )
inline

Set a string value for a property.

Assign a string value to a property. If the property does not yet exist, it will be created and its type will be set to STRING; if it has a type of UNKNOWN, the type will also be set to STRING; otherwise, the string value will be converted to the property's type.

Parameters
nameThe property name.
valThe new value for the property.
Returns
true if the assignment succeeded, false otherwise.

Definition at line 659 of file fg_props.hxx.

◆ fgSetWritable()

void fgSetWritable ( const char * name,
bool state = true )
extern

Set the state of the write attribute for a property.

If the write attribute is true, the property value may be modified (depending on how it is tied); if the write attribute is false, the property value may not be modified.

A warning message will be printed if the property does not exist.

Parameters
nameThe property name.
stateThe state of the write attribute (defaults to true).

Definition at line 622 of file fg_props.cxx.

◆ fgTie() [1/4]

template<class V>
void fgTie ( const char * name,
int index,
V(* getter )(int),
void(* setter )(int, V) = 0,
bool useDefault = true )
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.

Parameters
nameThe property name to tie (full path).
indexThe integer argument to pass to the getter and setter functions.
getterThe getter function, or 0 if the value is unreadable.
setterThe setter function, or 0 if the value is unmodifiable.
useDefaulttrue 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 781 of file fg_props.hxx.

◆ fgTie() [2/4]

template<class T, class V>
void fgTie ( const char * name,
T * obj,
int index,
V(T::* getter )(int) const,
void(T::* setter )(int, V) = 0,
bool useDefault = true )
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.

Parameters
nameThe property name to tie (full path).
objThe object whose methods should be invoked.
indexThe integer argument to pass to the getter and setter methods.
getterThe getter method, or 0 if the value is unreadable.
setterThe setter method, or 0 if the value is unmodifiable.
useDefaulttrue 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 847 of file fg_props.hxx.

◆ fgTie() [3/4]

template<class T, class V>
void fgTie ( const char * name,
T * obj,
V(T::* getter )() const,
void(T::* setter )(V) = 0,
bool useDefault = true )
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.

Parameters
nameThe property name to tie (full path).
objThe object whose methods should be invoked.
getterThe object's getter method, or 0 if the value is unreadable.
setterThe object's setter method, or 0 if the value is unmodifiable.
useDefaulttrue 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 815 of file fg_props.hxx.

◆ fgTie() [4/4]

template<class V>
void fgTie ( const char * name,
V(* getter )(),
void(* setter )(V) = 0,
bool useDefault = true )
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.

Parameters
nameThe property name to tie (full path).
getterThe getter function, or 0 if the value is unreadable.
setterThe setter function, or 0 if the value is unmodifiable.
useDefaulttrue 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 751 of file fg_props.hxx.

◆ fgUntie()

void fgUntie ( const char * name)
extern

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 634 of file fg_props.cxx.

◆ fgUntieIfDefined()

void fgUntieIfDefined ( const std::string & name)

@brfief variant of the above which doesn't warn if the property does not exist

Definition at line 651 of file fg_props.cxx.

◆ setLoggingClasses()

void setLoggingClasses ( const char * c)

Set the logging classes.

Definition at line 65 of file fg_props.cxx.

◆ setLoggingPriority()

void setLoggingPriority ( const char * p)

Set the logging priority.

Definition at line 100 of file fg_props.cxx.