David Olivari wrote:
> interface nsIFoo
> {
> readonly attribute float foo;
> };
>
> xpidl generate only :
>
> float GetFoo()
>
> method in public section in nsIFoo class.
> I think that xpidl should also generate a
>
> void SetFoo( float val )
>
> but in a protected section because as you always access foo attribute
> with GetFoo method (and I know you do :-) you should never access foo
> directly.
The C++ generated header from xpidl is only going to
produce method declarations that belong in the interface.
Adding a protected set method would add an extra entry
to the vtable and mess things up for all the other bindings.
You can of course add your own set method to your implementing
class or just access the member data directly from inside.
There are many cases where a readonly attribute's result is
calculated so having a protected set method would make no
sense.
Regards,
Rick