本文整理汇总了C++中sp_counted_base类的典型用法代码示例。如果您正苦于以下问题:C++ sp_counted_base类的具体用法?C++ sp_counted_base怎么用?C++ sp_counted_base使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sp_counted_base类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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;
}
示例2: defined
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();
}
示例3: shared_count
inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ): pi_( r.pi_ )
{
if( pi_ != 0 && !pi_->add_ref_lock() )
{
pi_ = 0;
}
}
示例4: defined
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();
}
示例5: defined
~shared_count() // nothrow
{
if(pi_ != 0) pi_->release();
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
id_ = 0;
#endif
}
示例6: shared_count
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() );
}
}
示例7: shared_count
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());
}
}
示例8:
void *get_untyped_deleter() const {
return pi_ ? pi_->get_untyped_deleter() : 0;
}
示例9: use_count
long use_count() const // nothrow
{
return pi_ != 0? pi_->use_count(): 0;
}
示例10:
void * get_deleter( sp_typeinfo const & ti ) const
{
return pi_? pi_->get_deleter( ti ): 0;
}
示例11:
~shared_count() // nothrow
{
if( pi_ != 0 ) pi_->release();
}
示例12: shared_count
inline shared_count::shared_count(const weak_count &r): pi_(r.pi_) {
if (pi_ != 0 && !pi_->add_ref_lock()) {
pi_ = 0;
}
}