Panda3D
Public Types | Public Member Functions | Protected Member Functions
WeakPointerToBase< T > Class Template Reference

This is the base class for PointerTo and ConstPointerTo. More...

#include "weakPointerToBase.h"

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

List of all members.

Public Types

typedef T To

Public Member Functions

void clear ()
 A convenient way to set the PointerTo object to NULL.
bool operator!= (const To *other) const
bool operator!= (To *other) const
bool operator!= (const WeakPointerToBase< To > &other) const
bool operator!= (const PointerToBase< To > &other) const
bool operator< (const To *other) const
bool operator< (const WeakPointerToBase< To > &other) const
bool operator< (const PointerToBase< To > &other) const
bool operator<= (const To *other) const
bool operator<= (To *other) const
bool operator<= (const WeakPointerToBase< To > &other) const
bool operator<= (const PointerToBase< To > &other) const
bool operator== (const To *other) const
bool operator== (To *other) const
bool operator== (const WeakPointerToBase< To > &other) const
bool operator== (const PointerToBase< To > &other) const
bool operator> (const To *other) const
bool operator> (To *other) const
bool operator> (const WeakPointerToBase< To > &other) const
bool operator> (const PointerToBase< To > &other) const
bool operator>= (const To *other) const
bool operator>= (To *other) const
bool operator>= (const WeakPointerToBase< To > &other) const
bool operator>= (const PointerToBase< To > &other) const
void output (ostream &out) const
 A handy function to output PointerTo's as a hex pointer followed by a reference count.
void refresh () const
 Informs the WeakPointerTo object that its pointer is no longer deleted.

Protected Member Functions

 WeakPointerToBase (To *ptr)
 WeakPointerToBase (const PointerToBase< T > &copy)
 WeakPointerToBase (const WeakPointerToBase< T > &copy)
void reassign (To *ptr)
 This is the main work of the PointerTo family.
void reassign (const PointerToBase< To > &copy)
void reassign (const WeakPointerToBase< To > &copy)

Detailed Description

template<class T>
class WeakPointerToBase< T >

This is the base class for PointerTo and ConstPointerTo.

Don't try to use it directly; use either derived class instead.

Definition at line 29 of file weakPointerToBase.h.


Member Function Documentation

template<class T >
void WeakPointerToBase< T >::clear ( ) [inline]

A convenient way to set the PointerTo object to NULL.

(Assignment to a NULL pointer also works, of course.)

Reimplemented in WeakConstPointerTo< T >, and WeakPointerTo< T >.

Definition at line 394 of file weakPointerToBase.I.

template<class T >
void WeakPointerToBase< T >::output ( ostream &  out) const [inline]

A handy function to output PointerTo's as a hex pointer followed by a reference count.

Definition at line 424 of file weakPointerToBase.I.

template<class T >
void WeakPointerToBase< T >::reassign ( To *  ptr) [protected]

This is the main work of the PointerTo family.

When the pointer is reassigned, decrement the old reference count and increment the new one.

Definition at line 69 of file weakPointerToBase.I.

References TypeHandle::none().

template<class T >
void WeakPointerToBase< T >::refresh ( ) const [inline]

Informs the WeakPointerTo object that its pointer is no longer deleted.

This may be used after a WeakPointerTo has deleted a deleted pointer, and then a new pointer has been reallocated. It's equivalent to simply reassigning the pointer to its new (i.e. original) value, but has the advantage that it is const, so can be used for WeakPointers used as keys in STL maps and sets.

Definition at line 412 of file weakPointerToBase.I.


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