X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Ffg_props.hxx;h=0b52d0c947c1bc3b9a6d950481e0052d4c205ad4;hb=c4b2e54551a0c3384f6c041ffe89187942993f16;hp=8dd28cea452ca2830d3417c9f01b17d3dc4a7e20;hpb=576432ec75ce0c8f860e5df503cab37e3b8d9024;p=flightgear.git diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 8dd28cea4..0b52d0c94 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -95,95 +95,106 @@ inline void fgUntie (const string &name) { if (!globals->get_props()->untie(name)) - FG_LOG(FG_GENERAL, FG_WARN, "Failed to untie property " << name); + SG_LOG(SG_GENERAL, SG_WARN, "Failed to untie property " << name); } // Templates cause ambiguity here inline void -fgTie (const string &name, bool *pointer) +fgTie (const string &name, bool *pointer, bool useDefault = true) { - if (!globals->get_props()->tie(name, SGRawValuePointer(pointer))) - FG_LOG(FG_GENERAL, FG_WARN, + if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } inline void -fgTie (const string &name, int *pointer) +fgTie (const string &name, int *pointer, bool useDefault = true) { - if (!globals->get_props()->tie(name, SGRawValuePointer(pointer))) - FG_LOG(FG_GENERAL, FG_WARN, + if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } inline void -fgTie (const string &name, float *pointer) +fgTie (const string &name, float *pointer, bool useDefault = true) { - if (!globals->get_props()->tie(name, SGRawValuePointer(pointer))) - FG_LOG(FG_GENERAL, FG_WARN, + if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } inline void -fgTie (const string &name, double *pointer) +fgTie (const string &name, double *pointer, bool useDefault = true) { - if (!globals->get_props()->tie(name, SGRawValuePointer(pointer))) - FG_LOG(FG_GENERAL, FG_WARN, + if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } inline void -fgTie (const string &name, string *pointer) +fgTie (const string &name, string *pointer, bool useDefault = true) { - if (!globals->get_props()->tie(name, SGRawValuePointer(pointer))) - FG_LOG(FG_GENERAL, FG_WARN, + if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } template inline void -fgTie (const string &name, V (*getter)(), void (*setter)(V) = 0) +fgTie (const string &name, V (*getter)(), void (*setter)(V) = 0, + bool useDefault = true) { - if (!globals->get_props()->tie(name, SGRawValueFunctions(getter, setter))) - FG_LOG(FG_GENERAL, FG_WARN, + if (!globals->get_props()->tie(name, SGRawValueFunctions(getter, setter), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to functions"); } template inline void fgTie (const string &name, int index, V (*getter)(int), - void (*setter)(int, V) = 0) + void (*setter)(int, V) = 0, bool useDefault = true) { if (!globals->get_props()->tie(name, SGRawValueFunctionsIndexed(index, getter, - setter))) - FG_LOG(FG_GENERAL, FG_WARN, + setter), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to indexed functions"); } template inline void fgTie (const string &name, T * obj, V (T::*getter)() const, - void (T::*setter)(V) = 0) + void (T::*setter)(V) = 0, bool useDefault = true) { if (!globals->get_props()->tie(name, - SGRawValueMethods(*obj, getter, setter))) - FG_LOG(FG_GENERAL, FG_WARN, + SGRawValueMethods(*obj, getter, setter), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to object methods"); } template inline void fgTie (const string &name, T * obj, int index, - V (T::*getter)(int) const, void (T::*setter)(int, V) = 0) + V (T::*getter)(int) const, void (T::*setter)(int, V) = 0, + bool useDefault = true) { if (!globals->get_props()->tie(name, SGRawValueMethodsIndexed(*obj, index, getter, - setter))) - FG_LOG(FG_GENERAL, FG_WARN, + setter), + useDefault)) + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to indexed object methods"); }