On Mon, 2003-12-01 at 02:11, Glen Mazza wrote:
> --- John Austin <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>

Reply via email to