Rebel Fork Framework
Urho3D::SharedPtr< InterfaceType, RefCountedType > Class Template Reference

Shared pointer template class with intrusive reference counting. More...

#include <Urho3D/Container/Ptr.h>

Inheritance diagram for Urho3D::SharedPtr< InterfaceType, RefCountedType >:
Urho3D::Detail::SharedPtrBase< InterfaceType, InterfaceType >

Public Types

using ThisType = SharedPtr< InterfaceType, RefCountedType >
 
using BaseType = Detail::SharedPtrBase< InterfaceType, RefCountedType >
 

Public Member Functions

 SharedPtr (std::nullptr_t) noexcept
 
 SharedPtr (const ThisType &rhs) noexcept=default
 
 SharedPtr (ThisType &&rhs) noexcept=default
 
 SharedPtr (InterfaceType *ptr, RefCounted *refCounted) noexcept
 Construct with explicit reference counter.
 
template<class U1 , class U2 >
 SharedPtr (const SharedPtr< U1, U2 > &rhs) noexcept
 Construct from another shared pointer.
 
template<class U >
 SharedPtr (U *ptr) noexcept
 Construct from a raw pointer.
 
ThisTypeoperator= (const ThisType &rhs) noexcept
 Assign from another shared pointer.
 
template<class U1 , class U2 >
ThisTypeoperator= (const SharedPtr< U1, U2 > &rhs) noexcept
 Assign from another shared pointer.
 
ThisTypeoperator= (ThisType &&rhs) noexcept
 Move-assign from another shared pointer.
 
template<class U1 , class U2 >
ThisTypeoperator= (SharedPtr< U1, U2 > &&rhs) noexcept
 Move-assign from another shared pointer.
 
template<class U >
ThisTypeoperator= (U *ptr) noexcept
 Assign from a raw pointer.
 
InterfaceType * operator-> () const noexcept
 Point to the object.
 
InterfaceType & operator* () const noexcept
 Dereference the object.
 
template<class U1 , class U2 >
bool operator< (const SharedPtr< U1, U2 > &rhs) const noexcept
 Test for less than with another shared pointer.
 
template<class U1 , class U2 >
bool operator== (const SharedPtr< U1, U2 > &rhs) const noexcept
 Test for equality with another shared pointer.
 
template<class U1 , class U2 >
bool operator!= (const SharedPtr< U1, U2 > &rhs) const noexcept
 Test for inequality with another shared pointer.
 
 operator InterfaceType * () const noexcept
 Convert to a raw pointer.
 
void Reset () noexcept
 
template<class U >
void Reset (U *ptr) noexcept
 Reset with another pointer.
 
void Reset (InterfaceType *ptr, RefCounted *refCounted) noexcept
 Reset with another pointers.
 
InterfaceType * Detach () noexcept
 Detach without destroying the object even if the refcount goes zero. To be used for scripting language interoperation.
 
template<class U1 , class U2 >
void StaticCast (const SharedPtr< U1, U2 > &rhs) noexcept
 Perform a static cast from a shared pointer of another type.
 
template<class U1 , class U2 >
void DynamicCast (const SharedPtr< U1, U2 > &rhs) noexcept
 Perform a dynamic cast from a shared pointer of another type.
 
InterfaceType * Get () const noexcept
 Return the raw pointer.
 
int Refs () const noexcept
 Return the object's reference count, or 0 if the pointer is null.
 
int WeakRefs () const noexcept
 Return the object's weak reference count, or 0 if the pointer is null.
 
RefCountRefCountPtr () const noexcept
 Return pointer to the RefCount structure.
 
size_t ToHash () const noexcept
 Return hash value for HashSet & HashMap. Use the same hash function as for raw pointers!
 

Detailed Description

template<class InterfaceType, class RefCountedType = InterfaceType>
class Urho3D::SharedPtr< InterfaceType, RefCountedType >

Shared pointer template class with intrusive reference counting.


The documentation for this class was generated from the following file: