#include <shared_ptr.h>
Public Types | |
typedef weak_ptr< T > | this_type |
typedef T | element_type |
Public Member Functions | |
weak_ptr () EA_NOEXCEPT | |
weak_ptr | |
weak_ptr (const this_type &weakPtr) EA_NOEXCEPT | |
weak_ptr (this_type &&weakPtr) EA_NOEXCEPT | |
template<typename U > | |
weak_ptr (const weak_ptr< U > &weakPtr, typename eastl::enable_if< eastl::is_convertible< U *, element_type * >::value >::type *=0) EA_NOEXCEPT | |
template<typename U > | |
weak_ptr (weak_ptr< U > &&weakPtr, typename eastl::enable_if< eastl::is_convertible< U *, element_type * >::value >::type *=0) EA_NOEXCEPT | |
template<typename U > | |
weak_ptr (const shared_ptr< U > &sharedPtr, typename eastl::enable_if< eastl::is_convertible< U *, element_type * >::value >::type *=0) EA_NOEXCEPT | |
~weak_ptr () | |
~weak_ptr | |
this_type & | operator= (const this_type &weakPtr) EA_NOEXCEPT |
this_type & | operator= (this_type &&weakPtr) EA_NOEXCEPT |
template<typename U > | |
eastl::enable_if< eastl::is_convertible< U *, element_type * >::value, this_type & >::type | operator= (const weak_ptr< U > &weakPtr) EA_NOEXCEPT |
operator=(weak_ptr) | |
template<typename U > | |
eastl::enable_if< eastl::is_convertible< U *, element_type * >::value, this_type & >::type | operator= (weak_ptr< U > &&weakPtr) EA_NOEXCEPT |
template<typename U > | |
eastl::enable_if< eastl::is_convertible< U *, element_type * >::value, this_type & >::type | operator= (const shared_ptr< U > &sharedPtr) EA_NOEXCEPT |
shared_ptr< T > | lock () const EA_NOEXCEPT |
int | use_count () const EA_NOEXCEPT |
bool | expired () const EA_NOEXCEPT |
void | reset () |
void | swap (this_type &weakPtr) |
template<typename U > | |
void | assign (const weak_ptr< U > &weakPtr, typename eastl::enable_if< eastl::is_convertible< U *, element_type * >::value >::type *=0) EA_NOEXCEPT |
template<typename U > | |
bool | owner_before (const weak_ptr< U > &weakPtr) const EA_NOEXCEPT |
template<typename U > | |
bool | owner_before (const shared_ptr< U > &sharedPtr) const EA_NOEXCEPT |
owner_before | |
template<typename U > | |
bool | less_than (const weak_ptr< U > &weakPtr) const EA_NOEXCEPT |
void | assign (element_type *pValue, ref_count_sp *pRefCount) |
Protected Attributes | |
element_type * | mpValue |
ref_count_sp * | mpRefCount |
The (weakly) owned pointer. | |
Friends | |
template<typename U > | |
class | shared_ptr |
Reference count for owned pointer. | |
The weak_ptr class template stores a "weak reference" to an object that's already managed by a shared_ptr. To access the object, a weak_ptr can be converted to a shared_ptr using the shared_ptr constructor or the lock() member function. When the last shared_ptr to the object goes away and the object is deleted, the attempt to obtain a shared_ptr from the weak_ptr instances that refer to the deleted object will fail via lock() returning an empty shared_ptr.
The Allocator template argument manages the memory of the shared reference count and not the stored object. weak_ptr will not delete the stored object but instead can only delete the reference count on that object.
|
inline |
weak_ptr Construction with self type.
|
inline |
weak_ptr Move construction with self type.
|
inline |
|
inline |
|
inline |
weak_ptr Constructs a weak_ptr from a shared_ptr.
|
inline |
assign
Assignment via another weak_ptr.
|
inline |
assign
Assignment through a T/ref_count_sp pair. This is used by external utility functions.
|
inline |
less_than For compatibility with pre-C++11 weak_ptr. Use owner_before instead.
|
inline |
operator=(shared_ptr) Assigns to a weak_ptr from a shared_ptr.
|
inline |
operator=(weak_ptr) assignment to self type.
|
inline |
owner_before C++11 function for ordering.