14#ifndef REGISTER_TYPE_H
15#define REGISTER_TYPE_H
79extern TypeHandle EXPCL_DTOOL_DTOOLBASE long_type_handle;
80extern TypeHandle EXPCL_DTOOL_DTOOLBASE int_type_handle;
81extern TypeHandle EXPCL_DTOOL_DTOOLBASE uint_type_handle;
82extern TypeHandle EXPCL_DTOOL_DTOOLBASE short_type_handle;
83extern TypeHandle EXPCL_DTOOL_DTOOLBASE ushort_type_handle;
84extern TypeHandle EXPCL_DTOOL_DTOOLBASE char_type_handle;
85extern TypeHandle EXPCL_DTOOL_DTOOLBASE uchar_type_handle;
86extern TypeHandle EXPCL_DTOOL_DTOOLBASE bool_type_handle;
87extern TypeHandle EXPCL_DTOOL_DTOOLBASE double_type_handle;
88extern TypeHandle EXPCL_DTOOL_DTOOLBASE float_type_handle;
89extern TypeHandle EXPCL_DTOOL_DTOOLBASE string_type_handle;
90extern TypeHandle EXPCL_DTOOL_DTOOLBASE wstring_type_handle;
101extern TypeHandle EXPCL_DTOOL_DTOOLBASE pvector_type_handle;
102extern TypeHandle EXPCL_DTOOL_DTOOLBASE ov_set_type_handle;
103extern TypeHandle EXPCL_DTOOL_DTOOLBASE pdeque_type_handle;
104extern TypeHandle EXPCL_DTOOL_DTOOLBASE plist_type_handle;
105extern TypeHandle EXPCL_DTOOL_DTOOLBASE pmap_type_handle;
106extern TypeHandle EXPCL_DTOOL_DTOOLBASE pset_type_handle;
108void EXPCL_DTOOL_DTOOLBASE init_system_type_handles();
114INLINE
TypeHandle _get_type_handle(
const T *) {
115 return T::get_class_type();
119INLINE
TypeHandle _get_type_handle(
const long *) {
120 return long_type_handle;
124INLINE
TypeHandle _get_type_handle(
const int *) {
125 return int_type_handle;
129INLINE
TypeHandle _get_type_handle(
const unsigned int *) {
130 return uint_type_handle;
134INLINE
TypeHandle _get_type_handle(
const short *) {
135 return short_type_handle;
139INLINE
TypeHandle _get_type_handle(
const unsigned short *) {
140 return ushort_type_handle;
144INLINE
TypeHandle _get_type_handle(
const char *) {
145 return char_type_handle;
149INLINE
TypeHandle _get_type_handle(
const unsigned char *) {
150 return uchar_type_handle;
154INLINE
TypeHandle _get_type_handle(
const bool *) {
155 return bool_type_handle;
159INLINE
TypeHandle _get_type_handle(
const double *) {
160 return double_type_handle;
164INLINE
TypeHandle _get_type_handle(
const float *) {
165 return float_type_handle;
169INLINE
TypeHandle _get_type_handle(
const std::string *) {
170 return string_type_handle;
174INLINE
TypeHandle _get_type_handle(
const std::wstring *) {
175 return wstring_type_handle;
179INLINE
TypeHandle _get_type_handle(
const long *
const *) {
180 return long_p_type_handle;
184INLINE
TypeHandle _get_type_handle(
const int *
const *) {
185 return int_p_type_handle;
189INLINE
TypeHandle _get_type_handle(
const short *
const *) {
190 return short_p_type_handle;
194INLINE
TypeHandle _get_type_handle(
const char *
const *) {
195 return char_p_type_handle;
199INLINE
TypeHandle _get_type_handle(
const bool *
const *) {
200 return bool_p_type_handle;
204INLINE
TypeHandle _get_type_handle(
const double *
const *) {
205 return double_p_type_handle;
209INLINE
TypeHandle _get_type_handle(
const float *
const *) {
210 return float_p_type_handle;
214INLINE
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)
228INLINE
void _do_init_type(
const T *) {
233INLINE
void _do_init_type(
const long *) {
234 init_system_type_handles();
238INLINE
void _do_init_type(
const int *) {
239 init_system_type_handles();
243INLINE
void _do_init_type(
const short *) {
244 init_system_type_handles();
248INLINE
void _do_init_type(
const char *) {
249 init_system_type_handles();
253INLINE
void _do_init_type(
const bool *) {
254 init_system_type_handles();
258INLINE
void _do_init_type(
const double *) {
259 init_system_type_handles();
263INLINE
void _do_init_type(
const float *) {
264 init_system_type_handles();
268INLINE
void _do_init_type(
const long *
const *) {
269 init_system_type_handles();
273INLINE
void _do_init_type(
const int *
const *) {
274 init_system_type_handles();
278INLINE
void _do_init_type(
const short *
const *) {
279 init_system_type_handles();
283INLINE
void _do_init_type(
const char *
const *) {
284 init_system_type_handles();
288INLINE
void _do_init_type(
const bool *
const *) {
289 init_system_type_handles();
293INLINE
void _do_init_type(
const double *
const *) {
294 init_system_type_handles();
298INLINE
void _do_init_type(
const float *
const *) {
299 init_system_type_handles();
303INLINE
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.