[omniORB] nested types

Duncan Grisby dgrisby@uk.research.att.com
Mon, 17 Jul 2000 10:02:43 +0100


On Friday 14 July, Stefan Seefeld wrote:

> interface Graphic
> {
>    struct Edge
>      {
>         //...
>      }
>   //...
> };
> 
> which I was used to use within GraphicImpl like this:
> 
> class GraphicImpl : public virtual _sk_Graphic
> {
>   public:
>     void foo()
>       {
>         Edge edge;
>         //...
>       }
> };
> 
> i.e. making implicit use of the fact that I'm in the 'Graphic' scope
> while inside GraphicImpl. Now I must see that the skeletons isn't
> derived from the to the interface corresponding class.

It is indeed that case that skeleton classes no longer derive from the
class corresponding to the interface. This is explained in section 3.2
of the manual (which, on reflection, isn't the best place for it).

One way around it may be to declare your servant class as derived from
Graphic as well as POA_Graphic (or _sk_Graphic if you're using BOA
compatibility):

  class GraphicImpl : public virtual POA_Graphic,
                      public virtual Graphic {
   ...
 
I think that will work with omniORB 3 (I haven't tried it), but it may
well break on other ORBs.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --