Urho3D
|
Weak array pointer template class. Uses non-intrusive reference counting. More...
#include </home/runner/work/urho3d-doxygen.github.io/urho3d-doxygen.github.io/urho3d_repo/Source/Urho3D/Container/ArrayPtr.h>
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. | |
RefCount * | RefCountPtr () const |
Return pointer to RefCount structure. | |
hash32 | 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. | |
RefCount * | refCount_ |
Pointer to the RefCount structure. | |
Weak array pointer template class. Uses non-intrusive reference counting.