STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
weak_ptr< _Ty > Class Template Reference
Inheritance diagram for weak_ptr< _Ty >:
_Ptr_base< _Ty >

Public Member Functions

 weak_ptr () _NOEXCEPT
 
 weak_ptr (const weak_ptr &_Other) _NOEXCEPT
 
template<class _Ty2 , class = typename enable_if<is_convertible<_Ty2 *, _Ty *>::value, void>::type>
 weak_ptr (const shared_ptr< _Ty2 > &_Other) _NOEXCEPT
 
template<class _Ty2 , class = typename enable_if<is_convertible<_Ty2 *, _Ty *>::value, void>::type>
 weak_ptr (const weak_ptr< _Ty2 > &_Other) _NOEXCEPT
 
 ~weak_ptr () _NOEXCEPT
 
weak_ptroperator= (const weak_ptr &_Right) _NOEXCEPT
 
template<class _Ty2 >
weak_ptroperator= (const weak_ptr< _Ty2 > &_Right) _NOEXCEPT
 
template<class _Ty2 >
weak_ptroperator= (const shared_ptr< _Ty2 > &_Right) _NOEXCEPT
 
void reset () _NOEXCEPT
 
void swap (weak_ptr &_Other) _NOEXCEPT
 
bool expired () const _NOEXCEPT
 
shared_ptr< _Ty > lock () const _NOEXCEPT
 
- Public Member Functions inherited from _Ptr_base< _Ty >
 _Ptr_base ()
 
 _Ptr_base (_Myt &&_Right)
 
template<class _Ty2 >
 _Ptr_base (_Ptr_base< _Ty2 > &&_Right)
 
_Mytoperator= (_Myt &&_Right)
 
void _Assign_rv (_Myt &&_Right)
 
long use_count () const _NOEXCEPT
 
void _Swap (_Ptr_base &_Right)
 
template<class _Ty2 >
bool owner_before (const _Ptr_base< _Ty2 > &_Right) const
 
void_Get_deleter (const _XSTD2 type_info &_Typeid) const
 
_Ty * _Get () const
 
bool _Expired () const
 
void _Decref ()
 
void _Reset ()
 
template<class _Ty2 >
void _Reset (const _Ptr_base< _Ty2 > &_Other)
 
template<class _Ty2 >
void _Reset (const _Ptr_base< _Ty2 > &_Other, bool _Throw)
 
template<class _Ty2 >
void _Reset (const _Ptr_base< _Ty2 > &_Other, const _Static_tag &)
 
template<class _Ty2 >
void _Reset (const _Ptr_base< _Ty2 > &_Other, const _Const_tag &)
 
template<class _Ty2 >
void _Reset (const _Ptr_base< _Ty2 > &_Other, const _Dynamic_tag &)
 
template<class _Ty2 >
void _Reset (auto_ptr< _Ty2 > &&_Other)
 
template<class _Ty2 >
void _Reset (_Ty *_Ptr, const _Ptr_base< _Ty2 > &_Other)
 
void _Reset (_Ty *_Other_ptr, _Ref_count_base *_Other_rep)
 
void _Reset (_Ty *_Other_ptr, _Ref_count_base *_Other_rep, bool _Throw)
 
void _Reset0 (_Ty *_Other_ptr, _Ref_count_base *_Other_rep)
 
void _Decwref ()
 
void _Resetw ()
 
template<class _Ty2 >
void _Resetw (const _Ptr_base< _Ty2 > &_Other)
 
template<class _Ty2 >
void _Resetw (const _Ty2 *_Other_ptr, _Ref_count_base *_Other_rep)
 
template<class _Ty2 >
void _Resetw (_Ty2 *_Other_ptr, _Ref_count_base *_Other_rep)
 

Additional Inherited Members

- Public Types inherited from _Ptr_base< _Ty >
typedef _Ptr_base< _Ty > _Myt
 
typedef _Ty element_type
 

Constructor & Destructor Documentation

template<class _Ty>
weak_ptr< _Ty >::weak_ptr ( )
inline
1042  { // construct empty weak_ptr object
1043  }
template<class _Ty>
weak_ptr< _Ty >::weak_ptr ( const weak_ptr< _Ty > &  _Other)
inline
1046  { // construct weak_ptr object for resource pointed to by _Other
1047  this->_Resetw(_Other);
1048  }
void _Resetw()
Definition: memory:431
template<class _Ty>
template<class _Ty2 , class = typename enable_if<is_convertible<_Ty2 *, _Ty *>::value, void>::type>
weak_ptr< _Ty >::weak_ptr ( const shared_ptr< _Ty2 > &  _Other)
inline
1054  { // construct weak_ptr object for resource owned by _Other
1055  this->_Resetw(_Other);
1056  }
void _Resetw()
Definition: memory:431
template<class _Ty>
template<class _Ty2 , class = typename enable_if<is_convertible<_Ty2 *, _Ty *>::value, void>::type>
weak_ptr< _Ty >::weak_ptr ( const weak_ptr< _Ty2 > &  _Other)
inline
1062  { // construct weak_ptr object for resource pointed to by _Other
1063  this->_Resetw(_Other.lock());
1064  }
shared_ptr< _Ty > lock() const _NOEXCEPT
Definition: memory:1106
void _Resetw()
Definition: memory:431
template<class _Ty>
weak_ptr< _Ty >::~weak_ptr ( )
inline
1067  { // release resource
1068  this->_Decwref();
1069  }
void _Decwref()
Definition: memory:425

Member Function Documentation

template<class _Ty>
bool weak_ptr< _Ty >::expired ( ) const
inline
1102  { // return true if resource no longer exists
1103  return (this->_Expired());
1104  }
bool _Expired() const
Definition: memory:335
template<class _Ty>
shared_ptr<_Ty> weak_ptr< _Ty >::lock ( ) const
inline
1107  { // convert to shared_ptr
1108  return (shared_ptr<_Ty>(*this, false));
1109  }
Definition: memory:245
template<class _Ty>
weak_ptr& weak_ptr< _Ty >::operator= ( const weak_ptr< _Ty > &  _Right)
inline
1072  { // assign from _Right
1073  this->_Resetw(_Right);
1074  return (*this);
1075  }
void _Resetw()
Definition: memory:431
template<class _Ty>
template<class _Ty2 >
weak_ptr& weak_ptr< _Ty >::operator= ( const weak_ptr< _Ty2 > &  _Right)
inline
1079  { // assign from _Right
1080  this->_Resetw(_Right.lock());
1081  return (*this);
1082  }
shared_ptr< _Ty > lock() const _NOEXCEPT
Definition: memory:1106
void _Resetw()
Definition: memory:431
template<class _Ty>
template<class _Ty2 >
weak_ptr& weak_ptr< _Ty >::operator= ( const shared_ptr< _Ty2 > &  _Right)
inline
1086  { // assign from _Right
1087  this->_Resetw(_Right);
1088  return (*this);
1089  }
void _Resetw()
Definition: memory:431
template<class _Ty>
void weak_ptr< _Ty >::reset ( )
inline
1092  { // release resource, convert to null weak_ptr object
1093  this->_Resetw();
1094  }
void _Resetw()
Definition: memory:431
template<class _Ty>
void weak_ptr< _Ty >::swap ( weak_ptr< _Ty > &  _Other)
inline
1097  { // swap pointers
1098  this->_Swap(_Other);
1099  }
void _Swap(_Ptr_base &_Right)
Definition: memory:313

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