MySQL 8.0.39
Source Code Documentation
|
Helper class for reference counting. More...
#include <my_ref_counted.h>
Public Member Functions | |
my_ref_counted () | |
default constructor More... | |
my_ref_counted (my_ref_counted &other) | |
copy constructor More... | |
virtual | ~my_ref_counted () |
uint64 | add_reference () |
Increases a reference count. More... | |
bool | release_reference (uint64 *new_count=nullptr) |
Decreases a reference count. More... | |
uint64 | get_reference_count () const |
Returns the reference counter value. More... | |
Private Attributes | |
std::atomic< uint64 > | m_count |
the reference count value More... | |
Helper class for reference counting.
my_ref_counted::my_ref_counted | ( | ) |
default constructor
my_ref_counted::my_ref_counted | ( | my_ref_counted & | other | ) |
copy constructor
|
virtualdefault |
uint64 my_ref_counted::add_reference | ( | ) |
Increases a reference count.
uint64 my_ref_counted::get_reference_count | ( | ) | const |
Returns the reference counter value.
Decreases a reference count.
Doesn't allow to decrease below 0.
[out] | new_count | Pointer to variable to store new count. May be NULL. |
false | success |
true | Failure. Will be returned in case counter is already 0. |
|
private |
the reference count value