Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Templates
Inheritance Hierarchy
- TRefCountingMixin
- FRefCountedDisplayString
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Templates/RefCounting.h |
| Include | #include "Templates/RefCounting.h" |
Syntax
template<typename T, ERefCountingMode Mode>
class TRefCountingMixin
Remarks
Ref-counting mixin, designed to add ref-counting to an object without requiring a virtual destructor. Implements support for AutoRTFM, is thread-safe by default, and can support custom deleters via T::StaticDestroyObject.
AutoRTFM means that the return value of AddRef/Release is nonsense (as the ref-count doesn't change until the transaction is committed), but this is fine for use with TRefCountPtr (as it doesn't use those return values).
Basic Example: struct FMyRefCountedObject : public TRefCountingMixin
Deleter Example: struct FMyRefCountedPooledObject : public TRefCountingMixin
Constructors
| Type | Name | Description | |
|---|---|---|---|
TRefCountingMixin
(
const TRefCountingMixin& |
Functions
| Type | Name | Description | |
|---|---|---|---|
| uint32 | AddRef () |
||
| uint32 | GetRefCount () |
||
| uint32 | Release () |
||
| void | StaticDestroyObject
(
const T* Obj |
Operators
| Type | Name | Description | |
|---|---|---|---|
| TRefCountingMixin & | operator=
(
const TRefCountingMixin& |
Typedefs
| Name | Description |
|---|---|
| RefCountType |