|
reSIProcate/rutil
9694
|
#include <SharedCount.hxx>


Public Member Functions | |
| sp_counted_base () | |
| virtual | ~sp_counted_base () |
| virtual void | dispose ()=0 |
| virtual void | destruct () |
| virtual void * | get_deleter (std::type_info const &ti)=0 |
| void | add_ref_copy () |
| void | add_ref_lock () |
| void | release () |
| void | weak_add_ref () |
| void | weak_release () |
| long | use_count () const |
Private Member Functions | |
| sp_counted_base (sp_counted_base const &) | |
| sp_counted_base & | operator= (sp_counted_base const &) |
Private Attributes | |
| long | use_count_ |
| long | weak_count_ |
| Mutex | mMutex |
Definition at line 75 of file SharedCount.hxx.
| resip::sp_counted_base::sp_counted_base | ( | ) | [inline] |
Definition at line 81 of file SharedCount.hxx.
: use_count_(1), weak_count_(1) { }
| virtual resip::sp_counted_base::~sp_counted_base | ( | ) | [inline, virtual] |
Definition at line 85 of file SharedCount.hxx.
{
}
| resip::sp_counted_base::sp_counted_base | ( | sp_counted_base const & | ) | [private] |
| void resip::sp_counted_base::add_ref_copy | ( | ) | [inline] |
Definition at line 101 of file SharedCount.hxx.
References mMutex, and use_count_.
Referenced by resip::shared_count::operator=(), and resip::shared_count::shared_count().
{
Lock lock(mMutex); (void)lock;
++use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::add_ref_copy: " << use_count_);
}
| void resip::sp_counted_base::add_ref_lock | ( | ) | [inline] |
Definition at line 108 of file SharedCount.hxx.
References mMutex, and use_count_.
{
Lock lock(mMutex); (void)lock;
// if(use_count_ == 0) throw(resip::bad_weak_ptr());
if (use_count_ == 0) throw resip::bad_weak_ptr();
++use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::add_ref_lock: " << use_count_);
}
| virtual void resip::sp_counted_base::destruct | ( | ) | [inline, virtual] |
| virtual void resip::sp_counted_base::dispose | ( | ) | [pure virtual] |
Implemented in resip::sp_counted_base_impl< P, D >.
Referenced by release().
| virtual void* resip::sp_counted_base::get_deleter | ( | std::type_info const & | ti | ) | [pure virtual] |
Implemented in resip::sp_counted_base_impl< P, D >.
Referenced by resip::shared_count::get_deleter().
| sp_counted_base& resip::sp_counted_base::operator= | ( | sp_counted_base const & | ) | [private] |
| void resip::sp_counted_base::release | ( | ) | [inline] |
Definition at line 117 of file SharedCount.hxx.
References dispose(), mMutex, use_count_, and weak_release().
Referenced by resip::shared_count::operator=(), resip::shared_count::shared_count(), and resip::shared_count::~shared_count().
{
{
Lock lock(mMutex); (void)lock;
long new_use_count = --use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::release: " << use_count_);
if(new_use_count != 0) return;
}
dispose();
weak_release();
}

| long resip::sp_counted_base::use_count | ( | ) | const [inline] |
Definition at line 152 of file SharedCount.hxx.
References mMutex, and use_count_.
Referenced by resip::shared_count::use_count().
{
Lock lock(mMutex); (void)lock;
return use_count_;
}
| void resip::sp_counted_base::weak_add_ref | ( | ) | [inline] |
Definition at line 131 of file SharedCount.hxx.
References mMutex, and weak_count_.
{
Lock lock(mMutex); (void)lock;
++weak_count_;
}
| void resip::sp_counted_base::weak_release | ( | ) | [inline] |
Definition at line 137 of file SharedCount.hxx.
References destruct(), mMutex, and weak_count_.
Referenced by release().
{
long new_weak_count;
{
Lock lock(mMutex); (void)lock;
new_weak_count = --weak_count_;
}
if(new_weak_count == 0)
{
destruct();
}
}

Mutex resip::sp_counted_base::mMutex [mutable, private] |
Definition at line 166 of file SharedCount.hxx.
Referenced by add_ref_copy(), add_ref_lock(), release(), use_count(), weak_add_ref(), and weak_release().
long resip::sp_counted_base::use_count_ [private] |
Definition at line 163 of file SharedCount.hxx.
Referenced by add_ref_copy(), add_ref_lock(), release(), and use_count().
long resip::sp_counted_base::weak_count_ [private] |
Definition at line 164 of file SharedCount.hxx.
Referenced by weak_add_ref(), and weak_release().
1.7.5.1