Navigation
API > API/Runtime > API/Runtime/Core
A non-owning view of a contiguous region of memory.
Prefer to use the aliases FMemoryView or FMutableMemoryView over this type.
Functions that modify a view clamp sizes and offsets to always return a sub-view of the input.
| Name | TMemoryView |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Memory/MemoryView.h |
| Include Path | #include "Memory/MemoryView.h" |
Syntax
template<typename DataType>
class TMemoryView
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
constexpr TMemoryView () |
Construct an empty view. | Memory/MemoryView.h | |
constexpr TMemoryView
(
const TMemoryView< OtherDataType >& InView |
Construct a view of by copying a view with compatible const/volatile qualifiers. | Memory/MemoryView.h | |
constexpr TMemoryView
(
DataType* InData, |
Construct a view of InSize bytes starting at InData. | Memory/MemoryView.h | |
TMemoryView
(
DataType* InData, |
Construct a view starting at InData and ending at InDataEnd. | Memory/MemoryView.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ByteType | std::conditional_t< std::is_const_v< DataType >, const uint8, uint8 > | Memory/MemoryView.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Data | DataType * | Memory/MemoryView.h | ||
| Size | uint64 | Memory/MemoryView.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 CompareBytes
(
const TMemoryView< OtherDataType >& InView |
Returns whether the bytes of this view are equal or less/greater than the bytes of the other view. | Memory/MemoryView.h | |
bool Contains
(
const TMemoryView< OtherDataType >& InView |
Returns whether this view fully contains the other view. | Memory/MemoryView.h | |
TMemoryView CopyFrom
(
FMemoryView InView |
Copies bytes from the input view into this view, and returns the remainder of this view. | Memory/MemoryView.h | |
bool EqualBytes
(
const TMemoryView< OtherDataType >& InView |
Returns whether the bytes of this views are equal to the bytes of the other view. | Memory/MemoryView.h | |
bool Equals
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are equal. | Memory/MemoryView.h | |
DataType * GetData() |
Returns a pointer to the start of the view. | Memory/MemoryView.h | |
DataType * GetDataEnd() |
Returns a pointer to the end of the view. | Memory/MemoryView.h | |
uint64 GetSize() |
Returns the number of bytes in the view. | Memory/MemoryView.h | |
bool Intersects
(
const TMemoryView< OtherDataType >& InView |
Returns whether this view intersects the other view. | Memory/MemoryView.h | |
bool IsEmpty() |
Returns whether the view has a size of 0 regardless of its data pointer. | Memory/MemoryView.h | |
TMemoryView Left
(
uint64 InSize |
Returns the left-most part of the view by taking the given number of bytes from the left. | Memory/MemoryView.h | |
TMemoryView LeftChop
(
uint64 InSize |
Returns the left-most part of the view by chopping the given number of bytes from the right. | Memory/MemoryView.h | |
void LeftChopInline
(
uint64 InSize |
Modifies the view by chopping the given number of bytes from the right. | Memory/MemoryView.h | |
void LeftInline
(
uint64 InSize |
Modifies the view to be the given number of bytes from the left. | Memory/MemoryView.h | |
TMemoryView Mid
(
uint64 InOffset, |
Returns the middle part of the view by taking up to the given number of bytes from the given position. | Memory/MemoryView.h | |
void MidInline
(
uint64 InOffset, |
Modifies the view to be the middle part by taking up to the given number of bytes from the given offset. | Memory/MemoryView.h | |
void Reset() |
Resets to an empty view. | Memory/MemoryView.h | |
TMemoryView Right
(
uint64 InSize |
Returns the right-most part of the view by taking the given number of bytes from the right. | Memory/MemoryView.h | |
TMemoryView RightChop
(
uint64 InSize |
Returns the right-most part of the view by chopping the given number of bytes from the left. | Memory/MemoryView.h | |
void RightChopInline
(
uint64 InSize |
Modifies the view by chopping the given number of bytes from the left. | Memory/MemoryView.h | |
void RightInline
(
uint64 InSize |
Modifies the view to be the given number of bytes from the right. | Memory/MemoryView.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are not equal. | Memory/MemoryView.h | |
TMemoryView & operator+=
(
uint64 InOffset |
Advances the start of the view by an offset, which is clamped to stay within the view. | Memory/MemoryView.h | |
bool operator==
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are equal. | Memory/MemoryView.h |