Urho3D
Public Member Functions | Private Member Functions | Private Attributes
Urho3D::SharedArrayPtr< T > Class Template Reference

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

#include <ArrayPtr.h>

List of all members.

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 bool () const
 Return true if points to an array.
 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 DynamicCast (const SharedArrayPtr< U > &rhs)
 Perform a dynamic 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 Release ()
 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: