#include <icy/memory.h>Subclassed by:
PacketTransaction< Message >,Context< uv_pipe_t >,Context< uv_tcp_t >,Context< uv_udp_t >,Context< uv_idle_t >,Context< uv_process_t >,Context< uv_async_t >,Context< uv_timer_t >
Base class for intrusive reference counting.
Embeds the refcount in the object itself - no separate control block allocation, no atomic operations. Safe for single-threaded libuv loops.
Usage: inherit from RefCounted
| Return | Name | Description |
|---|---|---|
RefCounted | Defaulted constructor. | |
RefCounted inline | ||
void | addRef const inline | Increments the reference count. Called by IntrusivePtr on acquisition. |
bool | releaseRef const inline | Decrements the reference count. |
int | refCount const inline | Returns the current reference count. |
RefCounted() = defaultDefaulted constructor.
inline
inline RefCounted(const RefCounted &) noexceptconst inline
inline void addRef() const noexceptIncrements the reference count. Called by IntrusivePtr on acquisition.
const inline
inline bool releaseRef() const noexceptDecrements the reference count.
true if the count reached zero (caller should delete the object).
const inline
inline int refCount() const noexceptReturns the current reference count.
Current reference count.
| Return | Name | Description |
|---|---|---|
int | _refCount |
int _refCount = 0