Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
FContainerAllocatorInterface::ForElementType< ElementType > Class Template Reference

#include <ContainerAllocationPolicies.h>

Private Member Functions

void MoveToEmpty (ForElementType &Other)
 
ElementType * GetAllocation () const
 
void ResizeAllocation (int32 PreviousNumElements, int32 NumElements, SIZE_T NumBytesPerElement)
 
int32 CalculateSlack (int32 NumElements, int32 CurrentNumSlackElements, SIZE_T NumBytesPerElement) const
 
int32 CalculateSlackShrink (int32 NumElements, int32 CurrentNumSlackElements, SIZE_T NumBytesPerElement) const
 
int32 CalculateSlackGrow (int32 NumElements, int32 CurrentNumSlackElements, SIZE_T NumBytesPerElement) const
 
SIZE_T GetAllocatedSize (int32 NumAllocatedElements, SIZE_T NumBytesPerElement) const
 

Detailed Description

template<typename ElementType>
class FContainerAllocatorInterface::ForElementType< ElementType >

A class that receives both the explicit allocation policy template parameters specified by the user of the container, but also the implicit ElementType template parameter from the container type.

Definition at line 133 of file ContainerAllocationPolicies.h.

Member Function Documentation

◆ CalculateSlack()

template<typename ElementType >
int32 FContainerAllocatorInterface::ForElementType< ElementType >::CalculateSlack ( int32 NumElements,
int32 CurrentNumSlackElements,
SIZE_T NumBytesPerElement ) const
private

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.

◆ CalculateSlackGrow()

template<typename ElementType >
int32 FContainerAllocatorInterface::ForElementType< ElementType >::CalculateSlackGrow ( int32 NumElements,
int32 CurrentNumSlackElements,
SIZE_T NumBytesPerElement ) const
private

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.

◆ CalculateSlackShrink()

template<typename ElementType >
int32 FContainerAllocatorInterface::ForElementType< ElementType >::CalculateSlackShrink ( int32 NumElements,
int32 CurrentNumSlackElements,
SIZE_T NumBytesPerElement ) const
private

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<typename ElementType >
SIZE_T FContainerAllocatorInterface::ForElementType< ElementType >::GetAllocatedSize ( int32 NumAllocatedElements,
SIZE_T NumBytesPerElement ) const
private

◆ GetAllocation()

template<typename ElementType >
ElementType * FContainerAllocatorInterface::ForElementType< ElementType >::GetAllocation ( ) const
private

Accesses the container's current data.

◆ MoveToEmpty()

template<typename ElementType >
void FContainerAllocatorInterface::ForElementType< ElementType >::MoveToEmpty ( ForElementType< ElementType > & Other)
private

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<typename ElementType >
void FContainerAllocatorInterface::ForElementType< ElementType >::ResizeAllocation ( int32 PreviousNumElements,
int32 NumElements,
SIZE_T NumBytesPerElement )
private

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: