UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TypedElementId.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5//#include "CoreMinimal.h"
9
17{
18public:
20 : CombinedId(0)
21 {
22 }
23
26
29 {
30 InOther.Private_DestroyNoRef();
31 }
32
34 {
35 if (this != &InOther)
36 {
38
39 InOther.Private_DestroyNoRef();
40 }
41 return *this;
42 }
43
45 {
46 checkf(!IsSet(), TEXT("Element ID was still set during destruction! This will leak an element reference, and you should release this ID prior to destruction!"));
47 }
48
49 inline explicit operator bool() const
50 {
51 return IsSet();
52 }
53
57 inline bool IsSet() const
58 {
59 return TypeId != 0;
60 }
61
66 {
67 return TypeId;
68 }
69
74 {
75 return ElementId;
76 }
77
84 {
85 return CombinedId;
86 }
87
88 inline friend bool operator==(const FTypedElementId& InLHS, const FTypedElementId& InRHS)
89 {
90 return InLHS.CombinedId == InRHS.CombinedId;
91 }
92
93 inline friend bool operator!=(const FTypedElementId& InLHS, const FTypedElementId& InRHS)
94 {
95 return !(InLHS == InRHS);
96 }
97
99 {
100 return GetTypeHash(InElementId.CombinedId);
101
102 }
103
109
111 {
112 CombinedId = 0;
113 }
114
117
118private:
119 union
120 {
121 struct
122 {
123 // Note: These are arranged in this order to give CombinedId better hash distribution for GetTypeHash!
126 };
128 };
129};
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
constexpr SIZE_T TypedHandleElementIdBits
Definition TypedElementLimits.h:18
uint8 FTypedHandleTypeId
Definition TypedElementLimits.h:29
uint32 FTypedHandleCombinedId
Definition TypedElementLimits.h:31
int32 FTypedHandleElementId
Definition TypedElementLimits.h:30
constexpr SIZE_T TypedHandleTypeIdBits
Definition TypedElementLimits.h:17
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition TypedElementId.h:17
FTypedElementId & operator=(FTypedElementId &&InOther)
Definition TypedElementId.h:33
friend bool operator==(const FTypedElementId &InLHS, const FTypedElementId &InRHS)
Definition TypedElementId.h:88
FTypedHandleCombinedId GetCombinedId() const
Definition TypedElementId.h:83
FTypedHandleCombinedId CombinedId
Definition TypedElementId.h:127
FTypedElementId()
Definition TypedElementId.h:19
void Private_InitializeNoRef(const FTypedHandleTypeId InTypeId, const FTypedHandleElementId InElementId)
Definition TypedElementId.h:104
FTypedElementId(FTypedElementId &&InOther)
Definition TypedElementId.h:27
FTypedHandleElementId GetElementId() const
Definition TypedElementId.h:73
void Private_DestroyNoRef()
Definition TypedElementId.h:110
friend bool operator!=(const FTypedElementId &InLHS, const FTypedElementId &InRHS)
Definition TypedElementId.h:93
FTypedHandleCombinedId TypeId
Definition TypedElementId.h:125
bool IsSet() const
Definition TypedElementId.h:57
friend uint32 GetTypeHash(const FTypedElementId &InElementId)
Definition TypedElementId.h:98
static TYPEDELEMENTFRAMEWORK_API const FTypedElementId Unset
Definition TypedElementId.h:116
~FTypedElementId()
Definition TypedElementId.h:44
FTypedElementId(const FTypedElementId &)=delete
FTypedHandleTypeId GetTypeId() const
Definition TypedElementId.h:65
FTypedElementId & operator=(const FTypedElementId &)=delete
FTypedHandleCombinedId ElementId
Definition TypedElementId.h:124