reSIProcate/rutil  9694
Public Member Functions | Private Attributes | Friends
resip::shared_count Class Reference

#include <SharedCount.hxx>

Collaboration diagram for resip::shared_count:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 shared_count ()
template<class P , class D >
 shared_count (P p, D d)
template<class Y >
 shared_count (std::auto_ptr< Y > &r)
 ~shared_count ()
 shared_count (shared_count const &r)
shared_countoperator= (shared_count const &r)
void swap (shared_count &r)
long use_count () const
bool unique () const
void * get_deleter (std::type_info const &ti) const

Private Attributes

sp_counted_basepi_

Friends

bool operator== (shared_count const &a, shared_count const &b)
bool operator< (shared_count const &a, shared_count const &b)

Detailed Description

Definition at line 217 of file SharedCount.hxx.


Constructor & Destructor Documentation

resip::shared_count::shared_count ( ) [inline]

Definition at line 225 of file SharedCount.hxx.

                 : pi_(0) // nothrow
   {
   }
template<class P , class D >
resip::shared_count::shared_count ( p,
d 
) [inline]

Definition at line 229 of file SharedCount.hxx.

References pi_.

                                                    : pi_(0)
   {
      try
      {
         pi_ = new sp_counted_base_impl<P, D>(p, d);
      }
      catch(...)
      {
         d(p); // delete p
         throw;
      }
   }
template<class Y >
resip::shared_count::shared_count ( std::auto_ptr< Y > &  r) [inline, explicit]

Definition at line 244 of file SharedCount.hxx.

References resip::sp_counted_base::release().

                                            : pi_(new sp_counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>()))
   {
      r.release();
   }

Here is the call graph for this function:

resip::shared_count::~shared_count ( ) [inline]

Definition at line 249 of file SharedCount.hxx.

References pi_, and resip::sp_counted_base::release().

   {
      if(pi_ != 0) pi_->release();
   }

Here is the call graph for this function:

resip::shared_count::shared_count ( shared_count const &  r) [inline]

Definition at line 254 of file SharedCount.hxx.

References resip::sp_counted_base::add_ref_copy(), and pi_.

                                       : pi_(r.pi_) // nothrow
   {
      if(pi_ != 0) pi_->add_ref_copy();
   }

Here is the call graph for this function:


Member Function Documentation

void* resip::shared_count::get_deleter ( std::type_info const &  ti) const [inline]

Definition at line 296 of file SharedCount.hxx.

References resip::sp_counted_base::get_deleter(), and pi_.

Referenced by resip::SharedPtr< Foo >::_internal_get_deleter().

   {
      return pi_? pi_->get_deleter(ti): 0;
   }

Here is the call graph for this function:

shared_count& resip::shared_count::operator= ( shared_count const &  r) [inline]

Definition at line 259 of file SharedCount.hxx.

References resip::sp_counted_base::add_ref_copy(), pi_, and resip::sp_counted_base::release().

   {
      sp_counted_base * tmp = r.pi_;
      if(tmp != 0) tmp->add_ref_copy();
      if(pi_ != 0) pi_->release();
      pi_ = tmp;

      return *this;
   }

Here is the call graph for this function:

void resip::shared_count::swap ( shared_count r) [inline]

Definition at line 269 of file SharedCount.hxx.

References pi_.

Referenced by resip::SharedPtr< Foo >::swap().

   {
      sp_counted_base * tmp = r.pi_;
      r.pi_ = pi_;
      pi_ = tmp;
   }
bool resip::shared_count::unique ( ) const [inline]

Definition at line 281 of file SharedCount.hxx.

References use_count().

Referenced by resip::SharedPtr< Foo >::unique().

   {
      return use_count() == 1;
   }

Here is the call graph for this function:

long resip::shared_count::use_count ( ) const [inline]

Definition at line 276 of file SharedCount.hxx.

References pi_, and resip::sp_counted_base::use_count().

Referenced by unique(), and resip::SharedPtr< Foo >::use_count().

   {
      return pi_ != 0? pi_->use_count(): 0;
   }

Here is the call graph for this function:


Friends And Related Function Documentation

bool operator< ( shared_count const &  a,
shared_count const &  b 
) [friend]

Definition at line 291 of file SharedCount.hxx.

   {
      return std::less<sp_counted_base *>()(a.pi_, b.pi_);
   }
bool operator== ( shared_count const &  a,
shared_count const &  b 
) [friend]

Definition at line 286 of file SharedCount.hxx.

   {
      return a.pi_ == b.pi_;
   }

Member Data Documentation

Definition at line 221 of file SharedCount.hxx.

Referenced by get_deleter(), operator=(), shared_count(), swap(), use_count(), and ~shared_count().


The documentation for this class was generated from the following file: