TrinityCore
Trinity::unique_weak_ptr< T > Class Template Reference

Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr. More...

#include <UniqueTrackablePtr.h>

Public Types

using element_type = T
 
using pointer = T *
 

Public Member Functions

 unique_weak_ptr ()=default
 
 unique_weak_ptr (unique_trackable_ptr< T > const &trackable)
 
 unique_weak_ptr (unique_weak_ptr const &other)=default
 
template<typename T2 , std::enable_if_t< std::is_convertible_v< T2 *, T * >, int > = 0>
 unique_weak_ptr (unique_weak_ptr< T2 > const &other) noexcept
 
 unique_weak_ptr (unique_weak_ptr &&other) noexcept=default
 
template<typename T2 , std::enable_if_t< std::is_convertible_v< T2 *, T * >, int > = 0>
 unique_weak_ptr (unique_weak_ptr< T2 > &&other) noexcept
 
unique_weak_ptroperator= (unique_trackable_ptr< T > const &trackable)
 
unique_weak_ptroperator= (unique_weak_ptr const &other)=default
 
template<typename T2 , std::enable_if_t< std::is_convertible_v< T2 *, T * >, int > = 0>
unique_weak_ptroperator= (unique_weak_ptr< T2 > &&other)
 
unique_weak_ptroperator= (unique_weak_ptr &&other) noexcept=default
 
 ~unique_weak_ptr ()=default
 
void swap (unique_weak_ptr &other) noexcept
 
bool expired () const
 
unique_strong_ref_ptr< element_typelock () const
 

Private Attributes

std::weak_ptr< element_type_ptr
 

Friends

template<typename T0 >
class unique_weak_ptr
 
template<typename T0 >
class unique_strong_ref_ptr
 
template<class To , class From >
unique_weak_ptr< To > static_pointer_cast (unique_weak_ptr< From > const &other)
 
template<class To , class From >
unique_weak_ptr< To > const_pointer_cast (unique_weak_ptr< From > const &other)
 
template<class To , class From >
unique_weak_ptr< To > reinterpret_pointer_cast (unique_weak_ptr< From > const &other)
 
template<class To , class From >
unique_weak_ptr< To > dynamic_pointer_cast (unique_weak_ptr< From > const &other)
 

Detailed Description

template<typename T>
class Trinity::unique_weak_ptr< T >

Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.

Template Parameters
TType of held object

Definition at line 159 of file UniqueTrackablePtr.h.

Member Typedef Documentation

◆ element_type

template<typename T >
using Trinity::unique_weak_ptr< T >::element_type = T

Definition at line 162 of file UniqueTrackablePtr.h.

◆ pointer

template<typename T >
using Trinity::unique_weak_ptr< T >::pointer = T*

Definition at line 163 of file UniqueTrackablePtr.h.

Constructor & Destructor Documentation

◆ unique_weak_ptr() [1/6]

template<typename T >
Trinity::unique_weak_ptr< T >::unique_weak_ptr ( )
default

◆ unique_weak_ptr() [2/6]

template<typename T >
Trinity::unique_weak_ptr< T >::unique_weak_ptr ( unique_trackable_ptr< T > const &  trackable)
inline

Definition at line 167 of file UniqueTrackablePtr.h.

◆ unique_weak_ptr() [3/6]

template<typename T >
Trinity::unique_weak_ptr< T >::unique_weak_ptr ( unique_weak_ptr< T > const &  other)
default

◆ unique_weak_ptr() [4/6]

template<typename T >
template<typename T2 , std::enable_if_t< std::is_convertible_v< T2 *, T * >, int > = 0>
Trinity::unique_weak_ptr< T >::unique_weak_ptr ( unique_weak_ptr< T2 > const &  other)
inlinenoexcept

Definition at line 173 of file UniqueTrackablePtr.h.

◆ unique_weak_ptr() [5/6]

template<typename T >
Trinity::unique_weak_ptr< T >::unique_weak_ptr ( unique_weak_ptr< T > &&  other)
defaultnoexcept

◆ unique_weak_ptr() [6/6]

template<typename T >
template<typename T2 , std::enable_if_t< std::is_convertible_v< T2 *, T * >, int > = 0>
Trinity::unique_weak_ptr< T >::unique_weak_ptr ( unique_weak_ptr< T2 > &&  other)
inlinenoexcept

Definition at line 179 of file UniqueTrackablePtr.h.

◆ ~unique_weak_ptr()

template<typename T >
Trinity::unique_weak_ptr< T >::~unique_weak_ptr ( )
default

Member Function Documentation

◆ expired()

template<typename T >
bool Trinity::unique_weak_ptr< T >::expired ( ) const
inline

Definition at line 207 of file UniqueTrackablePtr.h.

◆ lock()

template<typename T >
unique_strong_ref_ptr< element_type > Trinity::unique_weak_ptr< T >::lock ( ) const
inline

Definition at line 212 of file UniqueTrackablePtr.h.

◆ operator=() [1/4]

template<typename T >
unique_weak_ptr & Trinity::unique_weak_ptr< T >::operator= ( unique_trackable_ptr< T > const &  trackable)
inline

Definition at line 182 of file UniqueTrackablePtr.h.

◆ operator=() [2/4]

template<typename T >
unique_weak_ptr & Trinity::unique_weak_ptr< T >::operator= ( unique_weak_ptr< T > &&  other)
defaultnoexcept

◆ operator=() [3/4]

template<typename T >
unique_weak_ptr & Trinity::unique_weak_ptr< T >::operator= ( unique_weak_ptr< T > const &  other)
default

◆ operator=() [4/4]

template<typename T >
template<typename T2 , std::enable_if_t< std::is_convertible_v< T2 *, T * >, int > = 0>
unique_weak_ptr & Trinity::unique_weak_ptr< T >::operator= ( unique_weak_ptr< T2 > &&  other)
inline

Definition at line 191 of file UniqueTrackablePtr.h.

◆ swap()

template<typename T >
void Trinity::unique_weak_ptr< T >::swap ( unique_weak_ptr< T > &  other)
inlinenoexcept

Definition at line 201 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ const_pointer_cast

template<typename T >
template<class To , class From >
unique_weak_ptr< To > const_pointer_cast ( unique_weak_ptr< From > const &  other)
friend

Definition at line 396 of file UniqueTrackablePtr.h.

◆ dynamic_pointer_cast

template<typename T >
template<class To , class From >
unique_weak_ptr< To > dynamic_pointer_cast ( unique_weak_ptr< From > const &  other)
friend

Definition at line 412 of file UniqueTrackablePtr.h.

◆ reinterpret_pointer_cast

template<typename T >
template<class To , class From >
unique_weak_ptr< To > reinterpret_pointer_cast ( unique_weak_ptr< From > const &  other)
friend

Definition at line 404 of file UniqueTrackablePtr.h.

◆ static_pointer_cast

template<typename T >
template<class To , class From >
unique_weak_ptr< To > static_pointer_cast ( unique_weak_ptr< From > const &  other)
friend

Definition at line 388 of file UniqueTrackablePtr.h.

◆ unique_strong_ref_ptr

template<typename T >
template<typename T0 >
friend class unique_strong_ref_ptr
friend

Definition at line 222 of file UniqueTrackablePtr.h.

◆ unique_weak_ptr

template<typename T >
template<typename T0 >
friend class unique_weak_ptr
friend

Definition at line 219 of file UniqueTrackablePtr.h.

Member Data Documentation

◆ _ptr

template<typename T >
std::weak_ptr<element_type> Trinity::unique_weak_ptr< T >::_ptr
private

Definition at line 236 of file UniqueTrackablePtr.h.


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