Re: Multiple inheritance

New Message Reply Date view Thread view Subject view Author view

Jean-Luc Dery (dery++at++Discreet.COM)
Tue, 16 Dec 1997 13:26:26 -0500


On Dec 16, 10:00am, David Plew wrote:
> Subject: Re: Multiple inheritance
> > Hi PfC++ pros,
> >I have been deriving classes from Performer for quite a while but never
tried
> >multiple inheritance because I eard somewhere that Performer can handle
single
> >inheritance only. Is this true, or are there any special concerns in doing
so.
> >
> >class myClass : public pfTexture, public myOtherClass
> >{
> >...
> >};
>
>
> What I have done is as follows:
>
> class myOtherClass : public pfTexture
> {
>
> }
>
> class myClass : public myOtherClass
> {
>
> }
>
> But offcourse the above makes sens if you don't mind deriving myOtherClass
> from pfTexture. In this case, you have to define each on'e 'init()'
> function properly.
>
> hope this helps
>
> -anita

Thanks for your reply Anita,

But still, is this possible.

The reason why this would be used is to be able to derive from an application
wide service without making it Performer dependant. Lets say myOtherClass is a
special loader (just an example) for my textures that could be used in the Pf
application and other s/w components (not Pf dependant) within the system. Then
I wouldn't be able to define this independant of Pf.

class myLoaderClass : public pfTexture {...};
class myPfTexture : public myLoaderClass {...};

But if I could do

class myPfTexture : public pfTexture, public myLoaderClass {...};

I could still use myPfTexture just as a pfTexture with the methods provide from
myLoaderClass which could also be used in other non-Performer related s/w
components. If this can't be done, the only way I can think of to have this is
to make myLoaderClass an attribute of myPfTexture.

class myPfTexture : public pfTexture
{
   myLoaderClass myLoader;
   ...
};

Which is not bad after all, but still, my question remains, can we do multiple
inheritance ??

class myClass : public pfTexture, public myOtherClass {...};

Thanks again for any comments.

Jean-Luc

-- 
_____________________________________________________________________________

Jean-Luc Dery Discreet Logic System Engineer 10 Duke Street 3-D Graphics Technology Montreal (Quebec), Canada, H3C 2L7 Tel: (514) 954-7239 Email: dery++at++discreet.com Fax: (514) 393-0110 _____________________________________________________________________________ ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:25 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.