26 #ifndef G4SHARED_PTR_HH_
27 #define G4SHARED_PTR_HH_
29 #if __cplusplus >= 201103L
32 #define G4shared_ptr std::shared_ptr
33 #define G4weak_ptr std::weak_ptr
34 #define G4static_pointer_cast std::static_pointer_cast
35 #define G4const_pointer_cast std::const_pointer_cast
36 #define G4dynamic_pointer_cast std::dynamic_pointer_cast
37 #define G4enable_shared_from_this std::enable_shared_from_this
38 #define G4enable_shared_from_this2 std::enable_shared_from_this
41 #include "CLHEP/Utility/memory.h"
43 #define G4shared_ptr G4::shared_ptr
44 #define G4weak_ptr G4::weak_ptr
45 #define G4static_pointer_cast G4::static_pointer_cast
46 #define G4const_pointer_cast G4::const_pointer_cast
47 #define G4dynamic_pointer_cast G4::dynamic_pointer_cast
48 #define G4enable_shared_from_this G4::enable_shared_from_this
49 #define G4enable_shared_from_this2 G4::enable_shared_from_this2
53 using CLHEP::shared_ptr;
54 using CLHEP::weak_ptr;
55 using CLHEP::static_pointer_cast;
56 using CLHEP::const_pointer_cast;
57 using CLHEP::dynamic_pointer_cast;
63 template<
typename T >
102 template<
typename X,
typename Y >
128 template<
typename T >
135 template<
typename T >
139 assert( deleter_.use_count() <= 1 );
146 template<
typename T >
190 if( weak_this_._empty() )
192 shared_this_.reset( static_cast< T* >( 0 )
202 template<
typename X,
typename Y >
208 if( weak_this_.use_count() == 0 )
209 weak_this_ = shared_ptr<T>( *ppx, py );
210 else if( shared_this_.use_count() != 0 )
212 assert( ppx->unique() );
216 get_deleter<detail::esft2_deleter_wrapper>(
shared_this_ );
219 pd->set_deleter( *ppx );
221 ppx->reset( shared_this_, ppx->get() );
222 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_