RES: [omniORB] Pointer from a _var?

Stefan Seefeld seefeld@sympatico.ca
Wed, 27 Jun 2001 11:34:18 -0500


Juan Esteban Bernabó wrote:
> 
> This is much more a CORBA quastion than omniORB question but maybe you can
> answer it.
> 
> I would like to know what is the best aproach to implement a hierarchy of
> interfaces.
> 
> interface A
> {
>         string getNameA();
> };
> 
> interface B : A
> {
>         string getNameB();
> };
> 
> ...................
> 
> class AImpl : public _sk_A
> {
>         char *getNameA() { return m_a; }

use CORBA::string_dup(m_a) to return a new memory

>         char *m_a;
> };
> 
> class BImpl : public _sk_B, public AImpl
> {
>         char getNameB() { return m_b; }

same as above.

>         char m_b;
> };
> 
> What would be the more accerted way of doind this, i mean inerithing the
> funciontionality from a base class that also implement an interface.

use virtual inheritance, at least for the interfaces.

Regards,
		Stefan