I've changed the behaviour of the property manager in a subtle but
important way.  Let's say that you are tying a property to two methods
in your class:

  fgTie("/sim/foo", this, &FGFoo::getFoo, &FGFoo::setFoo, true);

The last parameter is for the useDefault parameter (which defaults to
true in any case): this will cause a call to FGFoo::setFoo with the
current value of the property, and is a convenient way to pick up
default values at the start of the program.

Previously, the setter would always be invoked, even when no property
value had been set (it used a default value, such as false, 0, or an
empty string); now, the setter will be invoked only when the property
had a value explicitly set.

This is a big advantage, since it makes it easier to tie properties
that are related without worrying about having default values
overwrite explicit values.  It could also cause problems, though, if
people were counting on this behaviour and not otherwise initializing
instance variables.  So far, I have not found a case of this, but
please be warned.


All the best,


David

-- 
David Megginson
[EMAIL PROTECTED]


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to