[gdome] multiple inheritance commit

Date view Thread view Subject view Author view Other groups

Subject: [gdome] multiple inheritance commit
From: Raph Levien (raph@acm.org)
Date: Tue Apr 27 1999 - 03:40:46 EDT


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

----
message from gdome@rpmfind.net
Archive at http://rpmfind.net/tools/gdome/messages/
Unsubscribing: echo "unsubscribe gdome" | mail majordomo@rpmfind.net


Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b27 : Fri Nov 19 1999 - 07:44:24 EST