[omniORB] Re: Inheritance problems
zhang ji
zsfunl@yahoo.com
Thu, 25 Apr 2002 08:35:37 -0700 (PDT)
Hi Andrey,
Below is one email I just wrote weeks ago. I wish it
is helpful to you.
Shifeng
"
Hi all,
Thanks for your help on reply "about interface
inheritance". Different answers sent to me, I would
like to make a little summary:)
1.Slava Garelin suggests me to run omniild with
- -Wbexample, I tried it and worked. But the generated
code need me to reimplment the method from father
class, it will be a lof of work if there are many
methods need to inherit from father class.
2.Fridiric Prin and Duncan suggest me to use virtual
inheritance to avoid multiple copies of base class
objects.
"
class *_impl : virtual public POA_*
"
3.Luke Deller suggest method 2 and also give another
implementation like below:
"
class father_impl { /* add methods here */ };
class father_i : public POA_father,
public
PortableServer::RefCountServantBase,
public father_impl
{};
class son_impl : public father_i { /* add extra
methods here */};
class son_i : public POA_son,
public
PortableServer::RefCountServantBase,
public son_impl
{};
"
I used method 2 as it is easy to do.
Thanks all for your prompt reply!
Shifeng
"
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/