21 INLINE WeakPointerToVoid::
23 _ptr_was_deleted =
false;
32 INLINE WeakPointerToVoid::
33 ~WeakPointerToVoid() {
46 nassertv(!_ptr_was_deleted);
47 _ptr_was_deleted =
true;
49 _callback->wp_callback(_void_ptr);
67 _callback->wp_callback(_void_ptr);
91 return _ptr_was_deleted;
102 return (_void_ptr != (
void *)NULL) && !_ptr_was_deleted;
bool was_deleted() const
Returns true if the object we are pointing to has been deleted, false otherwise.
bool is_valid_pointer() const
Returns true if the pointer is not null and the object has not been deleted.
WeakPointerCallback * get_callback() const
Returns the callback that will be made when the pointer is deleted, or NULL if no callback has been s...
Derive from this class and override the callback() method if you want to get an immediate callback fr...
void mark_deleted()
This is intended only to be called by the WeakPointerList destructor.
void set_callback(WeakPointerCallback *callback)
Sets a callback that will be made when the pointer is deleted.