1 // RTTI support internals for -*- C++ -*-
2 // Copyright (C) 1994, 1995, 1996 Free Software Foundation
6 // Class declarations shared between the typeinfo implementation files.
8 // type_info for a class with no base classes (or an enum).
10 struct __user_type_info
: public type_info
{
11 __user_type_info (const char *n
) : type_info (n
) {}
13 // If our type can be converted to the desired type,
14 // return the pointer, adjusted accordingly; else return 0.
15 virtual void* dcast (const type_info
&, int, void *,
16 const type_info
* = 0, void * = 0) const;
19 // type_info for a class with one public, nonvirtual base class.
21 class __si_type_info
: public __user_type_info
{
22 const __user_type_info
&base
;
25 __si_type_info (const char *n
, const __user_type_info
&b
)
26 : __user_type_info (n
), base (b
) { }
28 virtual void *dcast (const type_info
&, int, void *,
29 const type_info
* = 0, void * = 0) const;
32 // type_info for a general class.
34 typedef unsigned int USItype
__attribute__ ((mode (SI
)));
36 struct __class_type_info
: public __user_type_info
{
37 enum access
{ PUBLIC
= 1, PROTECTED
= 2, PRIVATE
= 3 };
40 const __user_type_info
*base
;
46 const base_info
*base_list
;
49 __class_type_info (const char *name
, const base_info
*bl
, size_t bn
)
50 : __user_type_info (name
), base_list (bl
), n_bases (bn
) {}
52 // This is a little complex.
53 virtual void* dcast (const type_info
&, int, void *,
54 const type_info
* = 0, void * = 0) const;