This is Unofficial EPICS BASE Doxygen Site
epics::debug::shared_ptr< T > Class Template Reference

#include "debugPtr.h"

+ Inheritance diagram for epics::debug::shared_ptr< T >:
+ Collaboration diagram for epics::debug::shared_ptr< T >:

Public Types

typedef real_type::element_type element_type
 
typedef weak_ptr< T > weak_type
 
- Public Types inherited from epics::debug::ptr_base
typedef std::set< const shared_ptr_base * > ref_set_t
 

Public Member Functions

 shared_ptr () noexcept
 
 shared_ptr (const shared_ptr &o)
 
template<typename A >
 shared_ptr (const shared_ptr< A > &o)
 
template<typename A , class... Args>
 shared_ptr (A *a, Args...args)
 
template<typename A >
 shared_ptr (const weak_ptr< A > &o)
 
template<typename A >
 shared_ptr (std::unique_ptr< A > &&a)
 
 ~shared_ptr ()
 
shared_ptroperator= (const shared_ptr &o)
 
template<typename A >
shared_ptroperator= (const shared_ptr< A > &o)
 
void reset () noexcept
 
template<typename A , class... Args>
void reset (A *a, Args...args)
 
void swap (shared_ptr &o) noexcept
 
T * get () const noexcept
 
std::add_lvalue_reference< T >::type operator* () const noexcept
 
T * operator-> () const noexcept
 
long use_count () const noexcept
 
bool unique () const noexcept
 
 operator bool () const noexcept
 
bool operator== (const shared_ptr< T > &o) const
 
bool operator!= (const shared_ptr< T > &o) const
 
bool operator< (const shared_ptr< T > &o) const
 
template<typename A >
bool owner_before (const shared_ptr< A > &o)
 
template<typename A >
bool owner_before (const weak_ptr< A > &o)
 
- Public Member Functions inherited from epics::debug::shared_ptr_base
void show_stack (std::ostream &) const
 
- Public Member Functions inherited from epics::debug::ptr_base
void show_refs (std::ostream &, bool self=true, bool weak=false) const
 
void spy_refs (ref_set_t &) const
 

Friends

template<typename A >
class shared_ptr
 
template<typename A >
class weak_ptr
 
template<typename TO , typename FROM >
shared_ptr< TO > static_pointer_cast (const shared_ptr< FROM > &src)
 
template<typename TO , typename FROM >
shared_ptr< TO > const_pointer_cast (const shared_ptr< FROM > &src)
 
template<typename TO , typename FROM >
shared_ptr< TO > dynamic_pointer_cast (const shared_ptr< FROM > &src)
 
template<typename Store , typename Actual >
void do_enable_shared_from_this (const shared_ptr< Store > &dest, enable_shared_from_this< Actual > *self)
 

Additional Inherited Members

- Protected Types inherited from epics::debug::ptr_base
typedef std::shared_ptr< tracker > track_t
 
- Protected Member Functions inherited from epics::debug::shared_ptr_base
 shared_ptr_base () noexcept
 
 shared_ptr_base (const track_t &track)
 
 ~shared_ptr_base ()
 
void track_new ()
 
void track_new (void *ptr)
 
void track_assign (const shared_ptr_base &o)
 
void track_clear ()
 
void swap (shared_ptr_base &o)
 
void snap_stack ()
 
- Protected Member Functions inherited from epics::debug::ptr_base
 ptr_base () noexcept
 
 ptr_base (const track_t &track)
 
 ptr_base (const ptr_base &)=delete
 
 ptr_base (ptr_base &&)=delete
 
ptr_baseoperator= (const ptr_base &)=delete
 
- Protected Attributes inherited from epics::debug::shared_ptr_base
void * m_stack [EXCEPT_DEPTH]
 
int m_depth
 
- Protected Attributes inherited from epics::debug::ptr_base
track_t track
 

Detailed Description

template<typename T>
class epics::debug::shared_ptr< T >

Definition at line 100 of file debugPtr.h.

Member Typedef Documentation

template<typename T>
typedef real_type::element_type epics::debug::shared_ptr< T >::element_type

Definition at line 132 of file debugPtr.h.

template<typename T>
typedef weak_ptr<T> epics::debug::shared_ptr< T >::weak_type

Definition at line 133 of file debugPtr.h.

Constructor & Destructor Documentation

template<typename T>
epics::debug::shared_ptr< T >::shared_ptr ( )
inlinenoexcept

Definition at line 136 of file debugPtr.h.

136 {}
template<typename T>
epics::debug::shared_ptr< T >::shared_ptr ( const shared_ptr< T > &  o)
inline

Definition at line 138 of file debugPtr.h.

138 :shared_ptr_base(o.track), real(o.real) {track_new();}
template<typename T>
template<typename A >
epics::debug::shared_ptr< T >::shared_ptr ( const shared_ptr< A > &  o)
inline

Definition at line 141 of file debugPtr.h.

141 :shared_ptr_base(o.track), real(o.real) {track_new();}
template<typename T>
template<typename A , class... Args>
epics::debug::shared_ptr< T >::shared_ptr ( A *  a,
Args...  args 
)
inlineexplicit

Definition at line 145 of file debugPtr.h.

145  : shared_ptr_base(), real(a, args...) {
146  track_new(a);
147  do_enable_shared_from_this(*this, a);
148  }
friend void do_enable_shared_from_this(const shared_ptr< Store > &dest, enable_shared_from_this< Actual > *self)
Definition: debugPtr.h:309
template<typename T>
template<typename A >
epics::debug::shared_ptr< T >::shared_ptr ( const weak_ptr< A > &  o)
inline

Definition at line 152 of file debugPtr.h.

152 :shared_ptr_base(o.track), real(o.real) {track_new();}
template<typename T>
template<typename A >
epics::debug::shared_ptr< T >::shared_ptr ( std::unique_ptr< A > &&  a)
inline

Definition at line 156 of file debugPtr.h.

156 : shared_ptr_base(), real(a.release()) {track_new();}
template<typename T>
epics::debug::shared_ptr< T >::~shared_ptr ( )
inline

Definition at line 158 of file debugPtr.h.

158 {}

Member Function Documentation

template<typename T>
T* epics::debug::shared_ptr< T >::get ( ) const
inlinenoexcept

Definition at line 194 of file debugPtr.h.

194 { return real.get(); }
template<typename T>
epics::debug::shared_ptr< T >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 199 of file debugPtr.h.

199 { return bool(real); }
template<typename T>
bool epics::debug::shared_ptr< T >::operator!= ( const shared_ptr< T > &  o) const
inline

Definition at line 202 of file debugPtr.h.

202 { return real!=o.real; }
template<typename T>
std::add_lvalue_reference<T>::type epics::debug::shared_ptr< T >::operator* ( ) const
inlinenoexcept

Definition at line 195 of file debugPtr.h.

195 { return *real; }
template<typename T>
T* epics::debug::shared_ptr< T >::operator-> ( ) const
inlinenoexcept

Definition at line 196 of file debugPtr.h.

196 { return real.get(); }
template<typename T>
bool epics::debug::shared_ptr< T >::operator< ( const shared_ptr< T > &  o) const
inline

Definition at line 203 of file debugPtr.h.

203 { return real<o.real; }
template<typename T>
shared_ptr& epics::debug::shared_ptr< T >::operator= ( const shared_ptr< T > &  o)
inline

Definition at line 160 of file debugPtr.h.

160  {
161  if(this!=&o) {
162  real = o.real;
163  track_assign(o);
164  }
165  return *this;
166  }
void track_assign(const shared_ptr_base &o)
template<typename T>
template<typename A >
shared_ptr& epics::debug::shared_ptr< T >::operator= ( const shared_ptr< A > &  o)
inline

Definition at line 168 of file debugPtr.h.

168  {
169  if(get()!=o.get()) {
170  real = o.real;
171  track_assign(o);
172  }
173  return *this;
174  }
void track_assign(const shared_ptr_base &o)
template<typename T>
bool epics::debug::shared_ptr< T >::operator== ( const shared_ptr< T > &  o) const
inline

Definition at line 201 of file debugPtr.h.

201 { return real==o.real; }
template<typename T>
template<typename A >
bool epics::debug::shared_ptr< T >::owner_before ( const shared_ptr< A > &  o)
inline

Definition at line 206 of file debugPtr.h.

206 { return real.owner_before(o); }
template<typename T>
template<typename A >
bool epics::debug::shared_ptr< T >::owner_before ( const weak_ptr< A > &  o)
inline

Definition at line 208 of file debugPtr.h.

208 { return real.owner_before(o); }
template<typename T>
void epics::debug::shared_ptr< T >::reset ( )
inlinenoexcept

Definition at line 176 of file debugPtr.h.

176 { real.reset(); track_clear(); }
template<typename T>
template<typename A , class... Args>
void epics::debug::shared_ptr< T >::reset ( A *  a,
Args...  args 
)
inline

Definition at line 178 of file debugPtr.h.

179  {
180  real.reset(a, args...);
181  track_new(a);
182  do_enable_shared_from_this(*this, a);
183  }
friend void do_enable_shared_from_this(const shared_ptr< Store > &dest, enable_shared_from_this< Actual > *self)
Definition: debugPtr.h:309
template<typename T>
void epics::debug::shared_ptr< T >::swap ( shared_ptr< T > &  o)
inlinenoexcept

Definition at line 184 of file debugPtr.h.

185  {
186  if(this!=&o) {
187  real.swap(o.real);
189  }
190  }
void swap(shared_ptr_base &o)
template<typename T>
bool epics::debug::shared_ptr< T >::unique ( ) const
inlinenoexcept

Definition at line 198 of file debugPtr.h.

198 { return real.unique(); }
template<typename T>
long epics::debug::shared_ptr< T >::use_count ( ) const
inlinenoexcept

Definition at line 197 of file debugPtr.h.

197 { return real.use_count(); }

Friends And Related Function Documentation

template<typename T>
template<typename TO , typename FROM >
shared_ptr<TO> const_pointer_cast ( const shared_ptr< FROM > &  src)
friend

Definition at line 232 of file debugPtr.h.

232  {
233  return shared_ptr<TO>(std::const_pointer_cast<TO>(src.real), src.track);
234 }
shared_ptr< TO > const_pointer_cast(const shared_ptr< FROM > &src)
Definition: debugPtr.h:232
template<typename T>
template<typename Store , typename Actual >
void do_enable_shared_from_this ( const shared_ptr< Store > &  dest,
enable_shared_from_this< Actual > *  self 
)
friend

Definition at line 309 of file debugPtr.h.

312 {
313  shared_ptr<Actual> actual(dynamic_pointer_cast<Actual>(dest));
314  if(!actual)
315  throw std::logic_error("epics::debug::enabled_shared_from_this fails");
316  self->xxInternalSelf = actual;
317 }
template<typename T>
template<typename TO , typename FROM >
shared_ptr<TO> dynamic_pointer_cast ( const shared_ptr< FROM > &  src)
friend

Definition at line 237 of file debugPtr.h.

237  {
238  return shared_ptr<TO>(std::dynamic_pointer_cast<TO>(src.real), src.track);
239 }
shared_ptr< TO > dynamic_pointer_cast(const shared_ptr< FROM > &src)
Definition: debugPtr.h:237
template<typename T>
template<typename A >
friend class shared_ptr
friend

Definition at line 123 of file debugPtr.h.

template<typename T>
template<typename TO , typename FROM >
shared_ptr<TO> static_pointer_cast ( const shared_ptr< FROM > &  src)
friend

Definition at line 227 of file debugPtr.h.

227  {
228  return shared_ptr<TO>(std::static_pointer_cast<TO>(src.real), src.track);
229 }
shared_ptr< TO > static_pointer_cast(const shared_ptr< FROM > &src)
Definition: debugPtr.h:227
template<typename T>
template<typename A >
friend class weak_ptr
friend

Definition at line 125 of file debugPtr.h.


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