This is Unofficial EPICS BASE Doxygen Site
boost::detail::weak_count Class Reference

#include "shared_count.hpp"

Public Member Functions

 weak_count ()
 
 weak_count (shared_count const &r)
 
 weak_count (weak_count const &r)
 
 weak_count (weak_count &&r)
 
 ~weak_count ()
 
weak_countoperator= (shared_count const &r)
 
weak_countoperator= (weak_count const &r)
 
void swap (weak_count &r)
 
long use_count () const
 
bool empty () const
 

Friends

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

Detailed Description

Definition at line 458 of file shared_count.hpp.

Constructor & Destructor Documentation

boost::detail::weak_count::weak_count ( )
inline

Definition at line 472 of file shared_count.hpp.

472  : pi_(0) // nothrow
473 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
474  , id_(weak_count_id)
475 #endif
476  {
477  }
boost::detail::weak_count::weak_count ( shared_count const &  r)
inline

Definition at line 479 of file shared_count.hpp.

479  : pi_(r.pi_) // nothrow
480 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
481  , id_(weak_count_id)
482 #endif
483  {
484  if(pi_ != 0) pi_->weak_add_ref();
485  }
boost::detail::weak_count::weak_count ( weak_count const &  r)
inline

Definition at line 487 of file shared_count.hpp.

487  : pi_(r.pi_) // nothrow
488 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
489  , id_(weak_count_id)
490 #endif
491  {
492  if(pi_ != 0) pi_->weak_add_ref();
493  }
boost::detail::weak_count::weak_count ( weak_count &&  r)
inline

Definition at line 499 of file shared_count.hpp.

499  : pi_(r.pi_) // nothrow
500 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
501  , id_(weak_count_id)
502 #endif
503  {
504  r.pi_ = 0;
505  }
boost::detail::weak_count::~weak_count ( )
inline

Definition at line 509 of file shared_count.hpp.

510  {
511  if(pi_ != 0) pi_->weak_release();
512 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
513  id_ = 0;
514 #endif
515  }

Member Function Documentation

bool boost::detail::weak_count::empty ( ) const
inline

Definition at line 557 of file shared_count.hpp.

558  {
559  return pi_ == 0;
560  }
weak_count& boost::detail::weak_count::operator= ( shared_count const &  r)
inline

Definition at line 517 of file shared_count.hpp.

518  {
519  sp_counted_base * tmp = r.pi_;
520 
521  if( tmp != pi_ )
522  {
523  if(tmp != 0) tmp->weak_add_ref();
524  if(pi_ != 0) pi_->weak_release();
525  pi_ = tmp;
526  }
527 
528  return *this;
529  }
weak_count& boost::detail::weak_count::operator= ( weak_count const &  r)
inline

Definition at line 531 of file shared_count.hpp.

532  {
533  sp_counted_base * tmp = r.pi_;
534 
535  if( tmp != pi_ )
536  {
537  if(tmp != 0) tmp->weak_add_ref();
538  if(pi_ != 0) pi_->weak_release();
539  pi_ = tmp;
540  }
541 
542  return *this;
543  }
void boost::detail::weak_count::swap ( weak_count r)
inline

Definition at line 545 of file shared_count.hpp.

546  {
547  sp_counted_base * tmp = r.pi_;
548  r.pi_ = pi_;
549  pi_ = tmp;
550  }
long boost::detail::weak_count::use_count ( ) const
inline

Definition at line 552 of file shared_count.hpp.

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

Friends And Related Function Documentation

bool operator< ( weak_count const &  a,
weak_count const &  b 
)
friend

Definition at line 567 of file shared_count.hpp.

568  {
569  return std::less<sp_counted_base *>()(a.pi_, b.pi_);
570  }
bool operator== ( weak_count const &  a,
weak_count const &  b 
)
friend

Definition at line 562 of file shared_count.hpp.

563  {
564  return a.pi_ == b.pi_;
565  }
friend class shared_count
friend

Definition at line 468 of file shared_count.hpp.


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