FSharedBuffer

A reference to a shared-ownership immutable 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 FSharedBuffer

Remarks

A reference to a shared-ownership immutable buffer.

Constructors

Name Description

Public function

FSharedBuffer()

Construct a null shared buffer.

Public function

FSharedBuffer

(
    FBufferOwner* Owner
)

Construct a shared buffer from a new unreferenced buffer owner.

Functions

Name Description

Public function Static

FSharedBuffe...

 

Clone

(
    const void* Data,
    uint64 Size
)

Make an owned clone of the input.

Public function Static

FSharedBuffe...

 

Clone

(
    FMemoryView View
)

Make an owned clone of the input.

Public function Const

const 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()

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 Const

FSharedBuffe...

 

MakeOwned()

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

Public function

FSharedBuffe...

 

MakeOwned()

Public function Static

FSharedBuffe...

 

MakeView

(
    FMemoryView View
)

Make a non-owned view of the input.

Public function Static

FSharedBuffe...

 

MakeView

(
    const void* Data,
    uint64 Size
)

Make a non-owned view of the input.

Public function Static

FSharedBuffe...

 

MakeView

(
    FMemoryView View,
    FSharedBuffer&& OuterBuffer
)

Make a view of the input within its outer buffer. Ownership matches OuterBuffer.

Public function Static

FSharedBuffe...

 

MakeView

(
    FMemoryView View,
    const FSharedBuffer& OuterBuffer
)

Make a non-owned view of the input.

Public function Static

FSharedBuffe...

 

MakeView

(
    const void* Data,
    uint64 Size,
    FSharedBuffer&& OuterBuffer
)

Make a non-owned view of the input.

Public function Static

FSharedBuffe...

 

MakeView

(
    const void* Data,
    uint64 Size,
    const FSharedBuffer& OuterBuffer
)

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

FUniqueBuffe...

 

MoveToUnique()

Convert this to a unique buffer, leaving this null.

Public function

void

 

Reset()

Reset this to null.

Public function Static

FSharedBuffe...

 

TakeOwnership

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

Make an owned buffer by taking ownership of the input.

Public function Static

FSharedBuffe...

 

TakeOwnership

(
    const 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()

Typedefs

Name

Description

FOwnerPtrType

FWeakOwnerPtrType

See Also