14 #ifndef REGISTER_TYPE_H
15 #define REGISTER_TYPE_H
79 extern TypeHandle EXPCL_DTOOL_DTOOLBASE long_type_handle;
80 extern TypeHandle EXPCL_DTOOL_DTOOLBASE int_type_handle;
81 extern TypeHandle EXPCL_DTOOL_DTOOLBASE uint_type_handle;
82 extern TypeHandle EXPCL_DTOOL_DTOOLBASE short_type_handle;
83 extern TypeHandle EXPCL_DTOOL_DTOOLBASE ushort_type_handle;
84 extern TypeHandle EXPCL_DTOOL_DTOOLBASE char_type_handle;
85 extern TypeHandle EXPCL_DTOOL_DTOOLBASE uchar_type_handle;
86 extern TypeHandle EXPCL_DTOOL_DTOOLBASE bool_type_handle;
87 extern TypeHandle EXPCL_DTOOL_DTOOLBASE double_type_handle;
88 extern TypeHandle EXPCL_DTOOL_DTOOLBASE float_type_handle;
89 extern TypeHandle EXPCL_DTOOL_DTOOLBASE string_type_handle;
90 extern TypeHandle EXPCL_DTOOL_DTOOLBASE wstring_type_handle;
101 extern TypeHandle EXPCL_DTOOL_DTOOLBASE pvector_type_handle;
102 extern TypeHandle EXPCL_DTOOL_DTOOLBASE ov_set_type_handle;
103 extern TypeHandle EXPCL_DTOOL_DTOOLBASE pdeque_type_handle;
104 extern TypeHandle EXPCL_DTOOL_DTOOLBASE plist_type_handle;
105 extern TypeHandle EXPCL_DTOOL_DTOOLBASE pmap_type_handle;
106 extern TypeHandle EXPCL_DTOOL_DTOOLBASE pset_type_handle;
108 void EXPCL_DTOOL_DTOOLBASE init_system_type_handles();
114 INLINE
TypeHandle _get_type_handle(
const T *) {
115 return T::get_class_type();
119 INLINE
TypeHandle _get_type_handle(
const long *) {
120 return long_type_handle;
124 INLINE
TypeHandle _get_type_handle(
const int *) {
125 return int_type_handle;
129 INLINE
TypeHandle _get_type_handle(
const unsigned int *) {
130 return uint_type_handle;
134 INLINE
TypeHandle _get_type_handle(
const short *) {
135 return short_type_handle;
139 INLINE
TypeHandle _get_type_handle(
const unsigned short *) {
140 return ushort_type_handle;
144 INLINE
TypeHandle _get_type_handle(
const char *) {
145 return char_type_handle;
149 INLINE
TypeHandle _get_type_handle(
const unsigned char *) {
150 return uchar_type_handle;
154 INLINE
TypeHandle _get_type_handle(
const bool *) {
155 return bool_type_handle;
159 INLINE
TypeHandle _get_type_handle(
const double *) {
160 return double_type_handle;
164 INLINE
TypeHandle _get_type_handle(
const float *) {
165 return float_type_handle;
169 INLINE
TypeHandle _get_type_handle(
const std::string *) {
170 return string_type_handle;
174 INLINE
TypeHandle _get_type_handle(
const std::wstring *) {
175 return wstring_type_handle;
179 INLINE
TypeHandle _get_type_handle(
const long *
const *) {
180 return long_p_type_handle;
184 INLINE
TypeHandle _get_type_handle(
const int *
const *) {
185 return int_p_type_handle;
189 INLINE
TypeHandle _get_type_handle(
const short *
const *) {
190 return short_p_type_handle;
194 INLINE
TypeHandle _get_type_handle(
const char *
const *) {
195 return char_p_type_handle;
199 INLINE
TypeHandle _get_type_handle(
const bool *
const *) {
200 return bool_p_type_handle;
204 INLINE
TypeHandle _get_type_handle(
const double *
const *) {
205 return double_p_type_handle;
209 INLINE
TypeHandle _get_type_handle(
const float *
const *) {
210 return float_p_type_handle;
214 INLINE
TypeHandle _get_type_handle(
const void *
const *) {
215 return void_p_type_handle;
221 #define get_type_handle(type) _get_type_handle((const type *)0)
228 INLINE
void _do_init_type(
const T *) {
233 INLINE
void _do_init_type(
const long *) {
234 init_system_type_handles();
238 INLINE
void _do_init_type(
const int *) {
239 init_system_type_handles();
243 INLINE
void _do_init_type(
const short *) {
244 init_system_type_handles();
248 INLINE
void _do_init_type(
const char *) {
249 init_system_type_handles();
253 INLINE
void _do_init_type(
const bool *) {
254 init_system_type_handles();
258 INLINE
void _do_init_type(
const double *) {
259 init_system_type_handles();
263 INLINE
void _do_init_type(
const float *) {
264 init_system_type_handles();
268 INLINE
void _do_init_type(
const long *
const *) {
269 init_system_type_handles();
273 INLINE
void _do_init_type(
const int *
const *) {
274 init_system_type_handles();
278 INLINE
void _do_init_type(
const short *
const *) {
279 init_system_type_handles();
283 INLINE
void _do_init_type(
const char *
const *) {
284 init_system_type_handles();
288 INLINE
void _do_init_type(
const bool *
const *) {
289 init_system_type_handles();
293 INLINE
void _do_init_type(
const double *
const *) {
294 init_system_type_handles();
298 INLINE
void _do_init_type(
const float *
const *) {
299 init_system_type_handles();
303 INLINE
void _do_init_type(
const void *
const *) {
304 init_system_type_handles();
307 #define do_init_type(type) _do_init_type((const type *)0)
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
TypeHandle register_dynamic_type(const std::string &name)
This is essentially similar to register_type(), except that it doesn't store a reference to any TypeH...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.