UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType Class Reference

#include <Allocator.h>

+ Inheritance diagram for uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType:

Public Member Functions

ULANG_FORCEINLINE ForAnyElementType (EDefaultInit)
 
ULANG_FORCEINLINE ForAnyElementType (const RawAllocatorType &Allocator)
 
ULANG_FORCEINLINE ForAnyElementType (AllocatorArgsType... AllocatorArgs)
 
ULANG_FORCEINLINE void MoveToEmpty (ForAnyElementType &Other)
 
ULANG_FORCEINLINE ~ForAnyElementType ()
 
ULANG_FORCEINLINE SScriptContainerElementGetAllocation () const
 
ULANG_FORCEINLINE const RawAllocatorTypeGetRawAllocator () const
 
ULANG_FORCEINLINE void ResizeAllocation (int32_t PreviousNumElements, int32_t NumElements, size_t NumBytesPerElement)
 
ULANG_FORCEINLINE int32_t CalculateSlackReserve (int32_t NumElements, int32_t NumBytesPerElement) const
 
ULANG_FORCEINLINE int32_t CalculateSlackShrink (int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
 
ULANG_FORCEINLINE int32_t CalculateSlackGrow (int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
 
ULANG_FORCEINLINE size_t GetAllocatedSize (int32_t NumAllocatedElements, size_t NumBytesPerElement) const
 
ULANG_FORCEINLINE bool HasAllocation ()
 

Detailed Description

template<class InRawAllocatorType, typename... AllocatorArgsType>
class uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType

A class that may be used when NeedsElementType=false is specified. If NeedsElementType=true, then this must be present but will not be used, and so can simply be a typedef to void

Constructor & Destructor Documentation

◆ ForAnyElementType() [1/3]

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::ForAnyElementType ( EDefaultInit  )
inline

Default constructor.

◆ ForAnyElementType() [2/3]

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::ForAnyElementType ( const RawAllocatorType Allocator)
inline

Constructor with given allocator

◆ ForAnyElementType() [3/3]

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::ForAnyElementType ( AllocatorArgsType...  AllocatorArgs)
inline

◆ ~ForAnyElementType()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::~ForAnyElementType ( )
inline

Destructor.

Member Function Documentation

◆ CalculateSlackGrow()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE int32_t uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::CalculateSlackGrow ( int32_t  NumElements,
int32_t  NumAllocatedElements,
int32_t  NumBytesPerElement 
) const
inline

Calculates the amount of slack to allocate for an array that has just grown to a given number of elements.

Parameters
NumElements- The number of elements to allocate space for.
CurrentNumSlackElements- The current number of elements allocated.
NumBytesPerElement- The number of bytes/element.

◆ CalculateSlackReserve()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE int32_t uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::CalculateSlackReserve ( int32_t  NumElements,
int32_t  NumBytesPerElement 
) const
inline

Calculates the amount of slack to allocate for an array that has just grown or shrunk to a given number of elements.

Parameters
NumElements- The number of elements to allocate space for.
CurrentNumSlackElements- The current number of elements allocated.
NumBytesPerElement- The number of bytes/element.

◆ CalculateSlackShrink()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE int32_t uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::CalculateSlackShrink ( int32_t  NumElements,
int32_t  NumAllocatedElements,
int32_t  NumBytesPerElement 
) const
inline

Calculates the amount of slack to allocate for an array that has just shrunk to a given number of elements.

Parameters
NumElements- The number of elements to allocate space for.
CurrentNumSlackElements- The current number of elements allocated.
NumBytesPerElement- The number of bytes/element.

◆ GetAllocatedSize()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE size_t uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::GetAllocatedSize ( int32_t  NumAllocatedElements,
size_t  NumBytesPerElement 
) const
inline

◆ GetAllocation()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE SScriptContainerElement * uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::GetAllocation ( ) const
inline

Accesses the container's current data.

◆ GetRawAllocator()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE const RawAllocatorType & uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::GetRawAllocator ( ) const
inline

Accesses the container's raw allocator.

◆ HasAllocation()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::HasAllocation ( )
inline

◆ MoveToEmpty()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE void uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::MoveToEmpty ( ForAnyElementType Other)
inline

Moves the state of another allocator into this one. Assumes that the allocator is currently empty, i.e. memory may be allocated but any existing elements have already been destructed (if necessary).

Parameters
Other- The allocator to move the state from. This allocator should be left in a valid empty state.

◆ ResizeAllocation()

template<class InRawAllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE void uLang::TDefaultElementAllocator< InRawAllocatorType, AllocatorArgsType >::ForAnyElementType::ResizeAllocation ( int32_t  PreviousNumElements,
int32_t  NumElements,
size_t  NumBytesPerElement 
)
inline

Resizes the container's allocation.

Parameters
PreviousNumElements- The number of elements that were stored in the previous allocation.
NumElements- The number of elements to allocate space for.
NumBytesPerElement- The number of bytes/element.

The documentation for this class was generated from the following file: