[omniORB] multiple interface inheritance

b.keeping@ic.ac.uk b.keeping@ic.ac.uk
Thu, 12 Aug 1999 11:13:01 +0100


Just to expand on the multiple inheritance theme a little:

I have an IDL structure like this:

interface IDInfo {
}

interface Component: IDInfo {
}

interface System : Component {
}

interface SystemFactory : Component {
}

Nothing `multiple' so far!

However, I then write an implementation for Component which will serve
for both System and SystemFactory:

class Component_i :
  public virtual _sk_Component
{
}

and use multiple inheritance to access this implementation from System
and SystemFactory (the IDInfo methods need distinct implementations anyway):

class System_i :
  public virtual _sk_System,
  public virtual Component_i
{
}

class SystemFactory_i :
  public virtual _sk_SystemFactory,
  public virtual Component_i
{
}

Hope this helps...

Ben Keeping
Imperial College