Panda3D
Public Types | Public Member Functions

WeakConstPointerTo< T > Class Template Reference

A WeakConstPointerTo is similar to a WeakPointerTo, except it keeps a const pointer to the thing, that will be cleared to NULL when the thing deleted. More...

#include "weakPointerTo.h"

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

List of all members.

Public Types

typedef WeakPointerToBase< T >::To To

Public Member Functions

 WeakConstPointerTo (const To *ptr=(const To *) NULL)
 WeakConstPointerTo (const PointerTo< T > &copy)
 WeakConstPointerTo (const WeakPointerTo< T > &copy)
 WeakConstPointerTo (const WeakConstPointerTo< T > &copy)
 WeakConstPointerTo (const ConstPointerTo< T > &copy)
void clear ()
 A convenient way to set the PointerTo object to NULL.
const To * get_orig () const
 Returns the original pointer value, even if the object has since been deleted.
bool is_null () const
 Returns true if the PointerTo is a NULL pointer, false otherwise.
 operator const T * () const
 We also have the typecast operator to automatically convert WeakConstPointerTo's to the required kind of actual pointer.
const To & operator* () const
const To * operator-> () const
WeakConstPointerTo< T > & operator= (const ConstPointerTo< T > &copy)
WeakConstPointerTo< T > & operator= (const WeakPointerTo< T > &copy)
WeakConstPointerTo< T > & operator= (const To *ptr)
WeakConstPointerTo< T > & operator= (const PointerTo< T > &copy)
WeakConstPointerTo< T > & operator= (const WeakConstPointerTo< T > &copy)
const To * p () const
 Returns an ordinary pointer instead of a WeakConstPointerTo.

Detailed Description

template<class T>
class WeakConstPointerTo< T >

A WeakConstPointerTo is similar to a WeakPointerTo, except it keeps a const pointer to the thing, that will be cleared to NULL when the thing deleted.

Definition at line 69 of file weakPointerTo.h.


Member Function Documentation

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

A convenient way to set the PointerTo object to NULL.

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

Reimplemented from WeakPointerToBase< T >.

Definition at line 99 of file weakPointerTo.h.

template<class T >
const WeakConstPointerTo< T >::To * WeakConstPointerTo< T >::get_orig ( ) const [inline]

Returns the original pointer value, even if the object has since been deleted.

Definition at line 277 of file weakPointerTo.I.

template<class T>
bool WeakConstPointerTo< T >::is_null ( ) const [inline]

Returns true if the PointerTo is a NULL pointer, false otherwise.

(Direct comparison to a NULL pointer also works.)

Reimplemented from PointerToVoid.

Definition at line 98 of file weakPointerTo.h.

template<class T >
WeakConstPointerTo< T >::operator const T * ( ) const [inline]

We also have the typecast operator to automatically convert WeakConstPointerTo's to the required kind of actual pointer.

This introduces ambiguities which the compiler will resolve one way or the other, but we don't care which way it goes because either will be correct.

Definition at line 250 of file weakPointerTo.I.

template<class T >
const WeakConstPointerTo< T >::To * WeakConstPointerTo< T >::p ( ) const [inline]

Returns an ordinary pointer instead of a WeakConstPointerTo.

Useful to work around compiler problems, particularly for implicit upcasts.

Definition at line 264 of file weakPointerTo.I.


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