This is Unofficial EPICS BASE Doxygen Site
boost::weak_ptr< T > Class Template Reference

#include "shared_ptr.hpp"

Public Types

typedef boost::detail::sp_element< T >::type element_type
 

Public Member Functions

 weak_ptr () BOOST_NOEXCEPT
 
 weak_ptr (weak_ptr const &r) BOOST_NOEXCEPT
 
weak_ptroperator= (weak_ptr const &r) BOOST_NOEXCEPT
 
template<class Y >
 weak_ptr (weak_ptr< Y > const &r, typename boost::detail::sp_enable_if_convertible< Y, T >::type=boost::detail::sp_empty()) BOOST_NOEXCEPT
 
template<class Y >
 weak_ptr (weak_ptr< Y > &&r, typename boost::detail::sp_enable_if_convertible< Y, T >::type=boost::detail::sp_empty()) BOOST_NOEXCEPT
 
 weak_ptr (weak_ptr &&r) BOOST_NOEXCEPT
 
weak_ptroperator= (weak_ptr &&r) BOOST_NOEXCEPT
 
template<class Y >
 weak_ptr (shared_ptr< Y > const &r, typename boost::detail::sp_enable_if_convertible< Y, T >::type=boost::detail::sp_empty()) BOOST_NOEXCEPT
 
template<class Y >
weak_ptroperator= (weak_ptr< Y > const &r) BOOST_NOEXCEPT
 
template<class Y >
weak_ptroperator= (weak_ptr< Y > &&r) BOOST_NOEXCEPT
 
template<class Y >
weak_ptroperator= (shared_ptr< Y > const &r) BOOST_NOEXCEPT
 
shared_ptr< T > lock () const BOOST_NOEXCEPT
 
long use_count () const BOOST_NOEXCEPT
 
bool expired () const BOOST_NOEXCEPT
 
bool _empty () const
 
void reset () BOOST_NOEXCEPT
 
void swap (this_type &other) BOOST_NOEXCEPT
 
template<typename Y >
void _internal_aliasing_assign (weak_ptr< Y > const &r, element_type *px2)
 
template<class Y >
bool owner_before (weak_ptr< Y > const &rhs) const BOOST_NOEXCEPT
 
template<class Y >
bool owner_before (shared_ptr< Y > const &rhs) const BOOST_NOEXCEPT
 

Friends

template<class Y >
class weak_ptr
 
template<class Y >
class shared_ptr
 

Detailed Description

template<class T>
class boost::weak_ptr< T >

Definition at line 59 of file shared_ptr.hpp.

Member Typedef Documentation

template<class T>
typedef boost::detail::sp_element< T >::type boost::weak_ptr< T >::element_type

Definition at line 32 of file weak_ptr.hpp.

Constructor & Destructor Documentation

template<class T>
boost::weak_ptr< T >::weak_ptr ( )
inline

Definition at line 34 of file weak_ptr.hpp.

34  : px(0), pn() // never throws in 1.30+
35  {
36  }
template<class T>
boost::weak_ptr< T >::weak_ptr ( weak_ptr< T > const &  r)
inline

Definition at line 44 of file weak_ptr.hpp.

44  : px( r.px ), pn( r.pn )
45  {
46  }
template<class T>
template<class Y >
boost::weak_ptr< T >::weak_ptr ( weak_ptr< Y > const &  r,
typename boost::detail::sp_enable_if_convertible< Y, T >::type  = boost::detail::sp_empty() 
)
inline

Definition at line 77 of file weak_ptr.hpp.

84  : px(r.lock().get()), pn(r.pn)
85  {
86  boost::detail::sp_assert_convertible< Y, T >();
87  }
template<class T>
template<class Y >
boost::weak_ptr< T >::weak_ptr ( weak_ptr< Y > &&  r,
typename boost::detail::sp_enable_if_convertible< Y, T >::type  = boost::detail::sp_empty() 
)
inline

Definition at line 94 of file weak_ptr.hpp.

101  : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) )
102  {
103  boost::detail::sp_assert_convertible< Y, T >();
104  r.px = 0;
105  }
template<class T>
boost::weak_ptr< T >::weak_ptr ( weak_ptr< T > &&  r)
inline

Definition at line 108 of file weak_ptr.hpp.

109  : px( r.px ), pn( static_cast< boost::detail::weak_count && >( r.pn ) )
110  {
111  r.px = 0;
112  }
template<class T>
template<class Y >
boost::weak_ptr< T >::weak_ptr ( shared_ptr< Y > const &  r,
typename boost::detail::sp_enable_if_convertible< Y, T >::type  = boost::detail::sp_empty() 
)
inline

Definition at line 127 of file weak_ptr.hpp.

134  : px( r.px ), pn( r.pn )
135  {
136  boost::detail::sp_assert_convertible< Y, T >();
137  }

Member Function Documentation

template<class T>
bool boost::weak_ptr< T >::_empty ( ) const
inline

Definition at line 191 of file weak_ptr.hpp.

192  {
193  return pn.empty();
194  }
template<class T>
template<typename Y >
void boost::weak_ptr< T >::_internal_aliasing_assign ( weak_ptr< Y > const &  r,
element_type px2 
)
inline

Definition at line 208 of file weak_ptr.hpp.

209  {
210  px = px2;
211  pn = r.pn;
212  }
template<class T>
bool boost::weak_ptr< T >::expired ( ) const
inline

Definition at line 186 of file weak_ptr.hpp.

187  {
188  return pn.use_count() == 0;
189  }
template<class T>
shared_ptr<T> boost::weak_ptr< T >::lock ( ) const
inline

Definition at line 176 of file weak_ptr.hpp.

177  {
178  return shared_ptr<T>( *this, boost::detail::sp_nothrow_tag() );
179  }
template<class T>
weak_ptr& boost::weak_ptr< T >::operator= ( weak_ptr< T > const &  r)
inline

Definition at line 48 of file weak_ptr.hpp.

49  {
50  px = r.px;
51  pn = r.pn;
52  return *this;
53  }
template<class T>
weak_ptr& boost::weak_ptr< T >::operator= ( weak_ptr< T > &&  r)
inline

Definition at line 115 of file weak_ptr.hpp.

116  {
117  this_type( static_cast< weak_ptr && >( r ) ).swap( *this );
118  return *this;
119  }
template<class T>
template<class Y >
weak_ptr& boost::weak_ptr< T >::operator= ( weak_ptr< Y > const &  r)
inline

Definition at line 142 of file weak_ptr.hpp.

143  {
144  boost::detail::sp_assert_convertible< Y, T >();
145 
146  px = r.lock().get();
147  pn = r.pn;
148 
149  return *this;
150  }
template<class T>
template<class Y >
weak_ptr& boost::weak_ptr< T >::operator= ( weak_ptr< Y > &&  r)
inline

Definition at line 155 of file weak_ptr.hpp.

156  {
157  this_type( static_cast< weak_ptr<Y> && >( r ) ).swap( *this );
158  return *this;
159  }
template<class T>
template<class Y >
weak_ptr& boost::weak_ptr< T >::operator= ( shared_ptr< Y > const &  r)
inline

Definition at line 164 of file weak_ptr.hpp.

165  {
166  boost::detail::sp_assert_convertible< Y, T >();
167 
168  px = r.px;
169  pn = r.pn;
170 
171  return *this;
172  }
template<class T>
template<class Y >
bool boost::weak_ptr< T >::owner_before ( weak_ptr< Y > const &  rhs) const
inline

Definition at line 214 of file weak_ptr.hpp.

215  {
216  return pn < rhs.pn;
217  }
template<class T>
template<class Y >
bool boost::weak_ptr< T >::owner_before ( shared_ptr< Y > const &  rhs) const
inline

Definition at line 219 of file weak_ptr.hpp.

220  {
221  return pn < rhs.pn;
222  }
template<class T>
void boost::weak_ptr< T >::reset ( )
inline

Definition at line 196 of file weak_ptr.hpp.

197  {
198  this_type().swap(*this);
199  }
template<class T>
void boost::weak_ptr< T >::swap ( this_type other)
inline

Definition at line 201 of file weak_ptr.hpp.

202  {
203  std::swap(px, other.px);
204  pn.swap(other.pn);
205  }
void swap(weak_ptr< T > &a, weak_ptr< T > &b) BOOST_NOEXCEPT
Definition: weak_ptr.hpp:246
void swap(weak_count &r)
template<class T>
long boost::weak_ptr< T >::use_count ( ) const
inline

Definition at line 181 of file weak_ptr.hpp.

182  {
183  return pn.use_count();
184  }

Friends And Related Function Documentation

template<class T>
template<class Y >
friend class shared_ptr
friend

Definition at line 232 of file weak_ptr.hpp.

template<class T>
template<class Y >
friend class weak_ptr
friend

Definition at line 231 of file weak_ptr.hpp.


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