engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TInlineValue< BaseType, DesiredMaxInlineSize, DefaultAlignment > 模板类 参考

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. 更多...

#include <InlineValue.h>

Public 成员函数

template<typename T , typename... ArgsType>
FORCEINLINE void Emplace (ArgsType &&... Args)
 Emplace a new type (deriving from BaseType) into this inline value
 
FORCEINLINE const BaseType & Get (const BaseType &Default) const
 Get the wrapped object, or a user-specified default 更多...
 
FORCEINLINE BaseType * GetPtr (BaseType *Default=nullptr) const
 Get a pointer the wrapped object, or a user-specified default 更多...
 
FORCEINLINE BaseType & GetValue () const
 Access the wrapped object's base type 更多...
 
FORCEINLINE bool IsValid () const
 Check if this container is wrapping a valid object
 
template<typename T >
TEnableIf< TPointerIsConvertibleFromTo< typenameTDecay< T >::Type, BaseType >::Value, TInlineValue & >::Type operator= (T &&In)
 Move assignment from any type relating to BaseType.
 
void * Reserve (uint32 InSize, uint32 InAlignment)
 Reserve space for a structure derived from BaseType, of the size and alignment specified . 更多...
 
void Reset ()
 Reset this container back to its empty state
 
void Reset (TInlineValue &&In)
 Reset this container to wrap a new type
 
 TInlineValue ()
 Default construction to an empty container
 
 TInlineValue (const TInlineValue &In)=delete
 Copy construction/assignment is disabled
 
template<typename T , typename = typename TEnableIf<TPointerIsConvertibleFromTo<typename TDecay<T>::Type, BaseType>::Value>::Type>
 TInlineValue (T &&In)
 Construction from any type relating to BaseType.
 
 TInlineValue (TInlineValue &&In)
 Move construction/assignment
 
 ~TInlineValue ()
 Destructor
 

详细描述

template<typename BaseType, uint8 DesiredMaxInlineSize = 64, uint8 DefaultAlignment = 8>
class TInlineValue< BaseType, DesiredMaxInlineSize, DefaultAlignment >

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.

成员函数说明

◆ Get()

template<typename BaseType , uint8 DesiredMaxInlineSize = 64, uint8 DefaultAlignment = 8>
FORCEINLINE const BaseType & TInlineValue< BaseType, DesiredMaxInlineSize, DefaultAlignment >::Get ( const BaseType &  Default) const
inline

Get the wrapped object, or a user-specified default

返回
The object, or the user-specified default

◆ GetPtr()

template<typename BaseType , uint8 DesiredMaxInlineSize = 64, uint8 DefaultAlignment = 8>
FORCEINLINE BaseType * TInlineValue< BaseType, DesiredMaxInlineSize, DefaultAlignment >::GetPtr ( BaseType *  Default = nullptr) const
inline

Get a pointer the wrapped object, or a user-specified default

返回
A pointer to the object, or the user-specified default

◆ GetValue()

template<typename BaseType , uint8 DesiredMaxInlineSize = 64, uint8 DefaultAlignment = 8>
FORCEINLINE BaseType & TInlineValue< BaseType, DesiredMaxInlineSize, DefaultAlignment >::GetValue ( ) const
inline

Access the wrapped object's base type

返回
A reference to the object. Will assert where IsValid() is false.

◆ Reserve()

template<typename BaseType , uint8 DesiredMaxInlineSize = 64, uint8 DefaultAlignment = 8>
void * TInlineValue< BaseType, DesiredMaxInlineSize, DefaultAlignment >::Reserve ( uint32  InSize,
uint32  InAlignment 
)
inline

Reserve space for a structure derived from BaseType, of the size and alignment specified .

注解
Does not initialize the memory in anyway

该类的文档由以下文件生成: