14#ifndef WEAKPOINTERTOVOID_H
15#define WEAKPOINTERTOVOID_H
26class EXPCL_PANDA_EXPRESS WeakPointerToVoid :
public PointerToVoid {
28 constexpr WeakPointerToVoid()
noexcept =
default;
Derive from this class and override the callback() method if you want to get an immediate callback fr...
void add_callback(WeakPointerCallback *callback) const
Sets a callback that will be made when the pointer is deleted.
void remove_callback(WeakPointerCallback *callback) const
Removes a previously added callback.
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.
This is an object shared by all the weak pointers that point to the same ReferenceCount object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.