On Thursday, February 6, 2003, at 10:16  am, Frederic BOUVIER wrote:

Aren't the C++ opperators the perfect place to add this kind of action
to tied properties?
I had the same idea reading the message from James.
imagine that template (we are not against templates, aren't we ? ;) :

template <class T>
class tied_value
{
<snip quite reasonable template idea>
}

Then replace every tied values with that template :
  change :
    double xPos;
  into :
    tied_value<double> xPos;

You get the picture ?
I do, but this is not the problem (as I understand it). The tie-ing system is 'low-invasion' for existing code / code which may not be part of FG, and works well with existing state variables. Your template / operator overloading fix the syntax, but I sort of think that's worse, because people may not realize what they're doing will be more expensive than assigning to a double. But the main problem is people now need to pull in your template and the property node headers into places they don't want to.

The impression I have is that a bunch of code uses 'tieing' to expose lots of internal variables directly. I'd prefer an explicit 'publishing' phase, i.e calls to setValue. Of course your template works fine too, if you're prefer the syntactic sugar.

H&H
James

--
That which does not kill me has poor aim


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

Reply via email to