1// RTTI support for -*- C++ -*- 2// Copyright (C) 1994, 95-97, 1998 Free Software Foundation 3 4#ifndef __TYPEINFO__ 5#define __TYPEINFO__ 6 7#pragma interface "typeinfo" 8 9#include <exception> 10 11extern "C++" { 12 13namespace std { 14 15class type_info { 16private: 17 // assigning type_info is not supported. made private. 18 type_info& operator= (const type_info&); 19 type_info (const type_info&); 20 21protected: 22 explicit type_info (const char *n): _name (n) { } 23 24 const char *_name; 25 26public: 27 // destructor 28 virtual ~type_info (); 29 30 bool before (const type_info& arg) const; 31 const char* name () const 32 { return _name; } 33 bool operator== (const type_info& arg) const; 34 bool operator!= (const type_info& arg) const; 35}; 36 37inline bool type_info:: 38operator!= (const type_info& arg) const 39{ 40 return !operator== (arg); 41} 42 43class bad_cast : public exception { 44public: 45 bad_cast() { } 46 virtual ~bad_cast() { } 47}; 48 49class bad_typeid : public exception { 50 public: 51 bad_typeid () { } 52 virtual ~bad_typeid () { } 53}; 54 55} // namespace std 56 57} // extern "C++" 58#endif 59