CAF 0.17.6
|
Base class for reference counted objects with an atomic reference count. More...
#include <ref_counted.hpp>
Public Member Functions | |
ref_counted (const ref_counted &) | |
ref_counted & | operator= (const ref_counted &) |
void | ref () const noexcept |
Increases reference count by one. | |
void | deref () const noexcept |
Decreases reference count by one and calls request_deletion when it drops to zero. | |
bool | unique () const noexcept |
Queries whether there is exactly one reference. | |
size_t | get_reference_count () const noexcept |
![]() | |
virtual void | request_deletion (bool decremented_rc) const noexcept |
Default implementations calls `delete this, but can be overriden in case deletion depends on some condition or the class doesn't use default new/delete. | |
Protected Attributes | |
std::atomic< size_t > | rc_ |
Related Symbols | |
(Note that these are not member symbols.) | |
void | intrusive_ptr_add_ref (const ref_counted *p) |
void | intrusive_ptr_release (const ref_counted *p) |
Base class for reference counted objects with an atomic reference count.
Serves the requirements of intrusive_ptr
.
ref_counted
start with a reference count of 1.