6#include "Misc/AssertionMacros.h"
7#include "HAL/UnrealMemory.h"
8#include "Templates/MemoryOps.h"
9#include "Templates/PointerIsConvertibleFromTo.h"
10#include "Templates/Decay.h"
11#include "Templates/TypeCompatibleBytes.h"
12#include "Templates/UnrealTemplate.h"
15
16
17
18
19
20template<
typename BaseType, uint8 DesiredMaxInlineSize=64, uint8 DefaultAlignment=8>
25
26
33
34
46
47
48 template<
typename... ArgTypes>
56
57
64
65
78
79
84
85
94
95
112
113
127
128
129 template <
typename T,
typename... ArgsType>
138
139
146
147
148
151 checkf(
bIsValid, TEXT(
"It is an error to call GetValue() on an invalid TInlineValue. Please either check IsValid() or use Get(DefaultValue) instead."));
156
157
158
165
166
167
177
178
179
180 void*
Reserve(uint32 InSize, uint32 InAlignment)
194 template<
typename T,
typename... ArgsType>
229 enum { MaxInlineSize = DesiredMaxInlineSize <
sizeof(
void*) ?
sizeof(
void*) : DesiredMaxInlineSize };
242
243
244template<
typename BaseType,
typename UserType, uint8 MaxInlineSize = 64, uint8 DefaultAlignment = 8,
typename... ArgsType>
247 return TInlineValue<BaseType, MaxInlineSize, DefaultAlignment>(UserType(Forward<ArgsType>(Args)...));
#define checkf(expr, format,...)
TInlineValue< BaseType, MaxInlineSize, DefaultAlignment > MakeInlineValue(ArgsType... Args)
void ConditionallyAllocateObject(uint32 Size, uint32 Alignment)
FORCEINLINE BaseType * operator->() const
FORCEINLINE void Emplace(ArgsType &&... Args)
FORCEINLINE BaseType & GetValue() const
FORCEINLINE const BaseType & Get(const BaseType &Default) const
TAlignedBytes< MaxInlineSize, DefaultAlignment > Data
TInlineValue & operator=(const TInlineValue &In)=delete
FORCEINLINE BaseType & operator*() const
TInlineValue(const TInlineValue &In)=delete
void * Reserve(uint32 InSize, uint32 InAlignment)
void Reset(TInlineValue &&In)
TInlineValue(TInlineValue &&In)
TEnableIf< TPointerIsConvertibleFromTo< typenameTDecay< T >::Type, BaseType >::Value, TInlineValue & >::Type operator=(T &&In)
FORCEINLINE bool IsValid() const
void ConditionallyDestroyAllocation()
void InitializeFrom(ArgsType &&... Args)
FORCEINLINE BaseType * GetPtr(BaseType *Default=nullptr) const
TInlineValue(EInPlace, ArgTypes &&... Args)
TInlineValue & operator=(TInlineValue &&In)