home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / INC.PAK / TYPEINFO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.9 KB  |  107 lines

  1. /*  typeinfo.h
  2.  
  3.     Definitions for RTTI
  4. */
  5.  
  6. /*
  7.  *      C/C++ Run Time Library - Version 8.0
  8.  *
  9.  *      Copyright (c) 1993, 1997 by Borland International
  10.  *      All Rights Reserved.
  11.  *
  12.  */
  13. /* $Revision:   8.1  $ */
  14.  
  15. #if !defined(__cplusplus)
  16. #error Must use C++ for typeinfo.h
  17. #endif
  18.  
  19. #if defined(__TINY__)
  20. #error Cannot use Runtime Type Information in tiny model
  21. #endif
  22.  
  23. #ifndef __TYPEINFO_H
  24. #define __TYPEINFO_H
  25.  
  26. #if !defined(___DEFS_H)
  27. #include <_defs.h>
  28. #endif
  29.  
  30.  
  31. #if !defined(RC_INVOKED)
  32.  
  33. #if defined(__STDC__)
  34. #pragma warn -nak
  35. #endif
  36.  
  37. #pragma option  -Vt-                    // make sure vtable pointer is 'low'
  38. #pragma option  -RT
  39.  
  40. #endif  /* !RC_INVOKED */
  41.  
  42.  
  43. #if defined(_BUILDRTLDLL) || defined(_RTLDLL)
  44. #   define _TIDIST   _EXPCLASS
  45. #else
  46. #   if defined(__FLAT__)
  47. #     define _TIDIST
  48. #   else
  49. #      if     defined(__LARGE__) || defined(__COMPACT__) || defined(__HUGE__) || defined(__DLL__)
  50. #         define _TIDIST  __huge
  51. #      else
  52. #         define _TIDIST  __huge __near
  53. #      endif
  54. #   endif
  55. #endif
  56.  
  57. class                   tpid;
  58.  
  59. class   _TIDIST  __rtti typeinfo
  60. {
  61.  
  62. public:
  63.  
  64. #if defined(__FLAT__)
  65.         tpid          * tpp;
  66. #else
  67.         tpid    __far * tpp;
  68. #endif
  69.  
  70. private:
  71.                 __cdecl typeinfo(const typeinfo _FAR &);
  72.     typeinfo &  __cdecl operator=(const typeinfo _FAR &);
  73.  
  74. public:
  75.  
  76.     virtual     __cdecl ~typeinfo();
  77.  
  78.     bool        __cdecl operator==(const typeinfo _FAR &) const;
  79.     bool        __cdecl operator!=(const typeinfo _FAR &) const;
  80.  
  81.     bool        __cdecl before(const typeinfo _FAR &) const;
  82.  
  83.     const char _FAR *__cdecl name() const;
  84. };
  85.  
  86.  
  87. #if !defined(__STDC__)
  88. typedef typeinfo Type_info;  // For backwards compatibility.
  89. #endif
  90.  
  91. class   Bad_cast{};
  92. class   Bad_typeid{};
  93.  
  94.  
  95. #if !defined(RC_INVOKED)
  96.  
  97. #pragma option  -RT.
  98. #pragma option  -Vt.
  99.  
  100. #if defined(__STDC__)
  101. #pragma warn .nak
  102. #endif
  103.  
  104. #endif  /* !RC_INVOKED */
  105.  
  106. #endif
  107.