Urho3D::WeakArrayPtr< T > Class Template Reference

Weak array pointer template class. Uses non-intrusive reference counting. More...

#include <Urho3D/Container/ArrayPtr.h>

Collaboration diagram for Urho3D::WeakArrayPtr< T >:
[legend]

Public Member Functions

 WeakArrayPtr ()
 Construct a null weak array pointer.
 
 WeakArrayPtr (const WeakArrayPtr< T > &rhs)
 Copy-construct from another weak array pointer.
 
 WeakArrayPtr (const SharedArrayPtr< T > &rhs)
 Construct from a shared array pointer.
 
 ~WeakArrayPtr ()
 Destruct. Release the weak reference to the array.
 
WeakArrayPtr< T > & operator= (const SharedArrayPtr< T > &rhs)
 Assign from a shared array pointer.
 
WeakArrayPtr< T > & operator= (const WeakArrayPtr< T > &rhs)
 Assign from another weak array pointer.
 
SharedArrayPtr< T > Lock () const
 Convert to shared array pointer. If expired, return a null shared array pointer.
 
T * Get () const
 Return raw pointer. If expired, return null.
 
T * operator-> () const
 Point to the array.
 
T & operator* () const
 Dereference the array.
 
T & operator[] (const int index)
 Subscript the array.
 
bool operator== (const WeakArrayPtr< T > &rhs) const
 Test for equality with another weak array pointer.
 
bool operator!= (const WeakArrayPtr< T > &rhs) const
 Test for inequality with another weak array pointer.
 
bool operator< (const WeakArrayPtr< T > &rhs) const
 Test for less than with another weak array pointer.
 
 operator T * () const
 Convert to a raw pointer, null if array is expired.
 
void Reset ()
 Reset to null and release the weak reference.
 
template<class U >
void StaticCast (const WeakArrayPtr< U > &rhs)
 Perform a static cast from a weak array pointer of another type.
 
template<class U >
void DynamicCast (const WeakArrayPtr< U > &rhs)
 Perform a dynamic cast from a weak array pointer of another type.
 
bool Null () const
 Check if the pointer is null.
 
bool NotNull () const
 Check if the pointer is not null.
 
int Refs () const
 Return the array's reference count, or 0 if null pointer or if array has expired.
 
int WeakRefs () const
 Return the array's weak reference count.
 
bool Expired () const
 Return whether the array has expired. If null pointer, always return true.
 
RefCountRefCountPtr () const
 Return pointer to RefCount structure.
 
unsigned ToHash () const
 Return hash value for HashSet & HashMap.
 

Private Member Functions

template<class U >
WeakArrayPtr< T > & operator= (const WeakArrayPtr< U > &rhs)
 Prevent direct assignment from a weak array pointer of different type.
 
void AddRef ()
 Add a weak reference to the array pointed to.
 
void ReleaseRef ()
 Release the weak reference. Delete the Refcount structure if necessary.
 

Private Attributes

T * ptr_
 Pointer to the array.
 
RefCountrefCount_
 Pointer to the RefCount structure.
 

Detailed Description

template<class T>
class Urho3D::WeakArrayPtr< T >

Weak array pointer template class. Uses non-intrusive reference counting.


The documentation for this class was generated from the following file:
  • Source/Urho3D/Container/ArrayPtr.h