Navigation
API > API/Runtime > API/Runtime/UniversalObjectLocator
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.
| Name | FUniversalObjectLocatorFragment |
| Type | struct |
| Header File | /Engine/Source/Runtime/UniversalObjectLocator/Public/UniversalObjectLocatorFragment.h |
| Include Path | #include "UniversalObjectLocatorFragment.h" |
Syntax
USTRUCT (BlueprintType )
struct FUniversalObjectLocatorFragment
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Default constructor: initializes to an empty fragment with no fragment type | UniversalObjectLocatorFragment.h | ||
| Move construction/assignment | UniversalObjectLocatorFragment.h | ||
FUniversalObjectLocatorFragment
(
UE::UniversalObjectLocator::TFragmentTypeHandle< T > InHandle, |
Construct a new fragment with a specific fragment type and data. | UniversalObjectLocatorFragment.h | |
FUniversalObjectLocatorFragment
(
const UObject* InObject, |
Construct this fragment by binding it to an object within a given context. | UniversalObjectLocatorFragment.h | |
FUniversalObjectLocatorFragment
(
const FUniversalObjectLocatorFragment& RHS |
Copy construction/assignment | UniversalObjectLocatorFragment.h | |
FUniversalObjectLocatorFragment
(
const UE::UniversalObjectLocator::FFragmentType& InFragmentType |
Construct a new fragment with a specific fragment type and default-constructed payload. | UniversalObjectLocatorFragment.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FUniversalObjectLocatorFragment() |
Destructor - destructs the payload, and frees any heap allocation as necessary | UniversalObjectLocatorFragment.h |
Structs
| Name | Remarks |
|---|---|
| FAllocatedPayload | Describes a UOL fragment payload after it has been allocated Where UE_UNIVERSALOBJECTLOCATOR_DEBUG is enabled, the allocation will be laid out as such: 0.. |
| FDebuggableFragment | |
| FDebuggableFragmentType |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FParseStringParams | UE::UniversalObjectLocator::FParseStringParams | UniversalObjectLocatorFragment.h | |
| FParseStringResult | UE::UniversalObjectLocator::FParseStringResult | UniversalObjectLocatorFragment.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| SizeInMemory | SIZE_T | Make our inline data buffer larger in-editor to support editor-only data without allocation | UniversalObjectLocatorFragment.h |
| ValidFragmentDelimiters | FAsciiSet | Valid fragment delimiters are those that are allowable by RFC3986 for the query part (unreserved / pct-encoded / sub-delims / ":" / "@" / "/" / "?") excluding '&' which we use to separate fragments within a path. | UniversalObjectLocatorFragment.h |
| ValidFragmentPayloadCharacters | FAsciiSet | UniversalObjectLocatorFragment.h | |
| ValidFragmentTypeCharacters | FAsciiSet | UniversalObjectLocatorFragment.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsInitialized | uint8 | True when FragmentType has been assigned to a valid handle, and Data has been initialized with FragmentType::PayloadType | UniversalObjectLocatorFragment.h | |
| bIsInline | uint8 | True if Data is an inline allocation of FragmentType::PayloadType, false means Data is a (void*) to the heap allocated data. | UniversalObjectLocatorFragment.h | |
| Data | uint8 | Payload data - implicitly aligned to a 8 byte boundary since it's the first member. | UniversalObjectLocatorFragment.h | |
| DebugHeaderSizeLog2 | uint8 | Offset from the allocated memory to the fragment payload stored as a power of 2. | UniversalObjectLocatorFragment.h | |
| FragmentType | UE::UniversalObjectLocator::FFragmentTypeHandle | 1 Byte - the fragment type portion of the universal fragment | UniversalObjectLocatorFragment.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddStructReferencedObjects
(
FReferenceCollector& Collector |
UniversalObjectLocatorFragment.h | ||
bool ExportTextItem
(
FString& ValueStr, |
UniversalObjectLocatorFragment.h | ||
UScriptStruct * GetFragmentStruct() |
Retrieve this fragment's fragment struct type | UniversalObjectLocatorFragment.h | |
const UE::UniversalObjectLocator::FFragmentType * GetFragmentType() |
Retrieve this fragment's fragment type | UniversalObjectLocatorFragment.h | |
UE::UniversalObjectLocator::FFragmentTypeHandle GetFragmentTypeHandle() |
Retrieve this fragment's fragment type handle | UniversalObjectLocatorFragment.h | |
const void * GetPayload () |
Retrieve this fragment's payload data | UniversalObjectLocatorFragment.h | |
void * GetPayload () |
Retrieve this fragment's payload data | UniversalObjectLocatorFragment.h | |
const T * GetPayloadAs
(
UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType |
Try and retrieve this fragment's payload as a specific type using its fragment type handle | UniversalObjectLocatorFragment.h | |
T * GetPayloadAs
(
UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType |
Try and retrieve this fragment's payload as a specific type using its fragment type handle | UniversalObjectLocatorFragment.h | |
| UniversalObjectLocatorFragment.h | |||
bool ImportTextItem
(
const TCHAR*& Buffer, |
UniversalObjectLocatorFragment.h | ||
bool IsEmpty () |
Check whether this reference is empty. | UniversalObjectLocatorFragment.h | |
| Reset this fragment to point to a new object from the specified context | UniversalObjectLocatorFragment.h | ||
void Reset
(
const UObject* InObject, |
Reset this fragment to point to a new object from the specified context using a filtered set of fragment types | UniversalObjectLocatorFragment.h | |
void Reset () |
Reset this fragment back to its default-constructed, empty state | UniversalObjectLocatorFragment.h | |
UE::UniversalObjectLocator::FResolveResult Resolve
(
const UE::UniversalObjectLocator::FResolveParams& Params |
Attempt to resolve this fragment by invoking the payload's 'Resolve' function | UniversalObjectLocatorFragment.h | |
bool Serialize
(
FArchive& Ar |
UniversalObjectLocatorFragment.h | ||
bool SerializeFromMismatchedTag
(
const FPropertyTag& Tag, |
UniversalObjectLocatorFragment.h | ||
void ToString
(
FStringBuilderBase& OutString |
Convert this fragment to a string of the form fragment-id[=fragment-payload] | UniversalObjectLocatorFragment.h | |
bool TryGetPayloadAs
(
UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType, |
Try and retrieve this fragment's payload as a specific type using its fragment type handle | UniversalObjectLocatorFragment.h | |
bool TryGetPayloadAs
(
UE::UniversalObjectLocator::TFragmentTypeHandle< T > InType, |
Try and retrieve this fragment's payload as a specific type using its fragment type handle | UniversalObjectLocatorFragment.h | |
FParseStringResult TryParseFragmentPayload
(
FStringView InString, |
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. | UniversalObjectLocatorFragment.h | |
FParseStringResult TryParseFragmentType
(
FStringView InString, |
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. | UniversalObjectLocatorFragment.h | |
FParseStringResult TryParseString
(
FStringView InString, |
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. | UniversalObjectLocatorFragment.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAllocatedPayload AllocatePayload
(
size_t Size, |
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. | UniversalObjectLocatorFragment.h | |
void CheckPayloadType
(
UScriptStruct* TypeToCompare |
Runtime type-checking against specific struct types. | UniversalObjectLocatorFragment.h | |
void DefaultConstructPayload
(
const UE::UniversalObjectLocator::FFragmentType& InFragmentType |
Default-initialize the fragment payload using the specified type | UniversalObjectLocatorFragment.h | |
void DestroyPayload() |
Destroy the payload (if valid) by calling its destructor and freeing the memory (if necessary) | UniversalObjectLocatorFragment.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| UniversalObjectLocatorFragment.h | |||
FUniversalObjectLocatorFragment & operator=
(
const FUniversalObjectLocatorFragment& RHS |
UniversalObjectLocatorFragment.h |