Panda3D
|
This is the specialization of PointerToVoid for weak pointers. More...
#include "weakPointerToVoid.h"
Public Member Functions | |
WeakPointerCallback * | get_callback () const |
Returns the callback that will be made when the pointer is deleted, or NULL if no callback has been set. | |
bool | is_valid_pointer () const |
Returns true if the pointer is not null and the object has not been deleted. | |
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. | |
bool | was_deleted () const |
Returns true if the object we are pointing to has been deleted, false otherwise. | |
Protected Attributes | |
WeakPointerCallback * | _callback |
bool | _ptr_was_deleted |
This is the specialization of PointerToVoid for weak pointers.
It needs an additional flag to indicate that the pointer has been deleted.
Definition at line 28 of file weakPointerToVoid.h.
WeakPointerCallback * WeakPointerToVoid::get_callback | ( | ) | const [inline] |
Returns the callback that will be made when the pointer is deleted, or NULL if no callback has been set.
Definition at line 79 of file weakPointerToVoid.I.
bool WeakPointerToVoid::is_valid_pointer | ( | ) | const [inline] |
Returns true if the pointer is not null and the object has not been deleted.
Definition at line 101 of file weakPointerToVoid.I.
void WeakPointerToVoid::mark_deleted | ( | ) | [inline] |
This is intended only to be called by the WeakPointerList destructor.
It indicates that the object that we were pointing to has just been deleted.
Definition at line 45 of file weakPointerToVoid.I.
void WeakPointerToVoid::set_callback | ( | WeakPointerCallback * | callback | ) | [inline] |
Sets a callback that will be made when the pointer is deleted.
If a previous callback has already been set, it will be replaced.
If the pointer has already been deleted, the callback will be made immediately.
Definition at line 64 of file weakPointerToVoid.I.
bool WeakPointerToVoid::was_deleted | ( | ) | const [inline] |
Returns true if the object we are pointing to has been deleted, false otherwise.
Definition at line 90 of file weakPointerToVoid.I.