CAF 0.17.6
Loading...
Searching...
No Matches
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_group caf::io::network::manager caf::io::network::multiplexer::runnable caf::logger caf::stream_manager caf::io::network::acceptor_manager caf::io::network::datagram_manager caf::io::network::stream_manager caf::detail::stream_distribution_tree< Policy > caf::io::broker_servant< network::acceptor_manager, accept_handle, new_connection_msg > caf::io::broker_servant< network::datagram_manager, datagram_handle, new_datagram_msg > caf::io::broker_servant< network::stream_manager, connection_handle, new_data_msg > caf::io::doorman caf::io::datagram_servant caf::io::scribe caf::io::network::doorman_impl caf::io::network::datagram_servant_impl caf::io::network::scribe_impl

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

Protected Attributes

std::atomic< size_t > rc_

(Note that these are not member symbols.)

void intrusive_ptr_add_ref (const ref_counted *p)
void intrusive_ptr_release (const 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.

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