From kde-devel Thu Aug 12 09:46:54 1999 From: Simon Hausmann Date: Thu, 12 Aug 1999 09:46:54 +0000 To: kde-devel Subject: Re: KOM Aggregation question X-MARC-Message: https://marc.info/?l=kde-devel&m=93445027702015 On Wed, 11 Aug 1999, Bavo De Ridder wrote: > On Wed, Aug 11, 1999 at 05:29:29PM +0200, Simon Hausmann wrote: > > On Wed, 11 Aug 1999, Bavo De Ridder wrote: > > > > > Hello, > > > > > > If I have the following interface: > > > > > > interface MyInterface : KOM::Component, MyBaseInterface > > > { > > > } > > > > > > If I call MyInterface's GetInterface( "MyBaseInterface" ) will > > > this return an object pointer to the MyInterface object itself ? > > > > > > Or will KOM complain about not finding the interface (assuming I > > > haven't added the MyBaseInterface to the aggregation containers). > > > > You have to tell KOM about this builtin aggregate. > > > > Use ADD_INTERFACE( "foo" ) in the constructor. > > > > This is exactly what I thought after reading the source. Thanx for the respons ! > > Shouldn't this be in the constructor of Component ? It should be possible, together with the > IR, to deduce all implemented interfaces. I don't know the 100% exact reason why Torben didn't use the IR, but I guess it's not really worth to add much IR handling code (just for builtin aggregates...), instead of the current approach of a simple list of derived interfaces, accessible either directly or via the ADD_INTERFACE macro. It's perhaps also a matter of taste ( or lazyness? ) ;-) Bye, Simon ( *very* happy with ADD_INTERFACE() :-)