Re: Inheriting structs



> Hi Joerg,

>         You say that UNO allows inheritance of structs; ie. if I have
> something like this:

>         struct a {
>                 long foo;
>         };

>         struct b : a {
>                 long baa;
>         };

>         And a method:

>         void doKippersFloat (struct a);

>         And I pass 'b' to it; then I assume that ( unless you marshal the
> type information as well per struct - horribly wasteful ), that it is 
then
> impossible to narrow a to type 'struct b' inside the doKippersFloat 
method
> if we have passed a 'struct b'. 
You are correct, it is only guaranteed in UNO, that the content of struct 
a reaches the callee. If you want to achieve something different, you 
have to use an any. 

> If this is the case ( as seems only
> obvious ), it would seem that CORBA ( at least ORBit ) has a similar
> property; that of nested structs; so instead of inheriting explicitely 
you
> might do:

>         struct b {
>                 struct a;
>                 long   baa;
>         };

>         So this should be no problem to map, furthermore an exception is
> extremely similar to a struct, so this shouldn't be an issue either.

>         Regards,

>                 Michael.
Yes, derived UNO structs are going to appear in bonobo  as you have 
pointed out. 

Thanx, Joerg





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]