UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RefCounting.h File Reference
#include "CoreTypes.h"
#include "AutoRTFM.h"
#include "HAL/PlatformAtomics.h"
#include "HAL/PreprocessorHelpers.h"
#include "HAL/ThreadSafeCounter.h"
#include "Misc/AssertionMacros.h"
#include "Misc/Build.h"
#include "Serialization/Archive.h"
#include "Serialization/MemoryLayout.h"
#include "Templates/Requires.h"
#include "Templates/TypeHash.h"
#include "Templates/UnrealTemplate.h"
#include <atomic>
#include <type_traits>

Go to the source code of this file.

Classes

struct  FReturnedRefCountValue
 
class  IRefCountedObject
 
class  FRefCountBase
 
class  FRefCountedObject
 
class  FThreadSafeRefCountedObject
 
class  TRefCountingMixin< T, ERefCountingMode::ThreadSafe >
 
class  TRefCountingMixin< T, ERefCountingMode::NotThreadSafe >
 
class  TRefCountPtr< ReferencedType >
 

Namespaces

namespace  UE
 
namespace  UE::Private
 

Enumerations

enum class  ERefCountingMode : uint8 { NotThreadSafe = 0 , ThreadSafe = 1 }
 

Functions

 ALIAS_TEMPLATE_TYPE_LAYOUT (template< typename T >, TRefCountPtr< T >, void *)
 
template<typename ReferencedType >
UE_FORCEINLINE_HINT bool operator== (ReferencedType *A, const TRefCountPtr< ReferencedType > &B)
 
template<typename ReferencedType >
UE_FORCEINLINE_HINT uint32 GetTypeHash (const TRefCountPtr< ReferencedType > &InPtr)
 
template<typename ReferencedType >
FArchiveoperator<< (FArchive &Ar, TRefCountPtr< ReferencedType > &Ptr)
 
template<typename T , typename... TArgs>
TRefCountPtr< T > MakeRefCount (TArgs &&... Args)
 

Enumeration Type Documentation

◆ ERefCountingMode

enum class ERefCountingMode : uint8
strong

ERefCountingMode is used select between either 'fast' or 'thread safe' ref-counting types. This is only used at compile time to select between template specializations.

Enumerator
NotThreadSafe 

Forced to be not thread-safe.

ThreadSafe 

Thread-safe: never spin locks, but slower.

Function Documentation

◆ ALIAS_TEMPLATE_TYPE_LAYOUT()

ALIAS_TEMPLATE_TYPE_LAYOUT ( template< typename T >  ,
TRefCountPtr< T >  ,
void  
)

◆ GetTypeHash()

UE_FORCEINLINE_HINT uint32 GetTypeHash ( const TRefCountPtr< ReferencedType > &  InPtr)

◆ MakeRefCount()

template<typename T , typename... TArgs>
TRefCountPtr< T > MakeRefCount ( TArgs &&...  Args)
inline

◆ operator<<()

FArchive & operator<< ( FArchive Ar,
TRefCountPtr< ReferencedType > &  Ptr 
)

◆ operator==()

UE_FORCEINLINE_HINT bool operator== ( ReferencedType A,
const TRefCountPtr< ReferencedType > &  B 
)