Navigation
API > API/Runtime > API/Runtime/Core
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().
| Name | FUniqueBuffer |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Memory/SharedBuffer.h |
| Include Path | #include "Memory/SharedBuffer.h" |
Syntax
class FUniqueBuffer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Construct a null unique buffer. | Memory/SharedBuffer.h | ||
FUniqueBuffer
(
FOwnerPtrType&& SharedOwner |
Memory/SharedBuffer.h | ||
FUniqueBuffer
(
const FUniqueBuffer& |
Memory/SharedBuffer.h | ||
FUniqueBuffer
(
FUniqueBuffer&& |
Memory/SharedBuffer.h | ||
FUniqueBuffer
(
FBufferOwner* Owner |
Construct a unique buffer from a new unreferenced buffer owner. | Memory/SharedBuffer.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOwnerPtrType | UE::SharedBuffer::Private::TBufferOwnerPtr< UE::SharedBuffer::Private::FSharedOps > | Memory/SharedBuffer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Owner | FOwnerPtrType | Memory/SharedBuffer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const void * GetData () |
Memory/SharedBuffer.h | ||
void * GetData () |
Returns a pointer to the start of the buffer. | Memory/SharedBuffer.h | |
uint64 GetSize() |
Returns the size of the buffer in bytes. | Memory/SharedBuffer.h | |
FMemoryView GetView () |
Memory/SharedBuffer.h | ||
FMutableMemoryView GetView () |
Returns a view of the buffer. | Memory/SharedBuffer.h | |
bool IsMaterialized() |
Returns true if the referenced buffer has been materialized. | Memory/SharedBuffer.h | |
bool IsNull () |
Returns true if this does not point to a buffer owner. | Memory/SharedBuffer.h | |
bool IsOwned() |
Returns true if this keeps the referenced buffer alive. | Memory/SharedBuffer.h | |
FUniqueBuffer MakeOwned() |
Returns a buffer that is owned, by cloning if not owned. | Memory/SharedBuffer.h | |
void Materialize () |
Materialize the buffer by making its data and size available. | Memory/SharedBuffer.h | |
| Convert this to an immutable shared buffer, leaving this null. | Memory/SharedBuffer.h | ||
void Reset() |
Reset this to null. | Memory/SharedBuffer.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FUniqueBuffer Alloc
(
uint64 Size |
Make an uninitialized owned buffer of the specified size. | Memory/SharedBuffer.h | |
static FUniqueBuffer AllocZeroed
(
uint64 Size |
Make a zeroed owned buffer of the specified size. | Memory/SharedBuffer.h | |
static FUniqueBuffer Clone
(
const void* Data, |
Memory/SharedBuffer.h | ||
static FUniqueBuffer Clone
(
FMemoryView View |
Make an owned clone of the input. | Memory/SharedBuffer.h | |
static FUniqueBuffer MakeView
(
FMutableMemoryView View |
Make a non-owned view of the input. | Memory/SharedBuffer.h | |
static FUniqueBuffer MakeView
(
void* Data, |
Memory/SharedBuffer.h | ||
static FUniqueBuffer TakeOwnership
(
void* Data, |
Make an owned buffer by taking ownership of the input. | Memory/SharedBuffer.h | |
static FUniqueBuffer TakeOwnership
(
void* Data, |
Make an owned buffer by taking ownership of the input. | Memory/SharedBuffer.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
operator bool() |
Returns true if this points to a buffer owner. | Memory/SharedBuffer.h | |
operator FMemoryView() |
Memory/SharedBuffer.h | ||
operator FMutableMemoryView() |
Memory/SharedBuffer.h | ||
bool operator!=
(
const FUniqueBuffer& BufferB |
Memory/SharedBuffer.h | ||
FUniqueBuffer & operator=
(
FUniqueBuffer&& |
Memory/SharedBuffer.h | ||
FUniqueBuffer & operator=
(
const FUniqueBuffer& |
Memory/SharedBuffer.h | ||
bool operator==
(
const FUniqueBuffer& BufferB |
Memory/SharedBuffer.h |