From 5591050077696303722
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,acc90f722d69449b
X-Google-Attributes: gidf78e5,public
From: ajay@lehman.com (Ajay Kamdar)
Subject: Re: Make type_info name() distinct?
Date: 1996/02/09
Message-ID: <4fdsql$e6m@jabba.lehman.com>#1/1
X-Deja-AN: 138682631
references: <v01530500ad36a19a2831@[194.163.74.11]> <199602030146.RAA14333@shellx.best.com> <xsorawcazry.fsf@avs.cs.rpi.edu>
organization: Lehman Brothers, Inc.
x-original-date: 8 Feb 1996 17:17:57 -0500
x-auth: PGPMoose V1.1 PGP comp.std.c++
newsgroups: comp.std.c++

In article <xsorawcazry.fsf@avs.cs.rpi.edu>,
David Vandevoorde <vandevod@cs.rpi.edu> wrote:
>
>>>>>> "BG" == Bill Gibbons <bgibbons@best.com> writes:
>[...]
>BG> There is some chance that some canonical form will be recommended
>BG> in a non-normative annex in the standard.
>
>There was a thread here some time ago concluding that RTTI would be
>considerably more convenient for purposes of object persistence and 
>transportation if this could be standardized somehow.

Standardizing the return value of name() helps, but only a little.
RTTI would be considerably more convenient for the purposes of
object persistence and transportation if it also included the
following object layout information:

    + Information about data members.
      For each data member, this information would consist of
	  # data member typeinfo
	  # data member name
	  # isAPointer? (number of indirections if yes)
	  # isAReference?
	  # raw offset from start of immediately containing object
	    (This would be of course compiler and platform specific.
	     But that is _exactly_ what is required.)

    + Information about base classes
      For each base class, this information would consist of 
	  # base class typeinfo
	  # virtual derivation?
	  # raw offset from start of deriving class; offset to 
	    the actual sub-object is a virtual base class

    + Virtual destructor?


base classes were
	  # access protection (public/protected/private)
	  # type of derivation (public/protected/private)


This list is probably not exhaustive, but would be a good first start.

The compiler generates all this meta data for itself, and unfortunately
throws it all away rather than allowing access to it
programmatically. With in the last five years I have worked on three
separate projects where the availability of meta data from
the compiler itself would have saved us very significant amounts of
time and money inventing elaborate meta data generation mechanisms of
our own.

I don't remember any discussion in this forum as to why the standards
committee limited RTTI information to its current form. Did the
committee ever consider standardizing more detailed RTTI?
Were there technical problems which prevented such standardization?
-- 
Ajay Kamdar        |    Email: ajay@lehman.com    |    Standard Disclaimer 
Lehman Brothers    |    Phone: (201) 524-5048     |
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  Moderation policy:
  http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]



