TChunkedArray

An array that uses multiple allocations to avoid allocation failure due to fragmentation.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/ChunkedArray.h

Include

#include "Containers/ChunkedArray.h"

Syntax

template<typename InElementType, uint32 TargetBytesPerChunk>
class TChunkedArray

Remarks

An array that uses multiple allocations to avoid allocation failure due to fragmentation.

Variables

Name Description

Protected variable

ChunksType

 

Chunks

Protected variable

int32

 

NumElements

The number of elements in the array.

Constructors

Name Description

Public function

TChunkedArray

(
    int32 InNumElements
)

Initialization constructor.

Public function

TChunkedArray

(
    TChunkedArray&& Other
)

Public function

TChunkedArray

(
    const TChunkedArray&
)

Functions

Name Description

Public function

int32

 

Add

(
    int32 Count
)

Public function

int32

 

AddElement

(
    const ElementType& Item
)

Adds a new item to the end of the chunked array.

Public function Const

FConstIterTy...

 

begin()

Public function

FIterType

 

begin()

Public function

void

 

CopyToLinearArray

(
    TArray< ElementType, OtherAllocator...
)

Public function

void

 

Empty

(
    int32 Slack
)

Public function Const

FConstIterTy...

 

end()

Public function

FIterType

 

end()

Public function Const

SIZE_T

 

GetAllocatedSize()

Public function Const

bool

 

IsValidIndex

(
    int32 Index
)

Tests if index is valid, i.e. greater than zero and less than number of elements in array.

Public function Const

int32

 

Num()

Public function

void

 

Reserve

(
    int32 Number
)

Reserves memory such that the array can contain at least Number elements.

Public function

void

 

Shrink()

Operators

Name Description

Public function

ElementType ...

 

operator()

(
    int32 ElementIndex
)

Accessors.

Public function Const

const Elemen...

 

operator()

(
    int32 ElementIndex
)

Public function

ElementType ...

 

operator[]

(
    int32 ElementIndex
)

Public function Const

const Elemen...

 

operator[]

(
    int32 ElementIndex
)

Public function

TChunkedArra...

 

operator+=

(
    const TArray< ElementType >& Other
)

Appends the specified array to this array. Cannot append to self.

Public function

TChunkedArra...

 

operator+=

(
    const TChunkedArray& Other
)

Public function

TChunkedArra...

 

operator=

(
    TChunkedArray&& Other
)

Public function

TChunkedArra...

 

operator=

(
    const TChunkedArray&
)

Classes

Name

Description

Protected struct

FChunk

A chunk of the array's elements.

Typedefs

Name

Description

ChunksType

The chunks of the array's elements.

ElementType

FConstIterType

FIterType

Constants

Name

Description

NumElementsPerChunk

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss