Пример #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();
    }
Пример #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;
    }
}
Пример #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();
    }
Пример #4
0
    ~weak_count() // nothrow
    {
        if(pi_ != 0) pi_->weak_release();
#if defined(SC_BOOST_SP_ENABLE_DEBUG_HOOKS)
        id_ = 0;
#endif
    }
Пример #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
    }
Пример #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;
    }
Пример #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() );
    }
}
Пример #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;
 }
Пример #12
0
 long use_count() const // nothrow
 {
     return pi_ != 0? pi_->use_count(): 0;
 }
Пример #13
0
 void * get_deleter( sp_typeinfo const & ti ) const
 {
     return pi_? pi_->get_deleter( ti ): 0;
 }
Пример #14
0
 ~shared_count() // nothrow
 {
     if( pi_ != 0 ) pi_->release();
 }
Пример #15
0
 shared_count(shared_count const & r): pi_(r.pi_) // nothrow
 {
     if( pi_ != 0 ) pi_->add_ref_copy();
 }
Пример #16
0
 void * get_deleter(std::type_info const & ti) const
 {
     return pi_? pi_->get_deleter( ti ): 0;
 }
Пример #17
0
inline shared_count::shared_count(const weak_count &r): pi_(r.pi_) {
    if (pi_ != 0 && !pi_->add_ref_lock()) {
        pi_ = 0;
    }
}
Пример #18
0
 weak_count(weak_count const & r): pi_(r.pi_) // nothrow
 {
     if(pi_ != 0) pi_->weak_add_ref();
 }
Пример #19
0
 ~weak_count() // nothrow
 {
     if(pi_ != 0) pi_->weak_release();
 }