Navigation
API > API/Runtime > API/Runtime/CoreUObject
A separate allocation used by FStore that stores the normal (aka strong) refcount alongside the weak refcount, similar to the object used in TSharedPtr. When the strong refcount goes to zero, the FStore is deleted, but this FStoreRefCount lives on to provide notification to any weak pointers, until all weak pointers are dropped as well and this FStoreRefCount is deleted.
We use this custom implementation of WeakPointers rather than the general TSharedPtr/TWeakPtr solution for two reasons:
Independent AddRef+Release: We have references to FStores that require refcounting that come from 16-bit FAssetDataTagMapSharedView.StoreIndex that we convert to a pointer via lookup in GStores. We need to be able to call AddRef and Release during constructor/destructor without having to hold a 64-bit TSharedPtr, to save memory on the hundreds of thousands of FAssetDataTagMapSharedView.
Implementation hiding: We want to make FWeakStorePtr a public type to an implementation-hidden forward declare of FStore, and TWeakPtr
| Name | FStoreRefCount |
| Type | struct |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/AssetRegistry/AssetDataTagMapSerializationDetails.h |
| Include Path | #include "AssetRegistry/AssetDataTagMapSerializationDetails.h" |
Syntax
struct FStoreRefCount
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStoreRefCount
(
FStoreRefCount&& |
AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
FStoreRefCount
(
const FStoreRefCount& |
AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
FStoreRefCount
(
FStore* InOwner |
AssetRegistry/AssetDataTagMapSerializationDetails.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Owner | FStore * | AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
| StrongRefCount | std::atomic< int > | AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
| WeakRefCount | std::atomic< int > | AssetRegistry/AssetDataTagMapSerializationDetails.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TRefCountPtr< const FStore > Pin() |
AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
void StrongAddRef() |
AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
void StrongRelease() |
AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
void WeakAddRef() |
AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
void WeakRelease() |
AssetRegistry/AssetDataTagMapSerializationDetails.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStoreRefCount & operator=
(
const FStoreRefCount& |
AssetRegistry/AssetDataTagMapSerializationDetails.h | ||
FStoreRefCount & operator=
(
FStoreRefCount&& |
AssetRegistry/AssetDataTagMapSerializationDetails.h |