Navigation
API > API/Runtime > API/Runtime/Core
TAtomicRefCount manages a transactionally-safe atomic refcount value.
This is used by FRefCountedObject and TRefCountingMixin (in thread-safe mode).
| Name | TAtomicRefCount |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Async/AtomicRefCount.h |
| Include Path | #include "Async/AtomicRefCount.h" |
Syntax
template<typename IntType, ERefCountIsQueryable Queryable>
class TAtomicRefCount
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Async/AtomicRefCount.h | |||
TAtomicRefCount
(
IntType InitialRefCount |
Async/AtomicRefCount.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| RefCount | std::atomic< IntType > | Async/AtomicRefCount.h | ||
| TransactionallyDeferredReleaseCount | TQueryableTransactionalType< IntType, Queryable > | Async/AtomicRefCount.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
IntType AddRef() |
Async/AtomicRefCount.h | ||
IntType GetRefCount() |
This is equivalent to https://en.cppreference.com/w/cpp/memory/shared_ptr/use_count This loads with a relaxed memory ordering because a 'live' reference count is unstable by nature and so there's no benefit to try and enforce memory ordering around the reading of it. | Async/AtomicRefCount.h | |
IntType Release() |
Async/AtomicRefCount.h |