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

#include <UniversalObjectLocatorFragment.h>

+ Inheritance diagram for FUniversalObjectLocatorFragment:

Classes

struct  FAllocatedPayload
 

Public Types

using FParseStringResult = UE::UniversalObjectLocator::FParseStringResult
 
using FParseStringParams = UE::UniversalObjectLocator::FParseStringParams
 

Public Member Functions

template<typename T , typename ... ArgTypes>
 FUniversalObjectLocatorFragment (UE::UniversalObjectLocator::TFragmentTypeHandle< T > InHandle, ArgTypes &&...InArgs)
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragment (const UE::UniversalObjectLocator::FFragmentType &InFragmentType)
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragment (const UObject *InObject, UObject *Context)
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragment ()
 
UNIVERSALOBJECTLOCATOR_API ~FUniversalObjectLocatorFragment ()
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragment (const FUniversalObjectLocatorFragment &RHS)
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragmentoperator= (const FUniversalObjectLocatorFragment &RHS)
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragment (FUniversalObjectLocatorFragment &&RHS)
 
UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocatorFragmentoperator= (FUniversalObjectLocatorFragment &&RHS)
 
UNIVERSALOBJECTLOCATOR_API UE::UniversalObjectLocator::FResolveResult Resolve (const UE::UniversalObjectLocator::FResolveParams &Params) const
 
bool IsEmpty () const
 
UNIVERSALOBJECTLOCATOR_API void Reset ()
 
UNIVERSALOBJECTLOCATOR_API void Reset (const UObject *InObject, UObject *Context)
 
UNIVERSALOBJECTLOCATOR_API void Reset (const UObject *InObject, UObject *Context, TFunctionRef< bool(UE::UniversalObjectLocator::FFragmentTypeHandle)> CanUseFragmentType)
 
UNIVERSALOBJECTLOCATOR_API void ToString (FStringBuilderBase &OutString) const
 
UNIVERSALOBJECTLOCATOR_API FParseStringResult TryParseString (FStringView InString, const FParseStringParams &InParams)
 
UNIVERSALOBJECTLOCATOR_API FParseStringResult TryParseFragmentType (FStringView InString, const FParseStringParams &InParams)
 
UNIVERSALOBJECTLOCATOR_API FParseStringResult TryParseFragmentPayload (FStringView InString, const FParseStringParams &InParams)
 
template<typename T >
T * GetPayloadAs (UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType)
 
template<typename T >
const T * GetPayloadAs (UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType) const
 
template<typename T >
bool TryGetPayloadAs (UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType, T *&OutData)
 
template<typename T >
bool TryGetPayloadAs (UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType, const T *&OutData) const
 
UNIVERSALOBJECTLOCATOR_API voidGetPayload ()
 
UNIVERSALOBJECTLOCATOR_API const voidGetPayload () const
 
UNIVERSALOBJECTLOCATOR_API const UE::UniversalObjectLocator::FFragmentTypeGetFragmentType () const
 
UNIVERSALOBJECTLOCATOR_API UScriptStructGetFragmentStruct () const
 
UNIVERSALOBJECTLOCATOR_API UE::UniversalObjectLocator::FFragmentTypeHandle GetFragmentTypeHandle () const
 
UNIVERSALOBJECTLOCATOR_API bool Serialize (FArchive &Ar)
 
UNIVERSALOBJECTLOCATOR_API void AddStructReferencedObjects (FReferenceCollector &Collector)
 
UNIVERSALOBJECTLOCATOR_API bool ExportTextItem (FString &ValueStr, const FUniversalObjectLocatorFragment &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)
 
UNIVERSALOBJECTLOCATOR_API void GetPreloadDependencies (TArray< UObject * > &OutDeps)
 

Static Public Attributes

static constexpr FAsciiSet ValidFragmentTypeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"
 
static constexpr FAsciiSet ValidFragmentDelimiters = "%!$'()*+,;=/?:@.~"
 
static constexpr FAsciiSet ValidFragmentPayloadCharacters = ValidFragmentTypeCharacters | ValidFragmentDelimiters
 
static constexpr SIZE_T SizeInMemory = 32
 

Protected Member Functions

UNIVERSALOBJECTLOCATOR_API FAllocatedPayload AllocatePayload (size_t Size, size_t Alignment)
 
void DefaultConstructPayload (const UE::UniversalObjectLocator::FFragmentType &InFragmentType)
 
void DestroyPayload ()
 

Static Protected Member Functions

static FORCEINLINE constexpr void CheckPayloadType (void *TypeToCompare)
 

Friends

UNIVERSALOBJECTLOCATOR_API friend bool operator== (const FUniversalObjectLocatorFragment &A, const FUniversalObjectLocatorFragment &B)
 
UNIVERSALOBJECTLOCATOR_API friend bool operator!= (const FUniversalObjectLocatorFragment &A, const FUniversalObjectLocatorFragment &B)
 
UNIVERSALOBJECTLOCATOR_API friend uint32 GetTypeHash (const FUniversalObjectLocatorFragment &Fragment)
 

Detailed Description

Universal Object Locator (UOL) Fragments provide an extensible mechanism for referencing permanent, transient or dynamically created objects relative to an external context. UOLs comprise zero or more nested fragments.

Creation and resolution of a fragment requires a context to be provided; normally this will be the object on which the UOL exists as a property.

The way in which the object is referenced is defined by globally registered 'FragmentTypes' (See IUniversalObjectLocatorModule::RegisterFragmentType). Each FragmentType can be thought of as somewhat equivalent to a www URI fragment type, though the 'path' is not necessarily just a string, but includes support for the full set of Engine Property types.

The type is implemented as a type-erased payload block, a fragment type handle and some internal flags. Payloads will be allocated using the inline memory if alignment and size constraints allow, but will fall back to a heap allocation if necessary. Allocation should be avoided by keeping payload types small.

Aligned to 8 bytes, 32 (runtime) or 64 (editor) bytes big.

Member Typedef Documentation

◆ FParseStringParams

◆ FParseStringResult

Constructor & Destructor Documentation

◆ FUniversalObjectLocatorFragment() [1/6]

template<typename T , typename ... ArgTypes>
FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment ( UE::UniversalObjectLocator::TFragmentTypeHandle< T >  InHandle,
ArgTypes &&...  InArgs 
)

Construct a new fragment with a specific fragment type and data. Used when a specific type of relative fragment is required.

Parameters
InHandleA typed handle to the fragment type to use for construction. Retrieved from IUniversalObjectLocatorModule::RegisterFragmentType.
InArgs(Optional) Payload construction arguments to be passed to T on construction. Omission implies default construction.

◆ FUniversalObjectLocatorFragment() [2/6]

FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment ( const UE::UniversalObjectLocator::FFragmentType InFragmentType)

Construct a new fragment with a specific fragment type and default-constructed payload. Used when a specific type of relative fragment is required.

Parameters
InFragmentTypeThe fragment type to use with this fragment

◆ FUniversalObjectLocatorFragment() [3/6]

FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment ( const UObject InObject,
UObject Context 
)

Construct this fragment by binding it to an object within a given context.

Note
: This constructor can 'fail' and result in an Empty fragment if no suitable fragment type could be found for the object

◆ FUniversalObjectLocatorFragment() [4/6]

FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment ( )

Default constructor: initializes to an empty fragment with no fragment type

◆ ~FUniversalObjectLocatorFragment()

FUniversalObjectLocatorFragment::~FUniversalObjectLocatorFragment ( )

Destructor - destructs the payload, and frees any heap allocation as necessary

◆ FUniversalObjectLocatorFragment() [5/6]

FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment ( const FUniversalObjectLocatorFragment RHS)

Copy construction/assignment

◆ FUniversalObjectLocatorFragment() [6/6]

FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment ( FUniversalObjectLocatorFragment &&  RHS)

Move construction/assignment

Member Function Documentation

◆ AddStructReferencedObjects()

void FUniversalObjectLocatorFragment::AddStructReferencedObjects ( FReferenceCollector Collector)

◆ AllocatePayload()

FUniversalObjectLocatorFragment::FAllocatedPayload FUniversalObjectLocatorFragment::AllocatePayload ( size_t  Size,
size_t  Alignment 
)
protected

Allocate (but do not initialize) the fragment payload using the specified size and alignment, accounting for enough space to fit a debug vftable ptr whern UE_UNIVERSALOBJECTLOCATOR_DEBUG is enabled.

Returns
Structure identifying the payload

◆ CheckPayloadType()

static FORCEINLINE constexpr void FUniversalObjectLocatorFragment::CheckPayloadType ( void TypeToCompare)
inlinestaticconstexprprotected

Runtime type-checking against specific struct types. Compiled out if checks are not enabled.

◆ DefaultConstructPayload()

void FUniversalObjectLocatorFragment::DefaultConstructPayload ( const UE::UniversalObjectLocator::FFragmentType InFragmentType)
protected

Default-initialize the fragment payload using the specified type

◆ DestroyPayload()

void FUniversalObjectLocatorFragment::DestroyPayload ( )
protected

Destroy the payload (if valid) by calling its destructor and freeing the memory (if necessary)

◆ ExportTextItem()

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

◆ GetFragmentStruct()

UScriptStruct * FUniversalObjectLocatorFragment::GetFragmentStruct ( ) const

Retrieve this fragment's fragment struct type

Returns
The fragment struct type or nullptr if this fragment is empty

◆ GetFragmentType()

const UE::UniversalObjectLocator::FFragmentType * FUniversalObjectLocatorFragment::GetFragmentType ( ) const

Retrieve this fragment's fragment type

Returns
The fragment type or nullptr if this fragment is empty

◆ GetFragmentTypeHandle()

UE::UniversalObjectLocator::FFragmentTypeHandle FUniversalObjectLocatorFragment::GetFragmentTypeHandle ( ) const

Retrieve this fragment's fragment type handle

Returns
The fragment type handle (possibly invalid if this fragment is empty)

◆ GetPayload() [1/2]

void * FUniversalObjectLocatorFragment::GetPayload ( )

Retrieve this fragment's payload data

Returns
The payload data or nullptr if this fragment is empty

◆ GetPayload() [2/2]

const void * FUniversalObjectLocatorFragment::GetPayload ( ) const

Retrieve this fragment's payload data

Returns
The payload data or nullptr if this fragment is empty

◆ GetPayloadAs() [1/2]

template<typename T >
T * FUniversalObjectLocatorFragment::GetPayloadAs ( UE::UniversalObjectLocator::TFragmentTypeHandle< T >  InType)

Try and retrieve this fragment's payload as a specific type using its fragment type handle

Parameters
InTypeThe handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration.
Returns
A mutable pointer to the payload, or nullptr if this fragment is empty or of a different type.

◆ GetPayloadAs() [2/2]

template<typename T >
const T * FUniversalObjectLocatorFragment::GetPayloadAs ( UE::UniversalObjectLocator::TFragmentTypeHandle< T >  InType) const

Try and retrieve this fragment's payload as a specific type using its fragment type handle

Parameters
InTypeThe handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration.
Returns
A mutable pointer to the payload, or nullptr if this fragment is empty or of a different type.

◆ GetPreloadDependencies()

void FUniversalObjectLocatorFragment::GetPreloadDependencies ( TArray< UObject * > &  OutDeps)

◆ ImportTextItem()

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

◆ IsEmpty()

bool FUniversalObjectLocatorFragment::IsEmpty ( ) const
inline

Check whether this reference is empty.

Note
: An empty fragment can never resolve to an object, but is distinct from, and not equal to, a populated fragment that does points to a non-existent or irretrievable object.

◆ operator=() [1/2]

FUniversalObjectLocatorFragment & FUniversalObjectLocatorFragment::operator= ( const FUniversalObjectLocatorFragment RHS)

◆ operator=() [2/2]

FUniversalObjectLocatorFragment & FUniversalObjectLocatorFragment::operator= ( FUniversalObjectLocatorFragment &&  RHS)

◆ Reset() [1/3]

void FUniversalObjectLocatorFragment::Reset ( )

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

◆ Reset() [2/3]

void FUniversalObjectLocatorFragment::Reset ( const UObject InObject,
UObject Context 
)

Reset this fragment to point to a new object from the specified context

Note
: If no suitable fragment type could be found for the object and context, results in an Empty fragment

◆ Reset() [3/3]

void FUniversalObjectLocatorFragment::Reset ( const UObject InObject,
UObject Context,
TFunctionRef< bool(UE::UniversalObjectLocator::FFragmentTypeHandle)>  CanUseFragmentType 
)

Reset this fragment to point to a new object from the specified context using a filtered set of fragment types

Note
: If no suitable fragment type could be found for the object and context, results in an Empty fragment

◆ Resolve()

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

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

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

◆ Serialize()

bool FUniversalObjectLocatorFragment::Serialize ( FArchive Ar)

◆ SerializeFromMismatchedTag()

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

◆ ToString()

void FUniversalObjectLocatorFragment::ToString ( FStringBuilderBase OutString) const

Convert this fragment to a string of the form fragment-id[=fragment-payload]

Parameters
OutStringString builder to populate

◆ TryGetPayloadAs() [1/2]

template<typename T >
bool FUniversalObjectLocatorFragment::TryGetPayloadAs ( UE::UniversalObjectLocator::TFragmentTypeHandle< T >  InType,
const T *&  OutData 
) const

Try and retrieve this fragment's payload as a specific type using its fragment type handle

Parameters
InTypeThe handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration.
OutDataPointer to retrieve the resulting payload ptr
Returns
true on success, false if this fragment is empty or of a different type.

◆ TryGetPayloadAs() [2/2]

template<typename T >
bool FUniversalObjectLocatorFragment::TryGetPayloadAs ( UE::UniversalObjectLocator::TFragmentTypeHandle< T >  InType,
T *&  OutData 
)

Try and retrieve this fragment's payload as a specific type using its fragment type handle

Parameters
InTypeThe handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration.
OutDataPointer to retrieve the resulting payload ptr
Returns
true on success, false if this fragment is empty or of a different type.

◆ TryParseFragmentPayload()

UE::UniversalObjectLocator::FParseStringResult FUniversalObjectLocatorFragment::TryParseFragmentPayload ( FStringView  InString,
const FParseStringParams InParams 
)

Attempt to deserialize this fragment's payload from a string, based on its currently assigned type The state of this instance will not be changed if this function returns false.

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

◆ TryParseFragmentType()

UE::UniversalObjectLocator::FParseStringResult FUniversalObjectLocatorFragment::TryParseFragmentType ( FStringView  InString,
const FParseStringParams InParams 
)

Attempt to default initialize this fragment using a string that defines the type The state of this instance will not be changed if this function returns false.

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

◆ TryParseString()

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

Attempt to initialize this fragment from a string of the form fragment-type-id[=payload] The state of this instance will not be changed if this function returns false.

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 FUniversalObjectLocatorFragment Fragment)
friend

Type hashable

◆ operator!=

Inequality comparison. Compares the fragment type and payload data.

◆ operator==

Equality comparison. Compares the fragment type and payload data.

Member Data Documentation

◆ SizeInMemory

constexpr SIZE_T FUniversalObjectLocatorFragment::SizeInMemory = 32
staticconstexpr

Make our inline data buffer larger in-editor to support editor-only data without allocation

◆ ValidFragmentDelimiters

constexpr FAsciiSet FUniversalObjectLocatorFragment::ValidFragmentDelimiters = "%!$'()*+,;=/?:@.~"
staticconstexpr

◆ ValidFragmentPayloadCharacters

constexpr FAsciiSet FUniversalObjectLocatorFragment::ValidFragmentPayloadCharacters = ValidFragmentTypeCharacters | ValidFragmentDelimiters
staticconstexpr

◆ ValidFragmentTypeCharacters

constexpr FAsciiSet FUniversalObjectLocatorFragment::ValidFragmentTypeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"
staticconstexpr

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