home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / TYPEINFO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  1.9 KB  |  103 lines

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