[gdome] multiple inheritance commit



Hi Slow,

   I committed the first stab at adding multiple inheritance to
Gdome's ifgen.pl. Don't try to call an EventTarget method, it doesn't
quite work yet. This shouldn't affect what you're trying to do much,
but the IDL should be more or less stable now.

   I think I'm going to hack MI a very crude but highly effective way
- any method that gets invoked in a multiple inheritance context
(i.e. is not in the first interface after the colon) gets assigned a
slot numbert which is chosen not to conflict with any other slot
numbers in objects implementing the same interface. Effectively, this
means that if the "biggest" subclass of Node has 25 elements, the
EventTarget methods get numbered 25, 26, etc. Missing slots just get
filled in with dummy values.

   The trick with this technique (and one reason it's not widely used)
is that, depending on the class hierarchy, the number of dummy slots
can grow quite huge. But in this case, because of the relatively
sparing use of MI, I expect space usage to be quite reasonable. The
upside of the technique is that MI invocations aren't any more
expensive than vanilla single inheritance invocations.

   Anyway, doing this hack brought home to me why I was resisting the
MI approach to implementing objects that support both the Node and
EventTarget interfaces. But as Elliot pointed out, it's the right
thing to do.

Raph




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]