Panda3D
Public Member Functions

WeakReferenceList Class Reference

This is a list of WeakPointerTo's that share a reference to a given ReferenceCount object. More...

#include "weakReferenceList.h"

List of all members.

Public Member Functions

 ~WeakReferenceList ()
 The destructor tells all of the owned references that we're gone.
void add_reference (WeakPointerToVoid *ptv)
 Intended to be called only by WeakPointerTo (or by any class implementing a weak reference-counting pointer), this adds the indicated PointerToVoid structure to the list of such structures that are maintaining a weak pointer to this object.
void clear_reference (WeakPointerToVoid *ptv)
 Intended to be called only by WeakPointerTo (or by any class implementing a weak reference-counting pointer), this removes the indicated PointerToVoid structure from the list of such structures that are maintaining a weak pointer to this object.

Detailed Description

This is a list of WeakPointerTo's that share a reference to a given ReferenceCount object.

It is stored in a separate class since it is assumed that most ReferenceCount objects do not need to store this list at all; this avoids bloating every ReferenceCount object in the world with the size of this object.

Definition at line 34 of file weakReferenceList.h.


Constructor & Destructor Documentation

WeakReferenceList::~WeakReferenceList ( )

The destructor tells all of the owned references that we're gone.

Definition at line 35 of file weakReferenceList.cxx.


Member Function Documentation

void WeakReferenceList::add_reference ( WeakPointerToVoid ptv)

Intended to be called only by WeakPointerTo (or by any class implementing a weak reference-counting pointer), this adds the indicated PointerToVoid structure to the list of such structures that are maintaining a weak pointer to this object.

When the WeakReferenceList destructs (presumably because its owning object destructs), the pointer within the PointerToVoid object will be set to NULL.

Definition at line 58 of file weakReferenceList.cxx.

Referenced by ReferenceCount::weak_ref().

void WeakReferenceList::clear_reference ( WeakPointerToVoid ptv)

Intended to be called only by WeakPointerTo (or by any class implementing a weak reference-counting pointer), this removes the indicated PointerToVoid structure from the list of such structures that are maintaining a weak pointer to this object.

Definition at line 75 of file weakReferenceList.cxx.


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