Navigation
Unreal Engine C++ API Reference > Runtime > Core > Memory
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Memory/MemoryFwd.h |
Include | #include "Memory/MemoryFwd.h" |
Syntax
template<typename DataType>
class TMemoryView
Remarks
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.
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
constexpr | TMemoryView () |
Construct an empty view. |
![]() |
constexpr | TMemoryView
(
const TMemoryView< OtherDataType >& InView |
Construct a view of by copying a view with compatible const/volatile qualifiers. |
![]() |
constexpr | TMemoryView
(
DataType* InData, |
Construct a view of InSize bytes starting at InData. |
![]() |
TMemoryView
(
DataType* InData, |
Construct a view starting at InData and ending at InDataEnd. |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
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. |
![]() ![]() |
bool | Contains
(
const TMemoryView< OtherDataType >& InView |
Returns whether this view fully contains the other view. |
![]() ![]() |
TMemoryView | CopyFrom
(
FMemoryView InView |
Copies bytes from the input view into this view, and returns the remainder of this view. |
![]() ![]() |
bool | EqualBytes
(
const TMemoryView< OtherDataType >& InView |
Returns whether the bytes of this views are equal to the bytes of the other view. |
![]() ![]() |
constexpr bool | Equals
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are equal. |
![]() ![]() |
constexpr DataType * | GetData () |
Returns a pointer to the start of the view. |
![]() ![]() |
DataType * | GetDataEnd () |
Returns a pointer to the end of the view. |
![]() ![]() |
constexpr uint64 | GetSize () |
Returns the number of bytes in the view. |
![]() ![]() |
bool | Intersects
(
const TMemoryView< OtherDataType >& InView |
Returns whether this view intersects the other view. |
![]() ![]() |
constexpr bool | IsEmpty () |
Returns whether the view has a size of 0 regardless of its data pointer. |
![]() ![]() |
constexpr TMemoryView | Left
(
uint64 InSize |
Returns the left-most part of the view by taking the given number of bytes from the left. |
![]() ![]() |
constexpr TMemoryView | LeftChop
(
uint64 InSize |
Returns the left-most part of the view by chopping the given number of bytes from the right. |
![]() |
constexpr void | LeftChopInline
(
uint64 InSize |
Modifies the view by chopping the given number of bytes from the right. |
![]() |
constexpr void | LeftInline
(
uint64 InSize |
Modifies the view to be the given number of bytes from the left. |
![]() ![]() |
TMemoryView | Mid
(
uint64 InOffset, |
Returns the middle part of the view by taking up to the given number of bytes from the given position. |
![]() |
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. |
![]() |
constexpr void | Reset () |
Resets to an empty view. |
![]() ![]() |
TMemoryView | Right
(
uint64 InSize |
Returns the right-most part of the view by taking the given number of bytes from the right. |
![]() ![]() |
TMemoryView | RightChop
(
uint64 InSize |
Returns the right-most part of the view by chopping the given number of bytes from the left. |
![]() |
void | RightChopInline
(
uint64 InSize |
Modifies the view by chopping the given number of bytes from the left. |
![]() |
void | RightInline
(
uint64 InSize |
Modifies the view to be the given number of bytes from the right. |
Operators
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
constexpr bool | operator!=
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are not equal. |
![]() |
constexpr TMemoryView & | operator+=
(
uint64 InOffset |
Advances the start of the view by an offset, which is clamped to stay within the view. |
![]() ![]() |
constexpr bool | operator==
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are equal. |
Typedefs
Name | Description |
---|---|
ByteType |