15 #include "memoryInfo.h" 17 #ifdef DO_MEMORY_USAGE 19 #include "typedReferenceCount.h" 20 #include "typeHandle.h" 29 _void_ptr = (
void *)NULL;
49 if ((_flags & F_reconsider_dynamic_type) == 0) {
62 determine_dynamic_type();
66 update_type_handle(type, _dynamic_type);
68 if (type != _static_type) {
69 if (express_cat.is_spam()) {
71 <<
"Pointer " << get_void_ptr() <<
" has static type " 72 << _static_type <<
" and dynamic type " << _dynamic_type <<
"\n";
86 determine_dynamic_type() {
87 if ((_flags & F_reconsider_dynamic_type) != 0 &&
96 if (_static_type.is_derived_from(TypedReferenceCount::get_class_type())) {
109 express_cat.warning()
110 <<
"Found an unregistered type in a " << _static_type
112 <<
"Check derived types of " << _static_type
113 <<
" and make sure that all are being initialized.\n";
114 _dynamic_type = _static_type;
115 _flags &= ~F_reconsider_dynamic_type;
118 nassert_raise(
"Unregistered type");
124 update_type_handle(_dynamic_type, got_type);
143 <<
"Attempt to update type of " << get_void_ptr()
144 <<
"(type is " << get_type()
145 <<
") to an undefined type!\n";
147 }
else if (destination == refined) {
156 if (express_cat.is_spam()) {
158 <<
"Updating " << get_void_ptr() <<
" from type " 159 << destination <<
" to type " << refined <<
"\n";
161 destination = refined;
165 express_cat.warning()
166 <<
"Pointer " << get_void_ptr() <<
" previously indicated as type " 167 << destination <<
" is now type " << refined <<
"!\n";
174 #endif // DO_MEMORY_USAGE static TypeHandle none()
Returns a special zero-valued TypeHandle that is used to indicate no type.
bool is_derived_from(TypeHandle parent, TypedObject *object=(TypedObject *) NULL) const
Returns true if this type is derived from the indicated type, false otherwise.
This is a convenience class to specialize ConfigVariable as a boolean type.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
A base class for all things that want to be reference-counted.
TypeHandle is the identifier used to differentiate C++ class types.