The base class for reference-counted objects.
More...
#include <refcount.h>
|
| counted_base () |
| Default constructor. Initializes the reference count to one.
|
|
void | ref () const |
| Increases the reference count by one.
|
|
bool | unref () const |
| Decreases the reference count by one.
|
|
int_fast32_t | ref_count () const |
| Gets the current reference count.
|
|
bool | ref_count_is_one () const |
| Checks if the reference count is one.
|
|
|
std::atomic_int_fast32_t | ref_ |
|
The base class for reference-counted objects.
◆ counted_base() [1/2]
base::core::counted_base::counted_base |
( |
| ) |
|
Default constructor. Initializes the reference count to one.
◆ ~counted_base()
virtual base::core::counted_base::~counted_base |
( |
| ) |
|
|
inlineprotectedvirtual |
Virtual destructor.
The destructor is protected to prevent the explicit initialization of the base class.
◆ counted_base() [2/2]
base::core::counted_base::counted_base |
( |
const counted_base & |
| ) |
|
|
privatedelete |
◆ operator=()
void base::core::counted_base::operator= |
( |
const counted_base & |
| ) |
|
|
privatedelete |
◆ ref()
void base::core::counted_base::ref |
( |
| ) |
const |
Increases the reference count by one.
◆ ref_count()
int_fast32_t base::core::counted_base::ref_count |
( |
| ) |
const |
Gets the current reference count.
- Returns
- The current reference count.
◆ ref_count_is_one()
bool base::core::counted_base::ref_count_is_one |
( |
| ) |
const |
Checks if the reference count is one.
- Returns
- True if the reference count is one, otherwise false.
◆ unref()
bool base::core::counted_base::unref |
( |
| ) |
const |
Decreases the reference count by one.
- Returns
- True if the object is deleted, otherwise false.
◆ ref_
std::atomic_int_fast32_t base::core::counted_base::ref_ |
|
mutableprivate |
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/module_container/base/core/refcount.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/module_container/base/core/refcount.cpp