libcaf  0.13.2
Public Member Functions | Protected Attributes | Related Functions | List of all members
caf::ref_counted Class Reference

Base class for reference counted objects with an atomic reference count. More...

#include <ref_counted.hpp>

Inheritance diagram for caf::ref_counted:
caf::memory_managed caf::abstract_channel caf::actor_proxy::anchor caf::node_id::data caf::abstract_actor caf::abstract_group caf::actor_pool caf::actor_proxy caf::local_actor caf::forwarding_actor_proxy caf::actor_companion caf::blocking_actor caf::event_based_actor caf::io::broker caf::typed_event_based_actor< Sigs > caf::io::basp_broker

Public Member Functions

 ref_counted (const ref_counted &)
 
ref_countedoperator= (const ref_counted &)
 
void ref () noexcept
 Increases reference count by one.
 
void deref () noexcept
 Decreases reference count by one and calls request_deletion when it drops to zero. More...
 
bool unique () const noexcept
 Queries whether there is exactly one reference.
 
size_t get_reference_count () const noexcept
 
- Public Member Functions inherited from caf::memory_managed
virtual void request_deletion (bool decremented_rc) 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. More...
 

Protected Attributes

std::atomic< size_t > rc_
 

Related Functions

(Note that these are not member functions.)

void intrusive_ptr_add_ref (ref_counted *p)
 
void intrusive_ptr_release (ref_counted *p)
 

Detailed Description

Base class for reference counted objects with an atomic reference count.

Serves the requirements of intrusive_ptr.

Note
All instances of ref_counted start with a reference count of 1.

Member Function Documentation

void caf::ref_counted::deref ( )
noexcept

Decreases reference count by one and calls request_deletion when it drops to zero.

Friends And Related Function Documentation

void intrusive_ptr_add_ref ( ref_counted p)
related
void intrusive_ptr_release ( ref_counted p)
related

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