[omniORB] Beginner's question on IOR and multiple interfaces

baileyk@schneider.com baileyk@schneider.com
Tue Sep 10 17:47:00 2002


Duncan will likely give a definitive answer.  From my perspective it is a
practical issue.  An upcall must use a dynamic dispatch mechanism, since
the ORB core has no a priori knowledge of your IDL interfaces.  The
skeleton base classes ( POA_I and POA_J in this case ) are probably
generated to do this dispatch.  Each will have a virtual method called
"dispatch" or something like it (I think it's "_dispatch" for omniORB).  If
a class derives from two of these skeletons, there will be an ambiguity at
compile time.  Even if this could be resolved, do you want the upcalls to
have to try multiple dispatch tables to find which has a method of a given
name?  I think it is better to just let the IDL compiler emit a single
combined dispatch table in the K skeleton and then your servant class
derive from that.

Kendall




                                                                                                                       
                    Ken Feuerman                                                                                       
                    <kfeuerma@adobe.com>               To:     omniorb-list@omniorb-support.com                        
                    Sent by:                           cc:                                                             
                    omniorb-list-admin@omniorb-s       Fax to:                                                         
                    upport.com                         Subject:     Re: [omniORB] Beginner's question on IOR and       
                                                        multiple  interfaces                                           
                                                                                                                       
                    09/10/2002 11:19 AM                                                                                
                                                                                                                       
                                                                                                                       




Alright, now my curiosity is piqued:  Why *can't* you implement MyServant
as virtually derived from POA_I and POA_J?  Style questions aside, would it

necessarily result in a compile-time or run-time error that is a
consequence somehow of CORBA's specifications?  (Inquiring minds want to
know!)

--Ken Feuerman.
Adobe Systems, Inc.

At 04:53 PM 9/10/2002 +0100, Duncan Grisby wrote:
>i.e., given
>
>   interface I {
>     void one();
>   };
>   interface J {
>     void two();
>   };
>
>You cannot implement them both in C++ with something like
>
>   class MyServant : public virtual POA_I, public virtual POA_J {...};
>
>Instead, you must first declare
>
>   interface K : I, J {};
>
>then implement
>
>   class MyServant : public virtual POA_K {...};

_______________________________________________
omniORB-list mailing list
omniORB-list@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list