62template<
typename TypeA,
typename TypeB = FNull,
typename TypeC = FNull,
typename TypeD = FNull,
typename TypeE = FNull,
typename TypeF = FNull>
121 template<
typename Subtype>
133 template<
typename Subtype>
144 CurrentSubtypeIndex = -1;
152 template<
typename Subtype>
167 template<
typename Subtype>
182 template<
typename Subtype>
198 template<
typename Subtype>
216 return CurrentSubtypeIndex;
222 switch(CurrentSubtypeIndex)
238 switch(
Union.CurrentSubtypeIndex)
246 default: FatalErrorUndefinedSubtype();
break;
255 switch (
Other.CurrentSubtypeIndex)
257 case (
uint8)-1:
break;
264 default: FatalErrorUndefinedSubtype();
break;
273 if(CurrentSubtypeIndex ==
Other.CurrentSubtypeIndex)
275 switch(CurrentSubtypeIndex)
283 default: FatalErrorUndefinedSubtype();
break;
296 Ar << CurrentSubtypeIndex;
298 switch(CurrentSubtypeIndex)
306 default: FatalErrorUndefinedSubtype();
break;
311 Ar << CurrentSubtypeIndex;
313 switch(CurrentSubtypeIndex)
321 default: FatalErrorUndefinedSubtype();
break;
343 template<
typename Subtype>
344 Subtype& InitSubtype()
351 template<
typename Subtype,
typename Po
interType>
352 static void GetSubtypeIndexAndReference(
358 if constexpr (std::is_same_v<TypeA,Subtype>)
363 else if constexpr (std::is_same_v<TypeB,Subtype>)
368 else if constexpr (std::is_same_v<TypeC,Subtype>)
373 else if constexpr (std::is_same_v<TypeD,Subtype>)
378 else if constexpr (std::is_same_v<TypeE,Subtype>)
383 else if constexpr (std::is_same_v<TypeF,Subtype>)
390 static_assert(
sizeof(
TypeA) == 0,
"Type is not subtype of union.");
391 OutIndex = (
uint8)-1;
396 static void FatalErrorUndefinedSubtype()
402template<
typename TypeA,
typename TypeB,
typename TypeC,
typename TypeD,
typename TypeE,
typename TypeF>
#define NULL
Definition oodle2base.h:134
#define check(expr)
Definition AssertionMacros.h:314
FArchive & operator<<(FArchive &Ar, TUnion< TypeA, TypeB, TypeC, TypeD, TypeE, TypeF > &Union)
Definition Union.h:403
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
Definition Archive.h:1208
virtual void Serialize(void *V, int64 Length)
Definition Archive.h:1689
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
friend FArchive & operator<<(FArchive &Ar, FNull &Value)
Definition Union.h:47
bool operator!=(const FNull &) const
Definition Union.h:42
friend uint32 GetTypeHash(FNull)
Definition Union.h:32
bool operator==(const FNull &) const
Definition Union.h:37
bool operator==(const TUnion &Other) const
Definition Union.h:271
TUnion(const TUnion &Other)
Definition Union.h:108
TUnion & operator=(const TUnion &Other)
Definition Union.h:252
TUnion(typename TCallTraits< TypeE >::ParamType InValue, TDisambiguater< 4 > Disambiguater=TDisambiguater< 4 >())
Definition Union.h:96
TUnion()
Definition Union.h:68
TUnion(typename TCallTraits< TypeD >::ParamType InValue, TDisambiguater< 3 > Disambiguater=TDisambiguater< 3 >())
Definition Union.h:90
Subtype & GetSubtype()
Definition Union.h:168
TUnion(typename TCallTraits< TypeA >::ParamType InValue, TDisambiguater< 0 > Disambiguater=TDisambiguater< 0 >())
Definition Union.h:72
TUnion(typename TCallTraits< TypeF >::ParamType InValue, TDisambiguater< 5 > Disambiguater=TDisambiguater< 5 >())
Definition Union.h:102
TTypeCompatibleBytes< TypeC > C
Definition Union.h:333
void ResetSubtype()
Definition Union.h:134
TUnion(typename TCallTraits< TypeC >::ParamType InValue, TDisambiguater< 2 > Disambiguater=TDisambiguater< 2 >())
Definition Union.h:84
~TUnion()
Definition Union.h:114
void Serialize(FArchive &Ar)
Definition Union.h:290
TTypeCompatibleBytes< TypeF > F
Definition Union.h:336
TTypeCompatibleBytes< TypeE > E
Definition Union.h:335
const Subtype & GetSubtype() const
Definition Union.h:153
Subtype * SetSubtype(typename TCallTraits< Subtype >::ParamType NewValue)
Definition Union.h:199
bool HasSubtype() const
Definition Union.h:122
uint8 GetCurrentSubtypeIndex() const
Definition Union.h:214
void Reset()
Definition Union.h:220
friend uint32 GetTypeHash(const TUnion &Union)
Definition Union.h:234
Subtype * SetSubtype()
Definition Union.h:183
TUnion(typename TCallTraits< TypeB >::ParamType InValue, TDisambiguater< 1 > Disambiguater=TDisambiguater< 1 >())
Definition Union.h:78
TTypeCompatibleBytes< TypeA > A
Definition Union.h:331
TTypeCompatibleBytes< TypeB > B
Definition Union.h:332
TTypeCompatibleBytes< TypeD > D
Definition Union.h:334
TCallTraitsParamTypeHelper< T, PassByValue >::ParamType ParamType
Definition UnrealTypeTraits.h:275
TDisambiguater()
Definition Union.h:24
Definition TypeCompatibleBytes.h:24