18 #include "pandabase.h"
20 #include "typeHandle.h"
21 #include "typedObject.h"
22 #include "config_express.h"
34 template<
class WantType>
35 INLINE WantType *_dcast(WantType *,
TypedObject *ptr);
36 template<
class WantType>
37 INLINE
const WantType *_dcast(WantType *,
const TypedObject *ptr);
44 #define DCAST(want_type, pointer) _dcast((want_type*)0, pointer)
63 template<
class WantType>
64 INLINE WantType *_dcast_ref(WantType *&,
TypedObject *ptr);
65 template<
class WantType>
66 INLINE
const WantType *_dcast_ref(WantType *&,
const TypedObject *ptr);
70 EXPCL_PANDAEXPRESS
bool
71 _dcast_verify(
TypeHandle want_handle,
size_t want_size,
75 #define DCAST_INTO_V(to_pointer, from_pointer) \
77 (to_pointer) = _dcast_ref(to_pointer, from_pointer); \
78 nassertv((void *)(to_pointer) != (void *)NULL); \
81 #define DCAST_INTO_R(to_pointer, from_pointer, return_value) \
83 (to_pointer) = _dcast_ref(to_pointer, from_pointer); \
84 nassertr((void *)(to_pointer) != (void *)NULL, return_value); \
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
TypeHandle is the identifier used to differentiate C++ class types.