xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Austin <jwaus...@sympatico.ca>
Subject Re: String.intern() thoughts
Date Mon, 01 Dec 2003 13:39:02 GMT
On Mon, 2003-12-01 at 02:11, Glen Mazza wrote:
> --- John Austin <jwaustin@sympatico.ca> wrote:
> > I mentioned yesterday that I thought I had read a

> BTW, The third drawback listed in the link above gave
> "weak references" as an alternative implmentation--I'm
> unsure what that construct is about--is this the
> vtable you were speaking of in an earlier message?

The Vtable is used to dispatch virtual functions in (some
implementations) of C++. There is one such table for each class
and it contains a pointer to each virtual function defined. Each
object holds a pointer to it's actual class vtable. This is the
mechanism used to implement polymorphism for C++ virtual functions.

I think a similar means can be used for the inheritence of
properties in FOP.

class a {
  virtual int f() { return 3; }
}

class b : a {
  virtual int f() { return 33; }
}

...

a* z = new b;

cout << "a" << z->f() << endl;

class a vTable contains address of a::f()
      b                            b::f()

instance z includes pointer to the class b vTable 
and is function b::f() is called using pointer to
object of type a.

-- 
John Austin <jwaustin@sympatico.ca>

Mime
View raw message