FUniqueBuffer

A reference to a single-ownership mutable buffer.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

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

Include

#include "Memory/SharedBuffer.h"

Syntax

class FUniqueBuffer

Remarks

A reference to a single-ownership mutable buffer.

Ownership can be transferred by moving to FUniqueBuffer or it can be converted to an immutable shared buffer with MoveToShared().

Constructors

Name Description

Public function

FUniqueBuffer()

Construct a null unique buffer.

Public function

FUniqueBuffer

(
    FBufferOwner* Owner
)

Construct a unique buffer from a new unreferenced buffer owner.

Public function

FUniqueBuffer

(
    FUniqueBuffer&&
)

Public function

FUniqueBuffer

(
    const FUniqueBuffer&
)

Functions

Name Description

Public function Static

FUniqueBuffe...

 

Alloc

(
    uint64 Size
)

Make an uninitialized owned buffer of the specified size.

Public function Static

FUniqueBuffe...

 

Clone

(
    FMemoryView View
)

Make an owned clone of the input.

Public function Static

FUniqueBuffe...

 

Clone

(
    const void* Data,
    uint64 Size
)

Make an owned clone of the input.

Public function Const

const void &...

 

GetData()

Public function

void *

 

GetData()

Returns a pointer to the start of the buffer.

Public function Const

uint64

 

GetSize()

Returns the size of the buffer in bytes.

Public function Const

FMemoryView

 

GetView()

Public function

FMutableMemo...

 

GetView()

Returns a view of the buffer.

Public function Const

bool

 

IsMaterialized()

Returns true if the referenced buffer has been materialized.

Public function Const

bool

 

IsNull()

Returns true if this does not point to a buffer owner.

Public function Const

bool

 

IsOwned()

Returns true if this keeps the referenced buffer alive.

Public function

FUniqueBuffe...

 

MakeOwned()

Returns a buffer that is owned, by cloning if not owned.

Public function Static

FUniqueBuffe...

 

MakeView

(
    FMutableMemoryView View
)

Make a non-owned view of the input.

Public function Static

FUniqueBuffe...

 

MakeView

(
    void* Data,
    uint64 Size
)

Make a non-owned view of the input.

Public function Const

void

 

Materialize()

Materialize the buffer by making its data and size available.

Public function

FSharedBuffe...

 

MoveToShared()

Convert this to an immutable shared buffer, leaving this null.

Public function

void

 

Reset()

Reset this to null.

Public function Static

FUniqueBuffe...

 

TakeOwnership

(
    void* Data,
    uint64 Size,
    DeleteFunctionType&& DeleteFunctio...
)

Make an owned buffer by taking ownership of the input.

Public function Static

FUniqueBuffe...

 

TakeOwnership

(
    void* Data,
    uint64 Size,
    DeleteFunctionType&& DeleteFunctio...
)

Make an owned buffer by taking ownership of the input.

Operators

Name Description

Public function Const

 

operator bool()

Returns true if this points to a buffer owner.

Public function Const

 

operator FMemoryView()

Public function

 

operator FMutableMemoryView()

Public function

FUniqueBuffe...

 

operator=

(
    FUniqueBuffer&&
)

Public function

FUniqueBuffe...

 

operator=

(
    const FUniqueBuffer&
)

Typedefs

Name

Description

FOwnerPtrType

See Also