![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <UniversalObjectLocator.h>
Static Public Member Functions | |
| static UNIVERSALOBJECTLOCATOR_API FUniversalObjectLocator | FromString (FStringView InString, const FParseStringParams &InParams) |
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.
| FUniversalObjectLocator::FUniversalObjectLocator | ( | ) |
Default constructor
| 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.
| Object | The 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) |
Templated helper for AddFragment
| InFragment | The fragment to add |
| void FUniversalObjectLocator::AddFragment | ( | FUniversalObjectLocatorFragment && | InFragment | ) |
Add a fragment to the end of this locator
| InFragment | The fragment to add |
| 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().
| Context | (Optional) An optional context to use for finding the object - should match what was specified in Reset() or in construction |
| 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().
| Context | (Optional) An optional context to use for finding/loading the object - should match what was specified in Reset() |
| 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().
| Context | (Optional) An optional context to use for finding/loading the object - should match what was specified in Reset() |
| bool FUniversalObjectLocator::ExportTextItem | ( | FString & | ValueStr, |
| const FUniversalObjectLocator & | DefaultValue, | ||
| UObject * | Parent, | ||
| int32 | PortFlags, | ||
| UObject * | ExportRootScope | ||
| ) | const |
| bool FUniversalObjectLocator::ForEachFragment | ( | TFunctionRef< bool(int32, int32, const FUniversalObjectLocatorFragment &)> | InFunction | ) | const |
Iterate the fragments in this address
| InFunction | The visitor function to call for each fragment in this address. Function should return false to stop iteration. |
|
static |
Attempt to deserialize a new locator from a string. Shorthand for FUniversalObjectLocator L; L.TryParseString(InString, InParams);.
| InString | The string to parse |
| InParams | Additional string parameters |
| UE::UniversalObjectLocator::EFragmentTypeFlags FUniversalObjectLocator::GetDefaultFlags | ( | ) | const |
| FUniversalObjectLocatorFragment * FUniversalObjectLocator::GetLastFragment | ( | ) |
Retrieve the last fragment in this address
| const FUniversalObjectLocatorFragment * FUniversalObjectLocator::GetLastFragment | ( | ) | const |
Retrieve the last fragment in this address
| const UE::UniversalObjectLocator::FFragmentType * FUniversalObjectLocator::GetLastFragmentType | ( | ) | const |
Retrieve the fragment type relating to the last locator in this address
| UE::UniversalObjectLocator::FFragmentTypeHandle FUniversalObjectLocator::GetLastFragmentTypeHandle | ( | ) | const |
Retrieve the fragment type handle relating to the last locator in this address
| bool FUniversalObjectLocator::ImportTextItem | ( | const TCHAR *& | Buffer, |
| int32 | PortFlags, | ||
| UObject * | Parent, | ||
| FOutputDevice * | ErrorText, | ||
| FArchive * | InSerializingArchive = nullptr |
||
| ) |
|
inline |
Check if this locator is 'empty'. An empty locator contains no fragments and will never resolve.
| void FUniversalObjectLocator::Reset | ( | ) |
Reset this locator back to its default-constructed, empty state
| 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.
| Object | The 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) |
| UE::UniversalObjectLocator::FResolveResult FUniversalObjectLocator::Resolve | ( | const FResolveParams & | Params | ) | const |
Attempt to resolve this locator by invoking the payload's 'Resolve' function
| Params | Resolution parameters defining the type of resolution to perform |
| bool FUniversalObjectLocator::SerializeFromMismatchedTag | ( | const FPropertyTag & | Tag, |
| FStructuredArchive::FSlot | Slot | ||
| ) |
Attempt to find the object this locator points to. Shorthand for Resolve(FResolveParams::SyncFind(Context)).AsObject().SyncGet().Object.
| Context | (Optional) An optional context to use for finding the object - should match what was specified in Reset() or in construction |
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.
| Context | (Optional) An optional context to use for finding/loading the object - should match what was specified in Reset() |
Attempt to unload the object this locator points to if possible. Shorthand for Resolve(FResolveParams::SyncUnload(Context)).AsVoid().SyncGet().
| Context | (Optional) An optional context to use for finding/loading the object - should match what was specified in Reset() |
| void FUniversalObjectLocator::ToString | ( | FStringBuilderBase & | OutString | ) | const |
Convert this locator to its string representation
| OutString | String builder to populate |
| UE::UniversalObjectLocator::FParseStringResult FUniversalObjectLocator::TryParseString | ( | FStringView | InString, |
| const FParseStringParams & | InParams | ||
| ) |
Attempt to deserialize this locator from a string
| InString | The string to parse |
| InParams | Additional string parameters |
|
friend |
Type hashable
|
friend |
Inequality comparison.
|
friend |
Equality comparison.