![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <UniversalObjectLocatorFragment.h>
Inheritance diagram for FUniversalObjectLocatorFragment:Classes | |
| struct | FAllocatedPayload |
Public Types | |
| using | FParseStringResult = UE::UniversalObjectLocator::FParseStringResult |
| using | FParseStringParams = UE::UniversalObjectLocator::FParseStringParams |
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) |
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.
| using FUniversalObjectLocatorFragment::FParseStringParams = UE::UniversalObjectLocator::FParseStringParams |
| using FUniversalObjectLocatorFragment::FParseStringResult = UE::UniversalObjectLocator::FParseStringResult |
| 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.
| InHandle | A 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::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.
| InFragmentType | The fragment type to use with this fragment |
| FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment | ( | const UObject * | InObject, |
| UObject * | Context | ||
| ) |
Construct this fragment by binding it to an object within a given context.
| FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment | ( | ) |
Default constructor: initializes to an empty fragment with no fragment type
| FUniversalObjectLocatorFragment::~FUniversalObjectLocatorFragment | ( | ) |
Destructor - destructs the payload, and frees any heap allocation as necessary
| FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment | ( | const FUniversalObjectLocatorFragment & | RHS | ) |
Copy construction/assignment
| FUniversalObjectLocatorFragment::FUniversalObjectLocatorFragment | ( | FUniversalObjectLocatorFragment && | RHS | ) |
Move construction/assignment
| void FUniversalObjectLocatorFragment::AddStructReferencedObjects | ( | FReferenceCollector & | Collector | ) |
|
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.
|
inlinestaticconstexprprotected |
Runtime type-checking against specific struct types. Compiled out if checks are not enabled.
|
protected |
Default-initialize the fragment payload using the specified type
|
protected |
Destroy the payload (if valid) by calling its destructor and freeing the memory (if necessary)
| bool FUniversalObjectLocatorFragment::ExportTextItem | ( | FString & | ValueStr, |
| const FUniversalObjectLocatorFragment & | DefaultValue, | ||
| UObject * | Parent, | ||
| int32 | PortFlags, | ||
| UObject * | ExportRootScope | ||
| ) | const |
| UScriptStruct * FUniversalObjectLocatorFragment::GetFragmentStruct | ( | ) | const |
Retrieve this fragment's fragment struct type
| const UE::UniversalObjectLocator::FFragmentType * FUniversalObjectLocatorFragment::GetFragmentType | ( | ) | const |
Retrieve this fragment's fragment type
| UE::UniversalObjectLocator::FFragmentTypeHandle FUniversalObjectLocatorFragment::GetFragmentTypeHandle | ( | ) | const |
Retrieve this fragment's fragment type handle
| void * FUniversalObjectLocatorFragment::GetPayload | ( | ) |
Retrieve this fragment's payload data
| const void * FUniversalObjectLocatorFragment::GetPayload | ( | ) | const |
Retrieve this fragment's payload data
| T * FUniversalObjectLocatorFragment::GetPayloadAs | ( | UE::UniversalObjectLocator::TFragmentTypeHandle< T > | InType | ) |
Try and retrieve this fragment's payload as a specific type using its fragment type handle
| InType | The handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration. |
| 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
| InType | The handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration. |
| bool FUniversalObjectLocatorFragment::ImportTextItem | ( | const TCHAR *& | Buffer, |
| int32 | PortFlags, | ||
| UObject * | Parent, | ||
| FOutputDevice * | ErrorText, | ||
| FArchive * | InSerializingArchive = nullptr |
||
| ) |
|
inline |
Check whether this reference is empty.
| FUniversalObjectLocatorFragment & FUniversalObjectLocatorFragment::operator= | ( | const FUniversalObjectLocatorFragment & | RHS | ) |
| FUniversalObjectLocatorFragment & FUniversalObjectLocatorFragment::operator= | ( | FUniversalObjectLocatorFragment && | RHS | ) |
| void FUniversalObjectLocatorFragment::Reset | ( | ) |
Reset this fragment back to its default-constructed, empty state
Reset this fragment to point to a new object from the specified context
| 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
| UE::UniversalObjectLocator::FResolveResult FUniversalObjectLocatorFragment::Resolve | ( | const UE::UniversalObjectLocator::FResolveParams & | Params | ) | const |
Attempt to resolve this fragment by invoking the payload's 'Resolve' function
| Params | Resolution parameters, defining the context to resolve within, and the type of resolution to perform |
| bool FUniversalObjectLocatorFragment::SerializeFromMismatchedTag | ( | const FPropertyTag & | Tag, |
| FStructuredArchive::FSlot | Slot | ||
| ) |
| void FUniversalObjectLocatorFragment::ToString | ( | FStringBuilderBase & | OutString | ) | const |
Convert this fragment to a string of the form fragment-id[=fragment-payload]
| OutString | String builder to populate |
| 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
| InType | The handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration. |
| OutData | Pointer to retrieve the resulting payload ptr |
| 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
| InType | The handle of the fragment type to this payload to. This is returned from IUniversalObjectLocatorModule::RegisterFragmentType on registration. |
| OutData | Pointer to retrieve the resulting payload ptr |
| 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.
| InString | The string to parse. |
| InParams | Additional string parameters |
| 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.
| InString | The string to parse. |
| InParams | Additional string parameters |
| 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.
| InString | The string to parse. |
| InParams | Additional string parameters |
|
friend |
Type hashable
|
friend |
Inequality comparison. Compares the fragment type and payload data.
|
friend |
Equality comparison. Compares the fragment type and payload data.
Make our inline data buffer larger in-editor to support editor-only data without allocation
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |