Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tekchips!tekcrl!brucec From: brucec@phoebus.labs.tek.com (Bruce Cohen;;50-662;LP=A;) Newsgroups: comp.lang.c++ Subject: Re: Smart pointers and stupid people (was: garbage collection...) Message-ID: Date: 17 Jan 91 21:26:54 GMT References: <1990Dec20.045909.7681@rice.edu> <3071@lupine.NCD.COM> <3090@lupine.NCD.COM> <1991Jan2.205606.1020@lia> <60330@microsoft.UUCP> <70021@microsoft.UUCP> cimshop!davidm@uunet.UU.NET (David S. Masterson) writes: > > The Fall 1990 issue of C++ Journal discusses the Dossier type and the > MKDossier command to capture information for generating Dossiers. I don't > fully understand the methodology being expressed in the article, but it sounds > like an alternative idea with the same goals as above. Anyone care to > comment? I've looked at Dossier in the course of trying to develop a tool for instrumenting C++ programs. I talked briefly with both Mark Linton and John Interrante, and got access to the Dossier source, but I want to emphasize that these are my own opinions, with reference to my application requirements, and I apologize if I misrepresent Mark or John, or if they've done something in the last month or two which invalidates what I say now. Mkdossier is a text filter that, given a C++ class definition in a source file, builds a source declaration of a Dossier object containing a classname string and information about the inheritance (lists of parents and children classes) and the file and line number of the class definition. Mark has talked about adding additional information, but as far as I know there's no one who plans to do that anytime soon. The current version of Dossier doesn't contain types and offsets of data members. For some applications, you would want a still more complete definition of the class, including descriptions of the member functions. If you want to get even more complex, I think you could implement most of the CLOS metaobject protocol by subclassing the MetaClass class which is the class of all class objects (I swear that sounds like Gilbert and Sullivan :-)). Getting back to earth, my application requires that I be able to find the types of all data members, and if they are pointers to class objects that I be able to follow those pointers recursively. So Dossier is insufficient for my purposes, and I've been forced to develop my own tools. Your mileage may vary. The basic idea, however, of an automatic tool which generates source code for metaobjects from your source, is (in my opinion) the right way to handle the problem of maintaining run-time information about classes. The tool I'm building is not really different in principle from mkdossier; it just has to be more complex to extract and use the information I need. -- ------------------------------------------------------------------------ Speaker-to-managers, aka Bruce Cohen, Computer Research Lab email: brucec@tekchips.labs.tek.com Tektronix Laboratories, Tektronix, Inc. phone: (503)627-5241 M/S 50-662, P.O. Box 500, Beaverton, OR 97077