Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!lanl!beta.lanl.gov!dwf From: dwf@acl.lanl.gov (Dave Forslund) Newsgroups: comp.sys.isis Subject: Re: isis and C++ Message-ID: Date: 2 Feb 91 17:33:57 GMT References: <1991Feb1.151157.17332@noose.ecn.purdue.edu> <51494@cornell.UUCP> Sender: news@lanl.gov Reply-To: dwf@acl.lanl.gov Organization: Advanced Computing Lab, LANL, NM Lines: 41 In-reply-to: rcbc@cs.cornell.edu's message of 1 Feb 91 20:45:08 GMT In article <51494@cornell.UUCP> rcbc@cs.cornell.edu (Robert Cooper) writes: The main hassle using Isis from C++ is the issue of callback functions. It is difficult to pass a C++ member-function as a callback to many Isis routines that want callbacks, such as isis_entry, t_fork, pg_monitor etc., because its difficult to pass in the object to which the member-function belongs as the "hidden" argument to the member-function. The general way to get around this problem is to write regular C wrapper functions that call the appropriate C++ member functions. This loses some of the generality of C++, but it works. If I get time I'll post an example tiny program to illustrate this, or one of the C++ Isis users out there might want to give an example. "Eventually" we will do a better C++ interface on top of the C Isis interface. -- Robert Cooper One can do a little better than a pure C wrapper. If you use a static method and pass the "this" pointer to it as one of the arguments to invoke the appropriate object's method, you can use C++. You just need to pass the "this" pointer back to the calling process to "register" it. If you have only one instance of an object per process (as possibly implied by the pure C wrapper), you won't even need to worry about the this pointer. -- David Forslund Advanced Computing Laboratory MS B287 Los Alamos National Laboratory Los Alamos, NM 87545 Voice:(505) 665-1907 FAX: (505) 665-4939 EMAIL: dwf@lanl.gov