typed vtable

Harry Vennik htvennik at zonnet.nl
Mon Nov 17 10:56:55 PST 2008


Hi,

One of the things D claims is that it eliminates the need for IDL. And yeah, it does a lot in that direction, but I found something that's missing while trying to actually implement some sense of RPC...

To get a good view of an interface that can be used to construct the necessary stub code, you need to have a typed vtable. And D almost provides it... You can get the untyped vtable, you can get a typed list of virtual function overloads by name, and you can get the names of all interface members... So you can get all what's needed, except that there is no way to know the vtable index of a member function!!!

My proposal to fix this is to allow an expression like:

__traits(getVirtualFunctions, T)           // no second argument!

where T is an interface or class type (or an expression of such a type). Such an expression should then return all virtual member functions in vtable order, thus making it possible to relate the function itself to its vtable index.

Regards,

Harry Vennik





More information about the Digitalmars-d mailing list