class

RefCounted

Base class for objects managed by Ref<T>.

Module
Core
Header
#include "Core/RefCounted.h"
Namespace
Mowo

Constructors

SignatureNameDescription
RefCounted()RefCounted
virtual ~RefCounted()~RefCounted
RefCounted(const RefCounted&) = deleteRefCounted
RefCounted(RefCounted&&) = deleteRefCountedNon-movable — the reference count stays with the object.

Public functions

ReturnsNameDescription
RefCounted&operator=
RefCounted&operator=
voidIncRef
boolDecRefReturns true when the caller released the last reference and must delete.
uint32_tGetRefCount
boolTryIncRefPromote a weak observation to a strong reference.
FWeakRefControl*AcquireWeakControlCaller must hold a strong reference — the block is created on demand and the returned pointer already counts this acquisition.
voidRetainWeakControl
voidReleaseWeakControl
uint32_tGetWeakRefCount

Function details

RefCounted

C++
RefCounted()

~RefCounted

C++
virtual ~RefCounted()

RefCounted

C++
RefCounted(const RefCounted&) = delete

RefCounted

C++
RefCounted(RefCounted&&) = delete

Non-movable — the reference count stays with the object.

operator=

C++
RefCounted& operator=(const RefCounted&) = delete

operator=

C++
RefCounted& operator=(RefCounted&&) = delete

IncRef

C++
void IncRef() const

DecRef

C++
bool DecRef() const

Returns true when the caller released the last reference and must delete. acq_rel orders every operation on the object before deletion.

GetRefCount

C++
uint32_t GetRefCount() const

TryIncRef

C++
bool TryIncRef() const

Promote a weak observation to a strong reference. Fails once the count has reached zero, so it never resurrects an object whose deletion is already committed. Callers must hold the control-block lock.

AcquireWeakControl

C++
FWeakRefControl* AcquireWeakControl() const

Caller must hold a strong reference — the block is created on demand and the returned pointer already counts this acquisition.

RetainWeakControl

C++
static void RetainWeakControl(FWeakRefControl* control)

ReleaseWeakControl

C++
static void ReleaseWeakControl(FWeakRefControl* control)

GetWeakRefCount

C++
uint32_t GetWeakRefCount() const
Generated from Core/RefCounted.h via core.json · Nov 5, 2026Version 1.0.0