23 if (_weak_ref !=
nullptr && !_weak_ref->
was_deleted()) {
25 }
else if (_void_ptr !=
nullptr) {
26 callback->wp_callback(_void_ptr);
36 if (_weak_ref !=
nullptr) {
51 return _void_ptr !=
nullptr && (_weak_ref ==
nullptr || _weak_ref->
was_deleted());
60 return _weak_ref !=
nullptr && !_weak_ref->
was_deleted();
void add_callback(WeakPointerCallback *callback, void *data)
Adds the callback to the list of callbacks that will be called when the underlying pointer is deleted...
bool was_deleted() const
Returns true if the object we are pointing to has been deleted, false otherwise.
bool was_deleted() const
Returns true if the object represented has been deleted, ie.
void remove_callback(WeakPointerCallback *callback) const
Removes a previously added callback.
bool is_valid_pointer() const
Returns true if the pointer is not null and the object has not been deleted.
void add_callback(WeakPointerCallback *callback) const
Sets a callback that will be made when the pointer is deleted.
Derive from this class and override the callback() method if you want to get an immediate callback fr...
void remove_callback(WeakPointerCallback *callback)
Intended to be called only by WeakPointerTo (or by any class implementing a weak reference-counting p...