Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!huxley!glenn From: glenn@huxley.huxley.bitstream.com (Glenn P. Parker) Newsgroups: comp.std.c++ Subject: Re: type/member tags (was Re: asking an object for its type) Message-ID: Date: 26 Feb 91 19:10:38 GMT References: <1991Feb19.214327.13930@gpu.utcs.utoronto.ca> <27C2D973.3C1B@tct.uucp> <27C95D3A.1715@tct.uucp> Sender: glenn@huxley.UUCP Reply-To: (Glenn Parker) Distribution: comp Organization: Bitstream, Inc. Lines: 18 In-reply-to: chip@tct.uucp's message of 25 Feb 91 18:53:46 GMT In article <27C95D3A.1715@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: > According to dsouza@optima.cad.mcc.com (Desmond Dsouza): >>1. Persistent objects: When reading in one of these from disk, you >> need to know what constructor to call. Hence you need to encode in >> the persistent image the ClassId of the object. > > Presumably, a well-designed class hierarchy will use a virtual > function to store objects; and a virtual function by definition will > already know the exact type of the object it is storing. Check that article again. Desmond is talking about reading in a persistent object, not writing it out. I believe this is the most common (and most easily explained) situation that requires "extra" type information. -- Glenn P. Parker glenn@bitstream.com Bitstream, Inc. uunet!huxley!glenn 215 First Street BIX: parker Cambridge, MA 02142-1270