[omniORB] interface inheritance and _i inheritance

Frédéric Prin frederic.prin@silvaco.com
Tue, 13 Nov 2001 18:08:45 +0100


Hello,

I misunderstood something about inheritance.
Why the _impl class does not reflect the interface inheritance ?
Why superclass methods appear in both class as NON virtual methods ?

This is myIDL.idl:
------------------
interface A {
 void MethodA();
};
interface B : A {
 void MethodB();
};

I generate stub and skell with :
omniidl -bcxx -Wbh=.h -Wbs=_skel.cpp -Wbexample myIDL.idl

the myIDL_i.cc generated file is:
---------------------------------
//
// Example class implementing IDL interface B
//
class B_i: public POA_B,
                public PortableServer::RefCountServantBase {
private:
  // Make sure all instances are built on the heap by making the
  // destructor non-public
  // virtual ~B_i();
public:
  // standard constructor
  B_i();
  virtual ~B_i();

  // methods corresponding to defined IDL attributes and operations
  void MethodB();
  void MethodA();
};

If I try :
class B_i : public POA_B,
               public A_i

But I have an error when converting to Object_var (to pass to
object-to-string):
...
CORBA::Object_var ref = myA_i->_this(); <<<<<<<<<<< COMPILER ERROR
<<<<<<<<<<<<
CORBA::String_var sior(orb->object_to_string(ref));
...

The compiler don't know which _this() to take :
- the POA_A
- the POA_B

Could you please tell me where am I wrong

Thanks
       _____________________________
      /                            /|
     /___________________________ / |
    |                            |  |
    | Frédéric Prin              |  |
    | Senior Software Engineer   |  |
    |      S I L V A C O         |  |
    | Grenoble REsearch CEnter   |  |
    | Tel 04 56 38 10 33         | /|
    |____________________________|/ /
   /__/__/__/__/__/__/__/__/__/__/ /
  /__/__/__/__/__/__/__/__/_____/ /
 /__/__/__/__/__/__/__/__/__/__/ /
 \_____________________________|/