UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FObjectKey Struct Reference

#include <ObjectKey.h>

Public Member Functions

 FObjectKey ()
 
 FObjectKey (const UObject *Object)
 
template<typename U >
UE_FORCEINLINE_HINT FObjectKey (U Object)
 
bool operator== (const FObjectKey &Other) const
 
bool operator!= (const FObjectKey &Other) const
 
bool operator< (const FObjectKey &Other) const
 
bool operator<= (const FObjectKey &Other) const
 
bool operator> (const FObjectKey &Other) const
 
bool operator>= (const FObjectKey &Other) const
 
UObjectResolveObjectPtr () const
 
UObjectResolveObjectPtrEvenIfGarbage () const
 
UObjectResolveObjectPtrEvenIfPendingKill () const
 
UObjectResolveObjectPtrEvenIfUnreachable () const
 
FWeakObjectPtr GetWeakObjectPtr () const
 

Friends

FArchiveoperator<< (FArchive &Ar, FObjectKey &Key)
 
uint32 GetTypeHash (const FObjectKey &Key)
 
FObjectKey UE::CoreUObject::Private::MakeObjectKey (int32 ObjectIndex, int32 ObjectSerialNumber)
 

Detailed Description

FObjectKey is an immutable, copyable key which can be used to uniquely identify an object for the lifetime of the application

Constructor & Destructor Documentation

◆ FObjectKey() [1/3]

FObjectKey::FObjectKey ( )
inline

Default constructor

◆ FObjectKey() [2/3]

FObjectKey::FObjectKey ( const UObject Object)
inline

Construct from an object pointer

◆ FObjectKey() [3/3]

template<typename U >
UE_FORCEINLINE_HINT FObjectKey::FObjectKey ( Object)
inline

Member Function Documentation

◆ GetWeakObjectPtr()

FWeakObjectPtr FObjectKey::GetWeakObjectPtr ( ) const
inline

Create an FWeakObjectPtr that points to the same object as this key.

Returns
The new FWeakObjectPtr.

◆ operator!=()

bool FObjectKey::operator!= ( const FObjectKey Other) const
inline

Compare this key with another

◆ operator<()

bool FObjectKey::operator< ( const FObjectKey Other) const
inline

Compare this key with another

◆ operator<=()

bool FObjectKey::operator<= ( const FObjectKey Other) const
inline

Compare this key with another

◆ operator==()

bool FObjectKey::operator== ( const FObjectKey Other) const
inline

Compare this key with another

◆ operator>()

bool FObjectKey::operator> ( const FObjectKey Other) const
inline

Compare this key with another

◆ operator>=()

bool FObjectKey::operator>= ( const FObjectKey Other) const
inline

Compare this key with another

◆ ResolveObjectPtr()

UObject * FObjectKey::ResolveObjectPtr ( ) const
inline

Attempt to access the object from which this key was constructed.

Returns
The object used to construct this key, or nullptr if it is no longer valid

◆ ResolveObjectPtrEvenIfGarbage()

UObject * FObjectKey::ResolveObjectPtrEvenIfGarbage ( ) const
inline

Attempt to access the object from which this key was constructed, even if it is marked as Garbage.

Returns
The object used to construct this key, or nullptr if it is no longer valid

◆ ResolveObjectPtrEvenIfPendingKill()

UObject * FObjectKey::ResolveObjectPtrEvenIfPendingKill ( ) const
inline

◆ ResolveObjectPtrEvenIfUnreachable()

UObject * FObjectKey::ResolveObjectPtrEvenIfUnreachable ( ) const
inline

Attempt to access the object from which this key was constructed, even if it is RF_PendingKill or RF_Unreachable

Returns
The object used to construct this key, or nullptr if it is no longer valid

Friends And Related Symbol Documentation

◆ GetTypeHash

uint32 GetTypeHash ( const FObjectKey Key)
friend

Hash function

◆ operator<<

FArchive & operator<< ( FArchive Ar,
FObjectKey Key 
)
friend

◆ UE::CoreUObject::Private::MakeObjectKey

FObjectKey UE::CoreUObject::Private::MakeObjectKey ( int32  ObjectIndex,
int32  ObjectSerialNumber 
)
friend

The documentation for this struct was generated from the following file: