Urho3D::SharedArrayPtr< T > Class Template Reference

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

#include <ArrayPtr.h>

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

Public Member Functions

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

Private Member Functions

template<class U >
SharedArrayPtr< T > & operator= (const SharedArrayPtr< U > &rhs)
 Prevent direct assignment from a shared array pointer of different type.
 
void AddRef ()
 Add a reference to the array pointed to.
 
void ReleaseRef ()
 Release the array reference and delete it and 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::SharedArrayPtr< T >

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


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