Navigation
API > API/Runtime > API/Runtime/Core
A container type that houses an instance of BaseType in inline memory where it is <= MaxInlineSize, or in a separate heap allocation where it's > MaxInlineSize.
Can be viewed as a TUniquePtr with a small allocation optimization.
| Name | TInlineValue |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/InlineValue.h |
| Include Path | #include "Misc/InlineValue.h" |
Syntax
template<typename BaseType, uint16 DesiredMaxInlineSize, uint8 DefaultAlignment>
class TInlineValue
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TInlineValue
(
const TInlineValue& In |
Copy construction/assignment is disabled | Misc/InlineValue.h | |
TInlineValue () |
Default construction to an empty container | Misc/InlineValue.h | |
TInlineValue
(
T&& In |
Construction from any type relating to BaseType. | Misc/InlineValue.h | |
TInlineValue
(
TInlineValue&& In |
Move construction/assignment | Misc/InlineValue.h | |
TInlineValue
(
EInPlace, |
In-place construction of BaseType from a set of arguments. | Misc/InlineValue.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TInlineValue() |
Destructor | Misc/InlineValue.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bInline | bool | True where InlineBytes points to a valid BaseType&, false if it's a heap allocated BaseType* | Misc/InlineValue.h | |
| bIsValid | bool | True where this container is wrapping a valid object | Misc/InlineValue.h | |
| Data | TAlignedBytes< MaxInlineSize, DefaultAlignment > | Type-erased bytes containing either a BaseType& or heap allocated BaseType* | Misc/InlineValue.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Emplace
(
ArgsType&&... Args |
Emplace a new type (deriving from BaseType) into this inline value | Misc/InlineValue.h | |
const BaseType & Get
(
const BaseType& Default |
Get the wrapped object, or a user-specified default | Misc/InlineValue.h | |
BaseType * GetPtr
(
BaseType* Default |
Get a pointer the wrapped object, or a user-specified default | Misc/InlineValue.h | |
BaseType & GetValue() |
Access the wrapped object's base type | Misc/InlineValue.h | |
bool IsValid() |
Check if this container is wrapping a valid object | Misc/InlineValue.h | |
void * Reserve
(
uint32 InSize, |
Reserve space for a structure derived from BaseType, of the size and alignment specified . | Misc/InlineValue.h | |
void Reset () |
Reset this container back to its empty state | Misc/InlineValue.h | |
void Reset
(
TInlineValue&& In |
Reset this container to wrap a new type | Misc/InlineValue.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
BaseType & operator*() |
Misc/InlineValue.h | ||
TEnableIf< TPointerIsConvertibleFromTo< typenameTDecay< T >::Type, BaseType >::Value, TInlineValue & >::Type operator=
(
T&& In |
Move assignment from any type relating to BaseType. | Misc/InlineValue.h | |
TInlineValue & operator=
(
const TInlineValue& In |
Misc/InlineValue.h | ||
TInlineValue & operator=
(
TInlineValue&& In |
Misc/InlineValue.h | ||
BaseType * operator->() |
Misc/InlineValue.h |