This is Unofficial EPICS BASE Doxygen Site
boost::shared_ptr< T > Class Template Reference

#include "exception.hpp"

Public Types

typedef boost::detail::sp_element< T >::type element_type
 

Public Member Functions

 shared_ptr () BOOST_NOEXCEPT
 
 shared_ptr (boost::detail::sp_nullptr_t) BOOST_NOEXCEPT
 
template<class Y >
 shared_ptr (Y *p)
 
template<class Y , class D >
 shared_ptr (Y *p, D d)
 
template<class D >
 shared_ptr (boost::detail::sp_nullptr_t p, D d)
 
template<class Y , class D , class A >
 shared_ptr (Y *p, D d, A a)
 
template<class D , class A >
 shared_ptr (boost::detail::sp_nullptr_t p, D d, A a)
 
 shared_ptr (shared_ptr const &r) BOOST_NOEXCEPT
 
template<class Y >
 shared_ptr (weak_ptr< Y > const &r)
 
template<class Y >
 shared_ptr (weak_ptr< Y > const &r, boost::detail::sp_nothrow_tag) BOOST_NOEXCEPT
 
template<class Y >
 shared_ptr (shared_ptr< Y > const &r, typename boost::detail::sp_enable_if_convertible< Y, T >::type=boost::detail::sp_empty()) BOOST_NOEXCEPT
 
template<class Y >
 shared_ptr (shared_ptr< Y > const &r, element_type *p) BOOST_NOEXCEPT
 
template<class Y >
 shared_ptr (std::auto_ptr< Y > &r)
 
template<class Y >
 shared_ptr (std::auto_ptr< Y > &&r)
 
template<class Y , class D >
 shared_ptr (std::unique_ptr< Y, D > &&r)
 
shared_ptroperator= (shared_ptr const &r) BOOST_NOEXCEPT
 
template<class Y >
shared_ptroperator= (shared_ptr< Y > const &r) BOOST_NOEXCEPT
 
template<class Y >
shared_ptroperator= (std::auto_ptr< Y > &r)
 
template<class Y >
shared_ptroperator= (std::auto_ptr< Y > &&r)
 
template<class Y , class D >
shared_ptroperator= (std::unique_ptr< Y, D > &&r)
 
 shared_ptr (shared_ptr &&r) BOOST_NOEXCEPT
 
template<class Y >
 shared_ptr (shared_ptr< Y > &&r, typename boost::detail::sp_enable_if_convertible< Y, T >::type=boost::detail::sp_empty()) BOOST_NOEXCEPT
 
shared_ptroperator= (shared_ptr &&r) BOOST_NOEXCEPT
 
template<class Y >
shared_ptroperator= (shared_ptr< Y > &&r) BOOST_NOEXCEPT
 
shared_ptroperator= (boost::detail::sp_nullptr_t) BOOST_NOEXCEPT
 
void reset () BOOST_NOEXCEPT
 
template<class Y >
void reset (Y *p)
 
template<class Y , class D >
void reset (Y *p, D d)
 
template<class Y , class D , class A >
void reset (Y *p, D d, A a)
 
template<class Y >
void reset (shared_ptr< Y > const &r, element_type *p)
 
boost::detail::sp_dereference< T >::type operator* () const
 
boost::detail::sp_member_access< T >::type operator-> () const
 
boost::detail::sp_array_access< T >::type operator[] (std::ptrdiff_t i) const
 
element_typeget () const BOOST_NOEXCEPT
 
bool unique () const BOOST_NOEXCEPT
 
long use_count () const BOOST_NOEXCEPT
 
void swap (shared_ptr &other) BOOST_NOEXCEPT
 
template<class Y >
bool owner_before (shared_ptr< Y > const &rhs) const BOOST_NOEXCEPT
 
template<class Y >
bool owner_before (weak_ptr< Y > const &rhs) const BOOST_NOEXCEPT
 
void * _internal_get_deleter (boost::detail::sp_typeinfo const &ti) const BOOST_NOEXCEPT
 
void * _internal_get_untyped_deleter () const BOOST_NOEXCEPT
 
bool _internal_equiv (shared_ptr const &r) const BOOST_NOEXCEPT
 

Friends

template<class Y >
class shared_ptr
 
template<class Y >
class weak_ptr
 

Detailed Description

template<class T>
class boost::shared_ptr< T >

Definition at line 148 of file exception.hpp.

Member Typedef Documentation

template<class T>
typedef boost::detail::sp_element< T >::type boost::shared_ptr< T >::element_type

Definition at line 337 of file shared_ptr.hpp.

Constructor & Destructor Documentation

template<class T>
boost::shared_ptr< T >::shared_ptr ( )
inline

Definition at line 339 of file shared_ptr.hpp.

339  : px( 0 ), pn() // never throws in 1.30+
340  {
341  }
template<class T>
boost::shared_ptr< T >::shared_ptr ( boost::detail::sp_nullptr_t  )
inline

Definition at line 345 of file shared_ptr.hpp.

345  : px( 0 ), pn() // never throws
346  {
347  }
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( Y *  p)
inlineexplicit

Definition at line 352 of file shared_ptr.hpp.

352  : px( p ), pn() // Y must be complete
353  {
355  }
void sp_pointer_construct(boost::shared_ptr< T > *ppx, Y *p, boost::detail::shared_count &pn)
Definition: shared_ptr.hpp:274
template<class T>
template<class Y , class D >
boost::shared_ptr< T >::shared_ptr ( Y *  p,
d 
)
inline

Definition at line 363 of file shared_ptr.hpp.

363  : px( p ), pn( p, d )
364  {
366  }
void sp_deleter_construct(boost::shared_ptr< T > *ppx, Y *p)
Definition: shared_ptr.hpp:298
template<class T>
template<class D >
boost::shared_ptr< T >::shared_ptr ( boost::detail::sp_nullptr_t  p,
d 
)
inline

Definition at line 370 of file shared_ptr.hpp.

370  : px( p ), pn( p, d )
371  {
372  }
template<class T>
template<class Y , class D , class A >
boost::shared_ptr< T >::shared_ptr ( Y *  p,
d,
a 
)
inline

Definition at line 378 of file shared_ptr.hpp.

378  : px( p ), pn( p, d, a )
379  {
381  }
void sp_deleter_construct(boost::shared_ptr< T > *ppx, Y *p)
Definition: shared_ptr.hpp:298
template<class T>
template<class D , class A >
boost::shared_ptr< T >::shared_ptr ( boost::detail::sp_nullptr_t  p,
d,
a 
)
inline

Definition at line 385 of file shared_ptr.hpp.

385  : px( p ), pn( p, d, a )
386  {
387  }
template<class T>
boost::shared_ptr< T >::shared_ptr ( shared_ptr< T > const &  r)
inline

Definition at line 397 of file shared_ptr.hpp.

397  : px( r.px ), pn( r.pn )
398  {
399  }
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( weak_ptr< Y > const &  r)
inlineexplicit

Definition at line 404 of file shared_ptr.hpp.

404  : pn( r.pn ) // may throw
405  {
406  boost::detail::sp_assert_convertible< Y, T >();
407 
408  // it is now safe to copy r.px, as pn(r.pn) did not throw
409  px = r.px;
410  }
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( weak_ptr< Y > const &  r,
boost::detail::sp_nothrow_tag   
)
inline

Definition at line 413 of file shared_ptr.hpp.

414  : px( 0 ), pn( r.pn, boost::detail::sp_nothrow_tag() )
415  {
416  if( !pn.empty() )
417  {
418  px = r.px;
419  }
420  }
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( shared_ptr< Y > const &  r,
typename boost::detail::sp_enable_if_convertible< Y, T >::type  = boost::detail::sp_empty() 
)
inline

Definition at line 425 of file shared_ptr.hpp.

432  : px( r.px ), pn( r.pn )
433  {
434  boost::detail::sp_assert_convertible< Y, T >();
435  }
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( shared_ptr< Y > const &  r,
element_type p 
)
inline

Definition at line 439 of file shared_ptr.hpp.

439  : px( p ), pn( r.pn )
440  {
441  }
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( std::auto_ptr< Y > &  r)
inlineexplicit

Definition at line 446 of file shared_ptr.hpp.

446  : px(r.get()), pn()
447  {
448  boost::detail::sp_assert_convertible< Y, T >();
449 
450  Y * tmp = r.get();
451  pn = boost::detail::shared_count( r );
452 
454  }
void sp_deleter_construct(boost::shared_ptr< T > *ppx, Y *p)
Definition: shared_ptr.hpp:298
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( std::auto_ptr< Y > &&  r)
inline

Definition at line 459 of file shared_ptr.hpp.

459  : px(r.get()), pn()
460  {
461  boost::detail::sp_assert_convertible< Y, T >();
462 
463  Y * tmp = r.get();
464  pn = boost::detail::shared_count( r );
465 
467  }
void sp_deleter_construct(boost::shared_ptr< T > *ppx, Y *p)
Definition: shared_ptr.hpp:298
template<class T>
template<class Y , class D >
boost::shared_ptr< T >::shared_ptr ( std::unique_ptr< Y, D > &&  r)
inline

Definition at line 491 of file shared_ptr.hpp.

491  : px( r.get() ), pn()
492  {
493  boost::detail::sp_assert_convertible< Y, T >();
494 
495  typename std::unique_ptr< Y, D >::pointer tmp = r.get();
496  pn = boost::detail::shared_count( r );
497 
499  }
void sp_deleter_construct(boost::shared_ptr< T > *ppx, Y *p)
Definition: shared_ptr.hpp:298
template<class T>
boost::shared_ptr< T >::shared_ptr ( shared_ptr< T > &&  r)
inline

Definition at line 568 of file shared_ptr.hpp.

568  : px( r.px ), pn()
569  {
570  pn.swap( r.pn );
571  r.px = 0;
572  }
void swap(shared_count &r)
template<class T>
template<class Y >
boost::shared_ptr< T >::shared_ptr ( shared_ptr< Y > &&  r,
typename boost::detail::sp_enable_if_convertible< Y, T >::type  = boost::detail::sp_empty() 
)
inline

Definition at line 577 of file shared_ptr.hpp.

584  : px( r.px ), pn()
585  {
586  boost::detail::sp_assert_convertible< Y, T >();
587 
588  pn.swap( r.pn );
589  r.px = 0;
590  }
void swap(shared_count &r)

Member Function Documentation

template<class T>
bool boost::shared_ptr< T >::_internal_equiv ( shared_ptr< T > const &  r) const
inline

Definition at line 710 of file shared_ptr.hpp.

711  {
712  return px == r.px && pn == r.pn;
713  }
template<class T>
void* boost::shared_ptr< T >::_internal_get_deleter ( boost::detail::sp_typeinfo const &  ti) const
inline

Definition at line 700 of file shared_ptr.hpp.

701  {
702  return pn.get_deleter( ti );
703  }
void * get_deleter(sp_typeinfo const &ti) const
template<class T>
void* boost::shared_ptr< T >::_internal_get_untyped_deleter ( ) const
inline

Definition at line 705 of file shared_ptr.hpp.

706  {
707  return pn.get_untyped_deleter();
708  }
void * get_untyped_deleter() const
template<class T>
element_type* boost::shared_ptr< T >::get ( ) const
inline

Definition at line 666 of file shared_ptr.hpp.

667  {
668  return px;
669  }
template<class T>
boost::detail::sp_dereference< T >::type boost::shared_ptr< T >::operator* ( ) const
inline

Definition at line 644 of file shared_ptr.hpp.

645  {
646  BOOST_ASSERT( px != 0 );
647  return *px;
648  }
#define BOOST_ASSERT(expr)
Definition: assert.hpp:51
template<class T>
boost::detail::sp_member_access< T >::type boost::shared_ptr< T >::operator-> ( ) const
inline

Definition at line 651 of file shared_ptr.hpp.

652  {
653  BOOST_ASSERT( px != 0 );
654  return px;
655  }
#define BOOST_ASSERT(expr)
Definition: assert.hpp:51
template<class T>
shared_ptr& boost::shared_ptr< T >::operator= ( shared_ptr< T > const &  r)
inline

Definition at line 505 of file shared_ptr.hpp.

506  {
507  this_type(r).swap(*this);
508  return *this;
509  }
template<class T>
template<class Y >
shared_ptr& boost::shared_ptr< T >::operator= ( shared_ptr< Y > const &  r)
inline

Definition at line 514 of file shared_ptr.hpp.

515  {
516  this_type(r).swap(*this);
517  return *this;
518  }
template<class T>
template<class Y >
shared_ptr& boost::shared_ptr< T >::operator= ( std::auto_ptr< Y > &  r)
inline

Definition at line 525 of file shared_ptr.hpp.

526  {
527  this_type( r ).swap( *this );
528  return *this;
529  }
template<class T>
template<class Y >
shared_ptr& boost::shared_ptr< T >::operator= ( std::auto_ptr< Y > &&  r)
inline

Definition at line 534 of file shared_ptr.hpp.

535  {
536  this_type( static_cast< std::auto_ptr<Y> && >( r ) ).swap( *this );
537  return *this;
538  }
template<class T>
template<class Y , class D >
shared_ptr& boost::shared_ptr< T >::operator= ( std::unique_ptr< Y, D > &&  r)
inline

Definition at line 556 of file shared_ptr.hpp.

557  {
558  this_type( static_cast< std::unique_ptr<Y, D> && >( r ) ).swap(*this);
559  return *this;
560  }
template<class T>
shared_ptr& boost::shared_ptr< T >::operator= ( shared_ptr< T > &&  r)
inline

Definition at line 592 of file shared_ptr.hpp.

593  {
594  this_type( static_cast< shared_ptr && >( r ) ).swap( *this );
595  return *this;
596  }
template<class T>
template<class Y >
shared_ptr& boost::shared_ptr< T >::operator= ( shared_ptr< Y > &&  r)
inline

Definition at line 599 of file shared_ptr.hpp.

600  {
601  this_type( static_cast< shared_ptr<Y> && >( r ) ).swap( *this );
602  return *this;
603  }
template<class T>
shared_ptr& boost::shared_ptr< T >::operator= ( boost::detail::sp_nullptr_t  )
inline

Definition at line 609 of file shared_ptr.hpp.

610  {
611  this_type().swap(*this);
612  return *this;
613  }
template<class T>
boost::detail::sp_array_access< T >::type boost::shared_ptr< T >::operator[] ( std::ptrdiff_t  i) const
inline

Definition at line 658 of file shared_ptr.hpp.

659  {
660  BOOST_ASSERT( px != 0 );
662 
663  return px[ i ];
664  }
int i
Definition: scan.c:967
#define BOOST_ASSERT(expr)
Definition: assert.hpp:51
template<class T>
template<class Y >
bool boost::shared_ptr< T >::owner_before ( shared_ptr< Y > const &  rhs) const
inline

Definition at line 690 of file shared_ptr.hpp.

691  {
692  return pn < rhs.pn;
693  }
template<class T>
template<class Y >
bool boost::shared_ptr< T >::owner_before ( weak_ptr< Y > const &  rhs) const
inline

Definition at line 695 of file shared_ptr.hpp.

696  {
697  return pn < rhs.pn;
698  }
template<class T>
void boost::shared_ptr< T >::reset ( )
inline

Definition at line 617 of file shared_ptr.hpp.

618  {
619  this_type().swap(*this);
620  }
template<class T>
template<class Y >
void boost::shared_ptr< T >::reset ( Y *  p)
inline

Definition at line 622 of file shared_ptr.hpp.

623  {
624  BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
625  this_type( p ).swap( *this );
626  }
#define BOOST_ASSERT(expr)
Definition: assert.hpp:51
template<class T>
template<class Y , class D >
void boost::shared_ptr< T >::reset ( Y *  p,
d 
)
inline

Definition at line 628 of file shared_ptr.hpp.

629  {
630  this_type( p, d ).swap( *this );
631  }
template<class T>
template<class Y , class D , class A >
void boost::shared_ptr< T >::reset ( Y *  p,
d,
a 
)
inline

Definition at line 633 of file shared_ptr.hpp.

634  {
635  this_type( p, d, a ).swap( *this );
636  }
template<class T>
template<class Y >
void boost::shared_ptr< T >::reset ( shared_ptr< Y > const &  r,
element_type p 
)
inline

Definition at line 638 of file shared_ptr.hpp.

639  {
640  this_type( r, p ).swap( *this );
641  }
template<class T>
void boost::shared_ptr< T >::swap ( shared_ptr< T > &  other)
inline

Definition at line 684 of file shared_ptr.hpp.

685  {
686  std::swap(px, other.px);
687  pn.swap(other.pn);
688  }
void swap(shared_count &r)
void swap(shared_ptr< T > &a, shared_ptr< T > &b) BOOST_NOEXCEPT
Definition: shared_ptr.hpp:783
template<class T>
bool boost::shared_ptr< T >::unique ( ) const
inline

Definition at line 674 of file shared_ptr.hpp.

675  {
676  return pn.unique();
677  }
template<class T>
long boost::shared_ptr< T >::use_count ( ) const
inline

Definition at line 679 of file shared_ptr.hpp.

680  {
681  return pn.use_count();
682  }

Friends And Related Function Documentation

template<class T>
template<class Y >
friend class shared_ptr
friend

Definition at line 722 of file shared_ptr.hpp.

template<class T>
template<class Y >
friend class weak_ptr
friend

Definition at line 723 of file shared_ptr.hpp.


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