FCompositeBuffer

[FCompositeBuffer](API\Runtime\Core\Memory\FCompositeBuffer) is a non-contiguous buffer composed of zero or more immutable shared buffers.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Memory/CompositeBuffer.h

Include

#include "Memory/CompositeBuffer.h"

Syntax

class FCompositeBuffer

Remarks

FCompositeBuffer is a non-contiguous buffer composed of zero or more immutable shared buffers.

A composite buffer is most efficient when its segments are consumed as they are, but it can be flattened into a contiguous buffer when necessary, by calling ToShared(). Ownership of segment buffers is not changed on construction, but if ownership of segments is required then that can be guaranteed by calling MakeOwned().

Constructors

Name Description

Public function

FCompositeBuffer

(
    BufferTypes&&... Buffers
)

Construct a composite buffer by concatenating the buffers.

Functions

Name Description

Public function Const

void

 

CopyTo

(
    FMutableMemoryView Target,
    uint64 Offset
)

Copies a range of the buffer to a contiguous region of memory.

Public function Const

TConstArrayV...

 

GetSegments()

Returns the segments that the buffer is composed from.

Public function Const

uint64

 

GetSize()

Returns the total size of the composite buffer in bytes.

Public function Const

bool

 

IsNull()

Returns true if the composite buffer is null.

Public function Const

bool

 

IsOwned()

Returns true if every segment in the composite buffer is owned.

Public function Const

void

 

IterateRange

(
    uint64 Offset,
    uint64 Size,
    TFunctionRef< void View...
)

Invokes a visitor with a view of each segment that intersects with a range.

Public function Const

void

 

IterateRange

(
    uint64 Offset,
    uint64 Size,
    TFunctionRef< void View...
)

Public function Const

FCompositeBu...

 

MakeOwned()

Returns a copy of the buffer where every segment is owned.

Public function

FCompositeBu...

 

MakeOwned()

Public function Const

FCompositeBu...

 

Mid

(
    uint64 Offset,
    uint64 Size
)

Returns the middle part of the buffer by taking the size starting at the offset.

Public function

void

 

Reset()

Reset this to null.

Public function Const

FSharedBuffe...

 

ToShared()

Returns the concatenation of the segments into a contiguous buffer.

Public function

FSharedBuffe...

 

ToShared()

Public function Const

FMemoryView

 

ViewOrCopyRange

(
    uint64 Offset,
    uint64 Size,
    FUniqueBuffer& CopyBuffer,
    TFunctionRef< FUniqueBufferS...
)

Returns a view of the range if contained by one segment, otherwise a view of a copy of the range.

Operators

Name Description

Public function Const

 

operator bool()

Returns true if the composite buffer is not null.

Typedefs

Name

Description

CanAppendBufferType

Constants

Name

Description

Null

A null composite buffer.