🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #372

Access to virtual function table?

#372
From: kenny
Date: Thu, 23 Oct 1986 19:48
30 lines
1969 bytes
(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: kenny@B.CS.UIUC.EDU (kenny@UIUC.ARPA)
University of Illinois		CSNET: kenny@UIUC.CSNET
1304 W. Springfield Ave.
Urbana, Illinois, 61801		Voice: (217) 333-7980
Technical Details
Message-ID: <2338@curly.ucla-cs.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!husc6!mit-eddie!ll-xn!cit-vax!nike!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!rutgers!princeton!allegra!ulysses!mhuxr!mhuxt!houxm!ihnp4!inuxc!pur-ee!uiucdcs!uiucdcsb!kenny

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!husc6!mit-eddie!ll-xn!cit-vax!nike!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!rutgers!princeton!allegra!ulysses!mhuxr!mhuxt!houxm!ihnp4!inuxc!pur-ee!uiucdcs!uiucdcsb!kenny
From: kenny@uiucdcsb.cs.uiuc.edu
Newsgroups: net.lang.c++
Subject: Access to virtual function table?
Message-ID: <2338@curly.ucla-cs.ARPA>
Date: Thu, 23-Oct-86 14:48:17 EST
Article-I.D.: curly.2338
Posted: Thu Oct 23 14:48:17 1986
Date-Received: Sun, 26-Oct-86 03:46:20 EST
Organization: UCLA CS Department
Lines: 30
Nf-ID: #N:uiucdcsb:154000006:000:1249
Nf-From: uiucdcsb.cs.uiuc.edu!kenny    Oct 21 13:57:00 1986