[omniORB] Inheritance

Stefan Seefeld seefeld@sympatico.ca
Mon, 30 Apr 2001 10:00:46 -0400


Duncan Grisby wrote:

>   // IDL
>   interface Base { ... };
>   interface Derived : Base { ... };
> 
>   // C++
>   class Base_i : public virtual POA_Base { ... };
>   class Derived_i : public virtual POA_Derived, public virtual Base_i { ... };
> 
> Make sure you use virtual inheritance, otherwise bad things will
> happen.

<nitpicking>
the virtual inheritance is needed only for the interfaces, not in the 
implementation inheritance, i.e. there
is no reason Derived_i has to be derived virtually from Base_i.
Of course, deciding to always use virtual inheritance makes things 
easier (one less thing to remember).
I'm not sure what impact virtual inheritance on the memory footprint and 
efficiency has.
</nitpicking>

Regards,    Stefan