Panda3D
 All Classes Functions Variables Enumerations
Public Member Functions | List of all members
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 >

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. More...
 
bool is_valid_pointer () const
 Returns true if the pointer is not null and the object has not been deleted. More...
 
void mark_deleted ()
 This is intended only to be called by the WeakPointerList destructor. More...
 
void set_callback (WeakPointerCallback *callback)
 Sets a callback that will be made when the pointer is deleted. More...
 
bool was_deleted () const
 Returns true if the object we are pointing to has been deleted, false otherwise. More...
 
- Public Member Functions inherited from PointerToVoid
size_t get_hash () const
 
bool is_null () const
 Returns true if the PointerTo is a NULL pointer, false otherwise. More...
 
bool operator!= (const PointerToVoid &other) const
 
bool operator< (const void *other) const
 
bool operator< (const PointerToVoid &other) const
 
bool operator== (const PointerToVoid &other) const
 
void swap (PointerToVoid &other) NOEXCEPT
 Swaps the contents of this PointerTo with the other, without touching the reference counts. More...
 

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

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.


The documentation for this class was generated from the following files: