Example #1
0
    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();
    }
Example #2
0
inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ): pi_( r.pi_ )
{
    if( pi_ != 0 && !pi_->add_ref_lock() )
    {
        pi_ = 0;
    }
}
Example #3
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();
    }
Example #4
0
    ~weak_count() // nothrow
    {
        if(pi_ != 0) pi_->weak_release();
#if defined(SC_BOOST_SP_ENABLE_DEBUG_HOOKS)
        id_ = 0;
#endif
    }
Example #5
0
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
    }
Example #7
0
    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;
    }
Example #8
0
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() );
    }
}
Example #9
0
    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;
 }
Example #12
0
 long use_count() const // nothrow
 {
     return pi_ != 0? pi_->use_count(): 0;
 }
Example #13
0
 void * get_deleter( sp_typeinfo const & ti ) const
 {
     return pi_? pi_->get_deleter( ti ): 0;
 }
Example #14
0
 ~shared_count() // nothrow
 {
     if( pi_ != 0 ) pi_->release();
 }
Example #15
0
 shared_count(shared_count const & r): pi_(r.pi_) // nothrow
 {
     if( pi_ != 0 ) pi_->add_ref_copy();
 }
Example #16
0
 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;
    }
}
Example #18
0
 weak_count(weak_count const & r): pi_(r.pi_) // nothrow
 {
     if(pi_ != 0) pi_->weak_add_ref();
 }
Example #19
0
 ~weak_count() // nothrow
 {
     if(pi_ != 0) pi_->weak_release();
 }