Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access to virtual function table?

1 view
Skip to first unread message

ke...@uiucdcsb.cs.uiuc.edu

unread,
Oct 21, 1986, 2:57:00 PM10/21/86
to

(Don asbestos suit)

Is there any way in C++ to get access to the virtual function table for
a particular class? I'm trying to hack up, without yaccing up a
preprocessor, a ``monitor'' object that behaves like one of Hoare's
monitors. The entry and exit primitives are well defined, so that if
I'm willing to throw portability to the winds, I could just replace the
virtual function entries with things that do:

this.entry();
<call the original virtual function with the same arguments that
my caller gave me>
this.exit();

and for any of the machines that I'm expecting to deal with, this hook
is easy enough to build. I find that marginally superior to having to
remember to put entry() and exit() primitives in every member function.

What I *really* want (dream on) is something analogous to the :BEFORE,
:AFTER, and :AROUND specifiers in the ``flavors'' package (Smalltalk
has these too, but I don't remember what they're called).

(Shoot fire extinguisher and remove asbestos suit)

Kevin Kenny UUCP: {ihnp4,pur-ee,convex}!uiucdcs!kenny
Department of Computer Science ARPA: ke...@B.CS.UIUC.EDU (ke...@UIUC.ARPA)
University of Illinois CSNET: ke...@UIUC.CSNET
1304 W. Springfield Ave.
Urbana, Illinois, 61801 Voice: (217) 333-7980

ke...@uiucdcsb.cs.uiuc.edu

unread,
Oct 23, 1986, 3:48:17 PM10/23/86
to
0 new messages