Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::sp_adl_block::intrusive_ref_counter< DerivedT, CounterPolicyT > Class Template Reference

A reference counter base class. More...

#include <intrusive_ref_counter.hpp>

Public Member Functions

 intrusive_ref_counter () BOOST_NOEXCEPT
 Default constructor. More...
 
 intrusive_ref_counter (intrusive_ref_counter const &) BOOST_NOEXCEPT
 Copy constructor. More...
 
intrusive_ref_counteroperator= (intrusive_ref_counter const &) BOOST_NOEXCEPT
 Assignment. More...
 
unsigned int use_count () const BOOST_NOEXCEPT
 

Friends

void intrusive_ptr_add_ref (const intrusive_ref_counter< DerivedT, CounterPolicyT > *p) BOOST_NOEXCEPT
 Destructor. More...
 
void intrusive_ptr_release (const intrusive_ref_counter< DerivedT, CounterPolicyT > *p) BOOST_NOEXCEPT
 

Detailed Description

template<typename DerivedT, typename CounterPolicyT>
class boost::sp_adl_block::intrusive_ref_counter< DerivedT, CounterPolicyT >

A reference counter base class.

This base class can be used with user-defined classes to add support for intrusive_ptr. The class contains a reference counter defined by the CounterPolicyT. Upon releasing the last intrusive_ptr referencing the object derived from the intrusive_ref_counter class, operator delete is automatically called on the pointer to the object.

The other template parameter, DerivedT, is the user's class that derives from intrusive_ref_counter.

Constructor & Destructor Documentation

template<typename DerivedT, typename CounterPolicyT>
boost::sp_adl_block::intrusive_ref_counter< DerivedT, CounterPolicyT >::intrusive_ref_counter ( )
inline

Default constructor.

Postcondition
use_count() == 0
template<typename DerivedT, typename CounterPolicyT>
boost::sp_adl_block::intrusive_ref_counter< DerivedT, CounterPolicyT >::intrusive_ref_counter ( intrusive_ref_counter< DerivedT, CounterPolicyT > const &  )
inline

Copy constructor.

Postcondition
use_count() == 0

Member Function Documentation

template<typename DerivedT, typename CounterPolicyT>
intrusive_ref_counter& boost::sp_adl_block::intrusive_ref_counter< DerivedT, CounterPolicyT >::operator= ( intrusive_ref_counter< DerivedT, CounterPolicyT > const &  )
inline

Assignment.

Postcondition
The reference counter is not modified after assignment
template<typename DerivedT, typename CounterPolicyT>
unsigned int boost::sp_adl_block::intrusive_ref_counter< DerivedT, CounterPolicyT >::use_count ( ) const
inline
Returns
The reference counter

References boost::serialization::load().

Friends And Related Function Documentation

template<typename DerivedT, typename CounterPolicyT>
void intrusive_ptr_add_ref ( const intrusive_ref_counter< DerivedT, CounterPolicyT > *  p)
friend

Destructor.

template<typename DerivedT, typename CounterPolicyT>
void intrusive_ptr_release ( const intrusive_ref_counter< DerivedT, CounterPolicyT > *  p)
friend

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