private:
refcount_t refcount_;
-
+
template <class S> void intrusive_ptr_add_ref();
template <class S> void intrusive_ptr_release();
-
+
template <class S>
friend void senf::intrusive_ptr_add_ref(intrusive_refcount_t<S> const * p);
template <class S>
/** \brief Customizable reference count mixin for intrusive_ptr
This class provides a simple internally managed refcount and supplies the <a
- href="http://www.boost.org/libs/smart_ptr/intrusive_ptr.html">boost::intrusive_ptr</a>
+ href="http://www.boost.org/doc/libs/release/libs/smart_ptr/intrusive_ptr.html">boost::intrusive_ptr</a>
required interface. To make a class compatible with \c boost::intrusive_ptr, just derive
publicly from intrusive_refcount_t.
\code
- class SomeClass
+ class SomeClass
: public intrusive_refcount_t<SomeClass>
{
// ...
{
// Call intrusive_base::release() to decrement the
// refcount. This call will return 'true' when the refcount reaches 0.
-
+
// Return 'true', if the instance shall be deleted
}
friend class intrusive_base;
};
\endcode
-
+
Two additional benefits of using intrusive_refcount are
\li The object can access it's own refcount
\li It is valid and safe to convert a plain object pointer to an intrusive_ptr at any time
/** \brief Reference count mixin for intrusive_ptr
This class provides a simple internally managed refcount and supplies the <a
- href="http://www.boost.org/libs/smart_ptr/intrusive_ptr.html">boost::intrusive_ptr</a>
+ href="http://www.boost.org/doc/libs/release/libs/smart_ptr/intrusive_ptr.html">boost::intrusive_ptr</a>
required interface. To make a class compatible with \c boost::intrusive_ptr, just derive
publicly from intrusive_refcount.