Panda3D
Public Member Functions | Protected Attributes
WeakPointerToVoid Class Reference

This is the specialization of PointerToVoid for weak pointers. More...

#include "weakPointerToVoid.h"

Inheritance diagram for WeakPointerToVoid:
PointerToVoid MemoryBase WeakPointerToBase< T > WeakConstPointerTo< T > WeakPointerTo< T >

List of all members.

Public Member Functions

WeakPointerCallbackget_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

Detailed Description

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.


Member Function Documentation

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.

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.

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.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations