15 #ifndef REGISTER_TYPE_H
16 #define REGISTER_TYPE_H
18 #include "dtoolbase.h"
20 #include "typeHandle.h"
21 #include "typeRegistry.h"
33 register_type(
TypeHandle &type_handle,
const string &name);
36 register_type(
TypeHandle &type_handle,
const string &name,
40 register_type(
TypeHandle &type_handle,
const string &name,
44 register_type(
TypeHandle &type_handle,
const string &name,
49 register_type(
TypeHandle &type_handle,
const string &name,
63 register_dynamic_type(
const string &name);
66 register_dynamic_type(
const string &name,
TypeHandle parent1);
69 register_dynamic_type(
const string &name,
73 register_dynamic_type(
const string &name,
78 register_dynamic_type(
const string &name,
84 extern TypeHandle EXPCL_DTOOL long_type_handle;
86 extern TypeHandle EXPCL_DTOOL uint_type_handle;
87 extern TypeHandle EXPCL_DTOOL short_type_handle;
88 extern TypeHandle EXPCL_DTOOL ushort_type_handle;
89 extern TypeHandle EXPCL_DTOOL char_type_handle;
90 extern TypeHandle EXPCL_DTOOL uchar_type_handle;
91 extern TypeHandle EXPCL_DTOOL bool_type_handle;
92 extern TypeHandle EXPCL_DTOOL double_type_handle;
93 extern TypeHandle EXPCL_DTOOL float_type_handle;
94 extern TypeHandle EXPCL_DTOOL string_type_handle;
95 extern TypeHandle EXPCL_DTOOL wstring_type_handle;
106 extern TypeHandle EXPCL_DTOOL pvector_type_handle;
107 extern TypeHandle EXPCL_DTOOL ov_set_type_handle;
108 extern TypeHandle EXPCL_DTOOL pdeque_type_handle;
109 extern TypeHandle EXPCL_DTOOL plist_type_handle;
110 extern TypeHandle EXPCL_DTOOL pmap_type_handle;
111 extern TypeHandle EXPCL_DTOOL pset_type_handle;
113 void EXPCL_DTOOL init_system_type_handles();
120 INLINE
TypeHandle _get_type_handle(
const T *) {
121 return T::get_class_type();
125 INLINE
TypeHandle _get_type_handle(
const long *) {
126 return long_type_handle;
130 INLINE
TypeHandle _get_type_handle(
const int *) {
131 return int_type_handle;
135 INLINE
TypeHandle _get_type_handle(
const unsigned int *) {
136 return uint_type_handle;
140 INLINE
TypeHandle _get_type_handle(
const short *) {
141 return short_type_handle;
145 INLINE
TypeHandle _get_type_handle(
const unsigned short *) {
146 return ushort_type_handle;
150 INLINE
TypeHandle _get_type_handle(
const char *) {
151 return char_type_handle;
155 INLINE
TypeHandle _get_type_handle(
const unsigned char *) {
156 return uchar_type_handle;
160 INLINE
TypeHandle _get_type_handle(
const bool *) {
161 return bool_type_handle;
165 INLINE
TypeHandle _get_type_handle(
const double *) {
166 return double_type_handle;
170 INLINE
TypeHandle _get_type_handle(
const float *) {
171 return float_type_handle;
175 INLINE
TypeHandle _get_type_handle(
const string *) {
176 return string_type_handle;
180 INLINE
TypeHandle _get_type_handle(
const wstring *) {
181 return wstring_type_handle;
185 INLINE
TypeHandle _get_type_handle(
const long *
const *) {
186 return long_p_type_handle;
190 INLINE
TypeHandle _get_type_handle(
const int *
const *) {
191 return int_p_type_handle;
195 INLINE
TypeHandle _get_type_handle(
const short *
const *) {
196 return short_p_type_handle;
200 INLINE
TypeHandle _get_type_handle(
const char *
const *) {
201 return char_p_type_handle;
205 INLINE
TypeHandle _get_type_handle(
const bool *
const *) {
206 return bool_p_type_handle;
210 INLINE
TypeHandle _get_type_handle(
const double *
const *) {
211 return double_p_type_handle;
215 INLINE
TypeHandle _get_type_handle(
const float *
const *) {
216 return float_p_type_handle;
220 INLINE
TypeHandle _get_type_handle(
const void *
const *) {
221 return void_p_type_handle;
227 #define get_type_handle(type) _get_type_handle((const type *)0)
235 INLINE
void _do_init_type(
const T *) {
240 INLINE
void _do_init_type(
const long *) {
241 init_system_type_handles();
245 INLINE
void _do_init_type(
const int *) {
246 init_system_type_handles();
250 INLINE
void _do_init_type(
const short *) {
251 init_system_type_handles();
255 INLINE
void _do_init_type(
const char *) {
256 init_system_type_handles();
260 INLINE
void _do_init_type(
const bool *) {
261 init_system_type_handles();
265 INLINE
void _do_init_type(
const double *) {
266 init_system_type_handles();
270 INLINE
void _do_init_type(
const float *) {
271 init_system_type_handles();
275 INLINE
void _do_init_type(
const long *
const *) {
276 init_system_type_handles();
280 INLINE
void _do_init_type(
const int *
const *) {
281 init_system_type_handles();
285 INLINE
void _do_init_type(
const short *
const *) {
286 init_system_type_handles();
290 INLINE
void _do_init_type(
const char *
const *) {
291 init_system_type_handles();
295 INLINE
void _do_init_type(
const bool *
const *) {
296 init_system_type_handles();
300 INLINE
void _do_init_type(
const double *
const *) {
301 init_system_type_handles();
305 INLINE
void _do_init_type(
const float *
const *) {
306 init_system_type_handles();
310 INLINE
void _do_init_type(
const void *
const *) {
311 init_system_type_handles();
314 #define do_init_type(type) _do_init_type((const type *)0)
316 #include "register_type.I"
TypeHandle is the identifier used to differentiate C++ class types.