26 #ifndef G4SHARED_PTR_HH_
27 #define G4SHARED_PTR_HH_
29 #include "CLHEP/Utility/memory.h"
31 #define G4shared_ptr G4::shared_ptr
32 #define G4weak_ptr G4::weak_ptr
33 #define G4static_pointer_cast G4::static_pointer_cast
34 #define G4const_pointer_cast G4::const_pointer_cast
35 #define G4dynamic_pointer_cast G4::dynamic_pointer_cast
36 #define G4enable_shared_from_this G4::enable_shared_from_this
37 #define G4enable_shared_from_this2 G4::enable_shared_from_this2
41 using CLHEP::shared_ptr;
42 using CLHEP::weak_ptr;
43 using CLHEP::static_pointer_cast;
44 using CLHEP::const_pointer_cast;
45 using CLHEP::dynamic_pointer_cast;
51 template<
typename T >
75 assert( p.get() == this );
83 assert( p.get() == this );
90 template<
typename X,
typename Y >
116 template<
typename T >
123 template<
typename T >
127 assert( deleter_.use_count() <= 1 );
134 template<
typename T >
178 if( weak_this_._empty() )
180 shared_this_.reset( static_cast< T* >( 0 )
190 template<
typename X,
typename Y >
196 if( weak_this_.use_count() == 0 )
197 weak_this_ = shared_ptr<T>( *ppx, py );
198 else if( shared_this_.use_count() != 0 )
200 assert( ppx->unique() );
204 get_deleter<detail::esft2_deleter_wrapper>(
shared_this_ );
207 pd->set_deleter( *ppx );
209 ppx->reset( shared_this_, ppx->get() );
210 shared_this_.reset();
void set_deleter(shared_ptr< T > const &deleter)
enable_shared_from_this2 & operator=(enable_shared_from_this2 const &)
~enable_shared_from_this2()
enable_shared_from_this & operator=(enable_shared_from_this const &)
shared_ptr< T const > shared_from_this() const
enable_shared_from_this2(enable_shared_from_this2 const &)
enable_shared_from_this()
shared_ptr< T const > shared_from_this() const
shared_ptr< T > shared_from_this()
shared_ptr< T > shared_from_this()
enable_shared_from_this2()
shared_ptr< void > deleter_
enable_shared_from_this(enable_shared_from_this const &)
~enable_shared_from_this()
void _internal_accept_owner(shared_ptr< X > *ppx, Y *py) const
void init_weak_once() const
void _internal_accept_owner(shared_ptr< X > const *ppx, Y *py) const
shared_ptr< T > shared_this_