Article View: comp.std.c++
Article #867Re: type/member tags (was Re: asking an object for its type)
From: Glenn P. Parker
Date: Tue, 26 Feb 1991 19:10
Date: Tue, 26 Feb 1991 19:10
18 lines
1673 bytes
1673 bytes
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
Technical Details
Message-ID:
<GLENN.91Feb26141038@huxley.huxley.bitstream.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!huxley!glennReferences:
<1991Feb19.214327.13930@gpu.utcs.utoronto.ca> <27C2D973.3C1B@tct.uucp> <DSOUZA.91Feb24173454@optima.cad.mcc.com> <27C95D3A.1715@tct.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <GLENN.91Feb26141038@huxley.huxley.bitstream.com> Date: 26 Feb 91 19:10:38 GMT References: <1991Feb19.214327.13930@gpu.utcs.utoronto.ca> <27C2D973.3C1B@tct.uucp> <DSOUZA.91Feb24173454@optima.cad.mcc.com> <27C95D3A.1715@tct.uucp> Sender: glenn@huxley.UUCP Reply-To: <glenn@bitstream.com> (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