home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / inc.pak / TYPEINFO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-24  |  1.9 KB  |  106 lines

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