shared_count(shared_count const & r): pi_(r.pi_) // nothrow #if defined(POTHOS_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if(pi_ != 0) pi_->add_ref_copy(); }
inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ): pi_( r.pi_ ) { if( pi_ != 0 && !pi_->add_ref_lock() ) { pi_ = 0; } }
weak_count(weak_count const & r): pi_(r.pi_) // nothrow #if defined(SC_BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if(pi_ != 0) pi_->weak_add_ref(); }
~weak_count() // nothrow { if(pi_ != 0) pi_->weak_release(); #if defined(SC_BOOST_SP_ENABLE_DEBUG_HOOKS) id_ = 0; #endif }
inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ ) { if( pi_ == 0 || !pi_->add_ref_lock() ) { throw trident::bad_weak_ptr(); } }
~shared_count() // nothrow { if(pi_ != 0) pi_->release(); #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) id_ = 0; #endif }
weak_count & operator= (weak_count const & r) // nothrow { sp_counted_base * tmp = r.pi_; if(tmp != 0) tmp->weak_add_ref(); if(pi_ != 0) pi_->weak_release(); pi_ = tmp; return *this; }
inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ ) #if defined(SC_BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if( pi_ == 0 || !pi_->add_ref_lock() ) { sc_boost::throw_exception( sc_boost::bad_weak_ptr() ); } }
shared_count & operator= (shared_count const & r) // nothrow { sp_counted_base * tmp = r.pi_; if( tmp != pi_ ) { if( tmp != 0 ) tmp->add_ref_copy(); if( pi_ != 0 ) pi_->release(); pi_ = tmp; } return *this; }
inline shared_count::shared_count(weak_count const & r): pi_(r.pi_) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { if(pi_ != 0) { pi_->add_ref_lock(); } else { boost::serialization::throw_exception(bad_weak_ptr()); } }
void *get_untyped_deleter() const { return pi_ ? pi_->get_untyped_deleter() : 0; }
long use_count() const // nothrow { return pi_ != 0? pi_->use_count(): 0; }
void * get_deleter( sp_typeinfo const & ti ) const { return pi_? pi_->get_deleter( ti ): 0; }
~shared_count() // nothrow { if( pi_ != 0 ) pi_->release(); }
shared_count(shared_count const & r): pi_(r.pi_) // nothrow { if( pi_ != 0 ) pi_->add_ref_copy(); }
void * get_deleter(std::type_info const & ti) const { return pi_? pi_->get_deleter( ti ): 0; }
inline shared_count::shared_count(const weak_count &r): pi_(r.pi_) { if (pi_ != 0 && !pi_->add_ref_lock()) { pi_ = 0; } }
weak_count(weak_count const & r): pi_(r.pi_) // nothrow { if(pi_ != 0) pi_->weak_add_ref(); }
~weak_count() // nothrow { if(pi_ != 0) pi_->weak_release(); }