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

#include <UniversalObjectLocator.h>

Public Types

using FResolveParams = UE::UniversalObjectLocator::FResolveParams
 
using FResolveResult = UE::UniversalObjectLocator::FResolveResult
 
using FResolveResultData = UE::UniversalObjectLocator::FResolveResultData
 
using FParseStringParams = UE::UniversalObjectLocator::FParseStringParams
 
using FParseStringResult = UE::UniversalObjectLocator::FParseStringResult
 

Public Member Functions

UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocator ()
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocator (UObject *Object, UObject *Context=nullptr, UObject *StopAtContext=nullptr)
 
bool IsEmpty () const
 
UNIVERSALOBJECTLOCATOR_API FResolveResult Resolve (const FResolveParams &Params) const
 
UNIVERSALOBJECTLOCATOR_API FResolveResult AsyncFind (UObject *Context=nullptr) const
 
UNIVERSALOBJECTLOCATOR_API FResolveResult AsyncLoad (UObject *Context=nullptr) const
 
UNIVERSALOBJECTLOCATOR_API FResolveResult AsyncUnload (UObject *Context=nullptr) const
 
UNIVERSALOBJECTLOCATOR_API UObjectSyncFind (UObject *Context=nullptr) const
 
UNIVERSALOBJECTLOCATOR_API UObjectSyncLoad (UObject *Context=nullptr) const
 
UNIVERSALOBJECTLOCATOR_API void SyncUnload (UObject *Context=nullptr) const
 
UNIVERSALOBJECTLOCATOR_API const UE::UniversalObjectLocator::FFragmentTypeGetLastFragmentType () const
 
UNIVERSALOBJECTLOCATOR_API UE::UniversalObjectLocator::FFragmentTypeHandle GetLastFragmentTypeHandle () const
 
UNIVERSALOBJECTLOCATOR_API void ToString (FStringBuilderBase &OutString) const
 
UNIVERSALOBJECTLOCATOR_API FParseStringResult TryParseString (FStringView InString, const FParseStringParams &InParams)
 
UNIVERSALOBJECTLOCATOR_API void Reset ()
 
UNIVERSALOBJECTLOCATOR_API void Reset (UObject *Object, UObject *Context=nullptr, UObject *StopAtContext=nullptr)
 
UNIVERSALOBJECTLOCATOR_API void AddFragment (FUniversalObjectLocatorFragment &&InFragment)
 
template<typename FragmentType , typename ... ArgTypes>
void AddFragment (ArgTypes &&... FragmentArgs)
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragmentGetLastFragment ()
 
UNIVERSALOBJECTLOCATOR_API const FUniversalObjectLocatorFragmentGetLastFragment () const
 
UNIVERSALOBJECTLOCATOR_API bool ForEachFragment (TFunctionRef< bool(int32, int32, const FUniversalObjectLocatorFragment &)> InFunction) const
 
UNIVERSALOBJECTLOCATOR_API UE::UniversalObjectLocator::EFragmentTypeFlags GetDefaultFlags () const
 
UNIVERSALOBJECTLOCATOR_API bool ExportTextItem (FString &ValueStr, const FUniversalObjectLocator &DefaultValue, UObject *Parent, int32 PortFlags, UObject *ExportRootScope) const
 
UNIVERSALOBJECTLOCATOR_API bool ImportTextItem (const TCHAR *&Buffer, int32 PortFlags, UObject *Parent, FOutputDevice *ErrorText, FArchive *InSerializingArchive=nullptr)
 
UNIVERSALOBJECTLOCATOR_API bool SerializeFromMismatchedTag (const FPropertyTag &Tag, FStructuredArchive::FSlot Slot)
 

Static Public Member Functions

static UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocator FromString (FStringView InString, const FParseStringParams &InParams)
 

Friends

struct UE::UniversalObjectLocator::FUniversalObjectLocatorCustomization
 
struct UE::UniversalObjectLocator::FFragmentItem
 
UNIVERSALOBJECTLOCATOR_API friend bool operator== (const FUniversalObjectLocator &A, const FUniversalObjectLocator &B)
 
UNIVERSALOBJECTLOCATOR_API friend bool operator!= (const FUniversalObjectLocator &A, const FUniversalObjectLocator &B)
 
UNIVERSALOBJECTLOCATOR_API friend uint32 GetTypeHash (const FUniversalObjectLocator &Locator)
 

Detailed Description

Universal Object Locators (UOLs) define an address to an object.

The address is implemented as a chain of FUniversalObjectLocatorFragments, allowing addressing of objects that may be nested deeply within levels of externally defined spawn or ownership logic.

For example, a Universal Object Locator may reference an Anim Instance within a Skeletal Mesh Actor is spawned by a Child Actor Component that is spawned by Sequencer. This is impossible with a regular soft object path, but is perfectly feasible for a UOL.

This type is 16 bytes.

Member Typedef Documentation

◆ FParseStringParams

◆ FParseStringResult

◆ FResolveParams

◆ FResolveResult

◆ FResolveResultData

Constructor & Destructor Documentation

◆ FUniversalObjectLocator() [1/2]

FUniversalObjectLocator::FUniversalObjectLocator ( )

Default constructor

◆ FUniversalObjectLocator() [2/2]

FUniversalObjectLocator::FUniversalObjectLocator ( UObject Object,
UObject Context = nullptr,
UObject StopAtContext = nullptr 
)

Attempt to construct this locator from a given object. May result in an empty locator if no suitable address could be created.

Parameters
ObjectThe object that this locator should represent
Context(Optional) Constrain this universal reference based on the specified context. This context should be passed to Resolve otherwise the resolution may fail.
StopAtContext(Optional) Stop constructing this universal reference when we reach the following context (can be used if that context is always passed to Resolve to keep this type smaller)

Member Function Documentation

◆ AddFragment() [1/2]

template<typename FragmentType , typename ... ArgTypes>
void FUniversalObjectLocator::AddFragment ( ArgTypes &&...  FragmentArgs)

Templated helper for AddFragment

Parameters
InFragmentThe fragment to add

◆ AddFragment() [2/2]

void FUniversalObjectLocator::AddFragment ( FUniversalObjectLocatorFragment &&  InFragment)

Add a fragment to the end of this locator

Parameters
InFragmentThe fragment to add

◆ AsyncFind()

UE::UniversalObjectLocator::FResolveResult FUniversalObjectLocator::AsyncFind ( UObject Context = nullptr) const

Attempt to find the object this locator points to. Shorthand for Resolve(FResolveParams::AsyncFind(Context)).AsObject().ReleaseFuture().

Parameters
Context(Optional) An optional context to use for finding the object - should match what was specified in Reset() or in construction
Returns
A result structure that may or may not already have a result populated

◆ AsyncLoad()

UE::UniversalObjectLocator::FResolveResult FUniversalObjectLocator::AsyncLoad ( UObject Context = nullptr) const

Attempt to find the object this locator points to, loading it if necessary (and possible). Shorthand for Resolve(FResolveParams::AsyncLoad(Context)).AsObject().ReleaseFuture().

Parameters
Context(Optional) An optional context to use for finding/loading the object - should match what was specified in Reset()
Returns
A result structure that may or may not already have a result populated

◆ AsyncUnload()

UE::UniversalObjectLocator::FResolveResult FUniversalObjectLocator::AsyncUnload ( UObject Context = nullptr) const

Attempt to unload the object this locator points to if possible. Shorthand for Resolve(FResolveParams::AsyncUnload(Context)).AsVoid().ReleaseFuture().

Parameters
Context(Optional) An optional context to use for finding/loading the object - should match what was specified in Reset()
Returns
A result structure that may or may not already have a result populated

◆ ExportTextItem()

bool FUniversalObjectLocator::ExportTextItem ( FString &  ValueStr,
const FUniversalObjectLocator DefaultValue,
UObject Parent,
int32  PortFlags,
UObject ExportRootScope 
) const

◆ ForEachFragment()

bool FUniversalObjectLocator::ForEachFragment ( TFunctionRef< bool(int32, int32, const FUniversalObjectLocatorFragment &)>  InFunction) const

Iterate the fragments in this address

Parameters
InFunctionThe visitor function to call for each fragment in this address. Function should return false to stop iteration.
Returns
false if the iteration was stopped early, true if the iteration succeeded (or if empty)

◆ FromString()

FUniversalObjectLocator FUniversalObjectLocator::FromString ( FStringView  InString,
const FParseStringParams InParams 
)
static

Attempt to deserialize a new locator from a string. Shorthand for FUniversalObjectLocator L; L.TryParseString(InString, InParams);.

Parameters
InStringThe string to parse
InParamsAdditional string parameters
Returns
A (perhaps empty) object locator

◆ GetDefaultFlags()

UE::UniversalObjectLocator::EFragmentTypeFlags FUniversalObjectLocator::GetDefaultFlags ( ) const

◆ GetLastFragment() [1/2]

FUniversalObjectLocatorFragment * FUniversalObjectLocator::GetLastFragment ( )

Retrieve the last fragment in this address

◆ GetLastFragment() [2/2]

const FUniversalObjectLocatorFragment * FUniversalObjectLocator::GetLastFragment ( ) const

Retrieve the last fragment in this address

◆ GetLastFragmentType()

const UE::UniversalObjectLocator::FFragmentType * FUniversalObjectLocator::GetLastFragmentType ( ) const

Retrieve the fragment type relating to the last locator in this address

◆ GetLastFragmentTypeHandle()

UE::UniversalObjectLocator::FFragmentTypeHandle FUniversalObjectLocator::GetLastFragmentTypeHandle ( ) const

Retrieve the fragment type handle relating to the last locator in this address

◆ ImportTextItem()

bool FUniversalObjectLocator::ImportTextItem ( const TCHAR *&  Buffer,
int32  PortFlags,
UObject Parent,
FOutputDevice ErrorText,
FArchive InSerializingArchive = nullptr 
)

◆ IsEmpty()

bool FUniversalObjectLocator::IsEmpty ( ) const
inline

Check if this locator is 'empty'. An empty locator contains no fragments and will never resolve.

◆ Reset() [1/2]

void FUniversalObjectLocator::Reset ( )

Reset this locator back to its default-constructed, empty state

◆ Reset() [2/2]

void FUniversalObjectLocator::Reset ( UObject Object,
UObject Context = nullptr,
UObject StopAtContext = nullptr 
)

Attempt to reset this locator to point at a different object. May result in an empty locator if no suitable address could be created.

Parameters
ObjectThe object that this locator should represent
Context(Optional) Constrain this universal reference based on the specified context. This context should be passed to Resolve otherwise the resolution may fail.
StopAtContext(Optional) Stop constructing this universal reference when we reach the following context (can be used if that context is always passed to Resolve to keep this type smaller)

◆ Resolve()

UE::UniversalObjectLocator::FResolveResult FUniversalObjectLocator::Resolve ( const FResolveParams Params) const

Attempt to resolve this locator by invoking the payload's 'Resolve' function

Parameters
ParamsResolution parameters defining the type of resolution to perform
Returns
A result structure defining the resolved object pointer, and associated flags

◆ SerializeFromMismatchedTag()

bool FUniversalObjectLocator::SerializeFromMismatchedTag ( const FPropertyTag Tag,
FStructuredArchive::FSlot  Slot 
)

◆ SyncFind()

UObject * FUniversalObjectLocator::SyncFind ( UObject Context = nullptr) const

Attempt to find the object this locator points to. Shorthand for Resolve(FResolveParams::SyncFind(Context)).AsObject().SyncGet().Object.

Parameters
Context(Optional) An optional context to use for finding the object - should match what was specified in Reset() or in construction
Returns
The located object, or nullptr on failure

◆ SyncLoad()

UObject * FUniversalObjectLocator::SyncLoad ( UObject Context = nullptr) const

Attempt to find the object this locator points to, loading it if necessary (and possible), and blocking until it is loaded. Shorthand for Resolve(FResolveParams::SyncLoad(Context)).AsObject().SyncGet().Object.

Parameters
Context(Optional) An optional context to use for finding/loading the object - should match what was specified in Reset()
Returns
The located object, or nullptr on failure

◆ SyncUnload()

void FUniversalObjectLocator::SyncUnload ( UObject Context = nullptr) const

Attempt to unload the object this locator points to if possible. Shorthand for Resolve(FResolveParams::SyncUnload(Context)).AsVoid().SyncGet().

Parameters
Context(Optional) An optional context to use for finding/loading the object - should match what was specified in Reset()
Returns
The located object, or nullptr on failure

◆ ToString()

void FUniversalObjectLocator::ToString ( FStringBuilderBase OutString) const

Convert this locator to its string representation

Parameters
OutStringString builder to populate

◆ TryParseString()

UE::UniversalObjectLocator::FParseStringResult FUniversalObjectLocator::TryParseString ( FStringView  InString,
const FParseStringParams InParams 
)

Attempt to deserialize this locator from a string

Parameters
InStringThe string to parse
InParamsAdditional string parameters
Returns
Parse result, specifying success or failure, and number of characters that were parsed

Friends And Related Symbol Documentation

◆ GetTypeHash

UNIVERSALOBJECTLOCATOR_API friend uint32 GetTypeHash ( const FUniversalObjectLocator Locator)
friend

Type hashable

◆ operator!=

Inequality comparison.

Note
: This tests for exact inequality of its piecewise fragments. Equivalent but not equal locators will always return true.

◆ operator==

UNIVERSALOBJECTLOCATOR_API friend bool operator== ( const FUniversalObjectLocator A,
const FUniversalObjectLocator B 
)
friend

Equality comparison.

Note
: This tests for exact equality of its piecewise fragments. Equivalent but not equal locators will always return false.

◆ UE::UniversalObjectLocator::FFragmentItem

friend struct UE::UniversalObjectLocator::FFragmentItem
friend

◆ UE::UniversalObjectLocator::FUniversalObjectLocatorCustomization

friend struct UE::UniversalObjectLocator::FUniversalObjectLocatorCustomization
friend

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