Panda3D
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

ThreadSafeConstPointerTo< T > Class Template Reference

Inheritance diagram for ThreadSafeConstPointerTo< T >:
ThreadSafePointerToBase< T > PointerToVoid MemoryBase

List of all members.

Public Types

typedef
ThreadSafePointerToBase< T >
::To 
To

Public Member Functions

 ThreadSafeConstPointerTo (const To *ptr=(const To *) NULL)
 ThreadSafeConstPointerTo (const ThreadSafePointerTo< T > &copy)
 ThreadSafeConstPointerTo (const ThreadSafeConstPointerTo< T > &copy)
void clear ()
 A convenient way to set the ThreadSafePointerTo object to NULL.
size_t get_hash () const
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 ThreadSafeConstPointerTo's to the required kind of actual pointer.
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size)
void * operator new[] (size_t size)
void * operator new[] (size_t size, void *ptr)
bool operator!= (const PointerToVoid &other) const
const To & operator* () const
const To * operator-> () const
bool operator< (const void *other) const
bool operator< (const PointerToVoid &other) const
ThreadSafeConstPointerTo< T > & operator= (const To *ptr)
ThreadSafeConstPointerTo< T > & operator= (const ThreadSafePointerTo< T > &copy)
ThreadSafeConstPointerTo< T > & operator= (const ThreadSafeConstPointerTo< T > &copy)
bool operator== (const PointerToVoid &other) const
void output (ostream &out) const
 A handy function to output ThreadSafePointerTo's as a hex pointer followed by a reference count.
const To * p () const
 Returns an ordinary pointer instead of a ThreadSafeConstPointerTo.

Protected Member Functions

void reassign (To *ptr)
 This is the main work of the ThreadSafePointerTo family.
void reassign (const ThreadSafePointerToBase< To > &copy)

Protected Attributes

void * _void_ptr

Detailed Description

template<class T>
class ThreadSafeConstPointerTo< T >

Definition at line 77 of file threadSafePointerTo.h.


Member Function Documentation

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

A convenient way to set the ThreadSafePointerTo object to NULL.

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

Reimplemented from ThreadSafePointerToBase< T >.

Definition at line 102 of file threadSafePointerTo.h.

bool PointerToVoid::is_null ( ) const [inline, inherited]

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

(Direct comparison to a NULL pointer also works.)

Reimplemented in PointerTo< T >, ThreadSafePointerTo< T >, and WeakConstPointerTo< T >.

Definition at line 54 of file pointerToVoid.I.

Referenced by TexturePeeker::is_valid().

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

We also have the typecast operator to automatically convert ThreadSafeConstPointerTo'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 204 of file threadSafePointerTo.I.

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

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

Definition at line 148 of file threadSafePointerToBase.I.

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

Returns an ordinary pointer instead of a ThreadSafeConstPointerTo.

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

Definition at line 217 of file threadSafePointerTo.I.

template<class T >
void ThreadSafePointerToBase< T >::reassign ( To *  ptr) [inline, protected, inherited]

This is the main work of the ThreadSafePointerTo family.

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

Definition at line 58 of file threadSafePointerToBase.I.


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