Reference count mixin for intrusive_ptr. More...
#include <senf/Utils/intrusive_refcount.hh>
Protected Member Functions | |
intrusive_refcount () | |
Protected Member Functions inherited from senf::intrusive_refcount_t< intrusive_refcount > | |
intrusive_refcount_t () | |
Protected Member Functions inherited from senf::intrusive_refcount_base | |
intrusive_refcount_base () | |
void | add_ref () |
bool | release () |
Additional Inherited Members | |
Public Types inherited from senf::intrusive_refcount_base | |
typedef unsigned | refcount_t |
reference count type More... | |
Public Member Functions inherited from senf::intrusive_refcount_base | |
virtual | ~intrusive_refcount_base () |
refcount_t | refcount () const |
current refcount More... | |
bool | is_shared () const |
return true if refcount() > 1 More... | |
Reference count mixin for intrusive_ptr.
This class provides a simple internally managed refcount and supplies the boost::intrusive_ptr required interface. To make a class compatible with boost::intrusive_ptr
, just derive publicly from intrusive_refcount.
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 (not only after new) This mixin class directly uses the default allocation strategy. If you want to customize the reference couting, use \ref intrusive_refcount_t. The interface of this class is defined in \ref intrusive_refcount_t and \ref intrusive_refcount_base (the latter of which you should not use directly).
Definition at line 150 of file intrusive_refcount.hh.
|
protected |