home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 415_02 / rtti / include / rttiimpl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-04  |  1.7 KB  |  54 lines

  1. #ifndef  _H_RTTI_IMPL
  2. #define  _H_RTTI_IMPL
  3.  
  4. /* %Z%%I%       %G% %U% %W% */
  5. /*
  6.  * COMPONENT_NAME: (COMINC) Common Header File for RTTI
  7.  *
  8.  * ORIGINS: 27
  9.  *
  10.  * (C) COPYRIGHT International Business Machines Corp. 1992
  11.  * This work was supported by a grant from International Business
  12.  * Machines, Inc. These procedures are contributed to the public domain
  13.  * by International Business Machines Inc. "AS IS" without any warranty
  14.  * of any kind including the warranty of merchantability or fitness
  15.  * for a particular purpose.
  16.  *
  17.  *
  18.  * This is free software. Feel free to redistribute and/or modify it.
  19.  * Please send us e-mail and let us know if you have any problems
  20.  * or suggestions.
  21.  *
  22.  * Arindam Banerji
  23.  * axb@cse.nd.edu
  24.  *
  25.  */
  26.  
  27.  
  28. // rttiimpl.h
  29. // This file includes the definition of the RTTI implementation as specified
  30. // by Stousroup. The implementation is portable to any compiler. The base
  31. // list class defined here is primarily geared towards creating a complete
  32. // list of all the base classes (direct or indirect) of a particular class.
  33.  
  34. const   int   BASE_LIST_INCR  =     5 ; // space for base classes are added
  35.                     // in increments, as needed.
  36.  
  37.  
  38. class  base_list {
  39. public :
  40.       base_list () : sz (0) , list (0), num(0)  { }  ;
  41.       base_list (const Type_info **b) ;
  42.       ~base_list ( ) { delete [] (Type_info *) list ; }
  43.       int   number() { return sz ; }
  44.       void  copy_bases (const Type_info **b) ;
  45. private :
  46.       int   sz  ;
  47.       const Type_info **list ;
  48.       int   num ;
  49.       void   add_to_list (const Type_info *) ;
  50.       void   add ( const Type_info *) ;
  51.   } ; // specification for the class that actually creates a list of bases
  52.  
  53. #endif   // _H_RTTI_IMPL
  54.