[Kde-bindings] KDE/kdebindings/csharp/qyoto

Richard Dale rdale at foton.es
Mon May 21 11:04:04 UTC 2007


On Friday 18 May 2007, Arno Rehn wrote:
> > Well I haven't looked closely at exactly what you've done, but if it only
> > does the same as the simple approach I describe above, I think it would
> > be better to change it to work the simpler way. The code in PerlQt was
> > designed from the start to work with ref types, but primitive types in
> > ruby are immutable and there is no equivalent to the 'ref' arg type in
> > C#, and so it isn't implemented very well as it could be in QtRuby.
>
> What it does: After the method is called, it checks whether there are any
> ref-arguements. If that's true, it marshalls the C++ arg-values to
> C#-values and copies them on the C# stack. It basically does the same as
> your approach, but it doesn't need to have any extra marshallers; it uses
> the existing ones. I think the two approaches are rather equal in their
> simplicity.
It will need extra marshallers because the smoke lib expects references to 
primitive types to be pointers on the smoke stack, and not values as for when 
they are passed as values. And if the pointer on the smoke stack, points to 
the value on the C# stack we don't need to copy the values back from the 
smoke stack to the C# stack after the call anyway. 

So it isn't that one approach has simpler code, but that the code to copy the 
ref types and special case method calls with references just isn't needed at 
all, and is redundant.

-- Richard




More information about the Kde-bindings mailing list