UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PropertyTypeCompatibility.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"
7#include "UObject/Class.h"
10#include "UObject/UnrealType.h"
14
16template<typename T>
18{
20 {
21 return StructProperty->Struct == T::StaticStruct();
22 }
23
24 return false;
25}
26
27template<>
32
33template<>
35{
37 {
38 Property = EnumProperty->GetUnderlyingProperty();
39 }
40
41 return Property->GetClass() == FInt8Property::StaticClass();
42}
43
44template<>
46{
48 {
49 Property = EnumProperty->GetUnderlyingProperty();
50 }
52 {
53 return !BoolProperty->IsNativeBool();
54 }
55
56 return Property->GetClass() == FByteProperty::StaticClass();
57}
58
59template<>
61{
63 {
64 Property = EnumProperty->GetUnderlyingProperty();
65 }
66
67 return Property->GetClass() == FInt16Property::StaticClass();
68}
69
70template<>
72{
74 {
75 Property = EnumProperty->GetUnderlyingProperty();
76 }
78 {
79 return !BoolProperty->IsNativeBool();
80 }
81
82 return Property->GetClass() == FUInt16Property::StaticClass();
83}
84
85template<>
87{
89 {
90 Property = EnumProperty->GetUnderlyingProperty();
91 }
92
93 return Property->GetClass() == FIntProperty::StaticClass();
94}
95
96template<>
98{
100 {
101 Property = EnumProperty->GetUnderlyingProperty();
102 }
104 {
105 return !BoolProperty->IsNativeBool();
106 }
107
108 return Property->GetClass() == FUInt32Property::StaticClass();
109}
110
111template<>
113{
115 {
116 Property = EnumProperty->GetUnderlyingProperty();
117 }
118
119 return Property->GetClass() == FInt64Property::StaticClass();
120}
121
122template<>
124{
126 {
127 Property = EnumProperty->GetUnderlyingProperty();
128 }
130 {
131 return !BoolProperty->IsNativeBool();
132 }
133
134 return Property->GetClass() == FUInt64Property::StaticClass();
135}
136
137template<>
139{
140 return Property->GetClass() == FFloatProperty::StaticClass();
141}
142
143template<>
145{
146 return Property->GetClass() == FDoubleProperty::StaticClass();
147}
148
149template<>
154
155template<>
157{
158 return Property->GetClass() == FStrProperty::StaticClass();
159}
160
161template<>
163{
164 return Property->GetClass() == FNameProperty::StaticClass();
165}
166
167template<typename T>
179
180template<>
185
186template<>
191
192template<>
197
198template<>
203
204template<>
209
210template<>
215
216template<>
221
222template<>
227
228template<>
233
234template<>
239
240template<>
245
246template<>
251
252template<>
257
258template<>
263
264template<>
269
270template<>
275
276template<>
281
282template<>
287
288template<>
293
294template<>
299
300template<>
305
306template<>
311
312template<>
317
319template<typename T>
321{
323 {
325 {
327 {
328 return true;
329 //return ObjectProperty->PropertyClass->IsChildOf(T::StaticClass());
330 }
331
332 return false;
333 }
334 else
335 {
337 }
338 }
339};
340
342template<typename T>
344{
346 {
348 {
349 return IsConcreteTypeCompatibleWithReflectedType_Impl<T>(ArrayProperty->Inner);
350 }
351
352 return false;
353 }
354};
355
357template<typename T, int32 N>
365
367template<typename T>
369{
371 {
372 return Property->GetClass() == FWeakObjectProperty::StaticClass();
373 }
374};
375
377template<typename T>
379{
381 {
382 return Property->GetClass() == FLazyObjectProperty::StaticClass();
383 }
384};
385
390template<typename T>
391static inline bool IsConcreteTypeCompatibleWithReflectedType(FProperty* Property)
392{
393 if constexpr (TIsEnum<T>::Value || TIsTEnumAsByte_V<T>)
394 {
396 }
397 else
398 {
400 }
401}
402
403template<typename T>
405{
407 {
408 return InProperty->GetElementSize() == sizeof(uint8);
409 }
410
411 return InProperty->GetElementSize() == sizeof(T);
412}
413
414template<>
416{
418 {
419 return !BoolProperty->IsNativeBool();
420 }
421
422 return InProperty->GetElementSize() == sizeof(uint8);
423}
424
425template<>
427{
429 {
430 return !BoolProperty->IsNativeBool();
431 }
432
433 return InProperty->GetElementSize() == sizeof(uint16);
434}
435
436template<>
438{
440 {
441 return !BoolProperty->IsNativeBool();
442 }
443
444 return InProperty->GetElementSize() == sizeof(uint32);
445}
446
447template<>
449{
451 {
452 return !BoolProperty->IsNativeBool();
453 }
454
455 return InProperty->GetElementSize() == sizeof(uint64);
456}
457
458template<typename T>
466
467template<typename T, int32 N>
475
476template<typename T>
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
bool IsConcreteTypeCompatibleWithReflectedType_Impl< uint32 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:97
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInt32Range >(FProperty *Property)
Definition PropertyTypeCompatibility.h:289
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FFloatInterval >(FProperty *Property)
Definition PropertyTypeCompatibility.h:295
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FColor >(FProperty *Property)
Definition PropertyTypeCompatibility.h:181
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FTransform >(FProperty *Property)
Definition PropertyTypeCompatibility.h:217
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FFloatRangeBound >(FProperty *Property)
Definition PropertyTypeCompatibility.h:271
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FRotator >(FProperty *Property)
Definition PropertyTypeCompatibility.h:205
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FString >(FProperty *Property)
Definition PropertyTypeCompatibility.h:156
bool IsConcreteTypeCompatibleWithReflectedType_Impl< int8 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:34
bool PropertySizesMatch_Impl(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:404
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FLinearColor >(FProperty *Property)
Definition PropertyTypeCompatibility.h:187
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInterpCurvePointTwoVectors >(FProperty *Property)
Definition PropertyTypeCompatibility.h:259
bool IsConcreteTypeCompatibleWithReflectedType_Impl< uint16 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:71
bool IsConcreteTypeCompatibleWithReflectedType_Impl< int64 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:112
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInterpCurvePointVector >(FProperty *Property)
Definition PropertyTypeCompatibility.h:241
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInterpCurvePointQuat >(FProperty *Property)
Definition PropertyTypeCompatibility.h:253
bool IsConcreteTypeCompatibleWithReflectedType_Impl< int16 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:60
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInt32Interval >(FProperty *Property)
Definition PropertyTypeCompatibility.h:301
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FVector >(FProperty *Property)
Definition PropertyTypeCompatibility.h:199
bool PropertySizesMatch_Impl< uint32 >(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:437
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FFloatRange >(FProperty *Property)
Definition PropertyTypeCompatibility.h:277
bool PropertySizesMatch_Impl< uint8 >(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:415
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FName >(FProperty *Property)
Definition PropertyTypeCompatibility.h:162
bool IsConcreteTypeCompatibleWithReflectedType_Impl(FProperty *Property)
Definition PropertyTypeCompatibility.h:17
bool PropertySizesMatch(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:477
bool PropertySizesMatch_Impl< uint16 >(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:426
bool IsConcreteTypeCompatibleWithReflectedType_Impl< bool >(FProperty *Property)
Definition PropertyTypeCompatibility.h:28
bool IsConcreteTypeCompatibleWithReflectedType_Impl< uint8 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:45
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FSoftObjectPath >(FProperty *Property)
Definition PropertyTypeCompatibility.h:307
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInt32RangeBound >(FProperty *Property)
Definition PropertyTypeCompatibility.h:283
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FVector2D >(FProperty *Property)
Definition PropertyTypeCompatibility.h:193
bool IsConcreteTypeCompatibleWithReflectedType_Impl< float >(FProperty *Property)
Definition PropertyTypeCompatibility.h:138
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInterpCurvePointLinearColor >(FProperty *Property)
Definition PropertyTypeCompatibility.h:265
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FQuat >(FProperty *Property)
Definition PropertyTypeCompatibility.h:211
bool IsConcreteTypeCompatibleWithReflectedType_Impl< uint64 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:123
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FSoftClassPath >(FProperty *Property)
Definition PropertyTypeCompatibility.h:313
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FBox2D >(FProperty *Property)
Definition PropertyTypeCompatibility.h:223
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FText >(FProperty *Property)
Definition PropertyTypeCompatibility.h:150
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInterpCurvePointVector2D >(FProperty *Property)
Definition PropertyTypeCompatibility.h:247
bool PropertySizesMatch_Impl< uint64 >(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:448
bool IsConcreteTypeCompatibleWithReflectedType_Impl< double >(FProperty *Property)
Definition PropertyTypeCompatibility.h:144
bool IsConcreteTypeCompatibleWithReflectedType_BuiltInStruct(FProperty *Property)
Definition PropertyTypeCompatibility.h:168
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FGuid >(FProperty *Property)
Definition PropertyTypeCompatibility.h:229
bool IsConcreteTypeCompatibleWithReflectedType_Impl< FInterpCurvePointFloat >(FProperty *Property)
Definition PropertyTypeCompatibility.h:235
bool IsConcreteTypeCompatibleWithReflectedType_Impl< int32 >(FProperty *Property)
Definition PropertyTypeCompatibility.h:86
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition UnrealType.h:3702
Definition UnrealType.h:2543
Definition UnrealType.h:2167
Definition EnumProperty.h:29
static COREUOBJECT_API FFieldClass * StaticClass()
Definition Field.cpp:293
Definition UnrealType.h:3087
Definition UnrealType.h:174
Definition UnrealType.h:6306
Definition Array.h:670
Definition Class.h:1720
static bool IsConcreteTypeCompatibleWithReflectedType(FProperty *Property)
Definition PropertyTypeCompatibility.h:345
static bool IsConcreteTypeCompatibleWithReflectedType(FProperty *Property)
Definition PropertyTypeCompatibility.h:380
static bool IsConcreteTypeCompatibleWithReflectedType(FProperty *Property)
Definition PropertyTypeCompatibility.h:370
static bool IsConcreteTypeCompatibleWithReflectedType(FProperty *Property)
Definition PropertyTypeCompatibility.h:360
Definition PropertyTypeCompatibility.h:321
static bool IsConcreteTypeCompatibleWithReflectedType(FProperty *Property)
Definition PropertyTypeCompatibility.h:322
static bool PropertySizesMatch(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:470
Definition PropertyTypeCompatibility.h:460
static bool PropertySizesMatch(FProperty *InProperty)
Definition PropertyTypeCompatibility.h:461
static UScriptStruct * Get()
Definition Class.h:5275
Definition IsEnum.h:7
Definition ObjectPtr.h:1323
Definition LazyObjectPtr.h:230
Definition WeakObjectPtrTemplates.h:25