home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / TYPEINFO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  1.8 KB  |  101 lines

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