Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Memory
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Memory/MemoryView.h |
| Include | #include "Memory/MemoryView.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. | |
| bool | Equals
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are equal. | |
| DataType * | GetData () |
Returns a pointer to the start of the view. | |
| DataType * | GetDataEnd () |
Returns a pointer to the end of the view. | |
| uint64 | GetSize () |
Returns the number of bytes in the view. | |
| bool | Intersects
(
const TMemoryView< OtherDataType >& InView |
Returns whether this view intersects the other view. | |
| bool | IsEmpty () |
Returns whether the view has a size of 0 regardless of its data pointer. | |
| TMemoryView | Returns the left-most part of the view by taking the given number of bytes from the left. | ||
| TMemoryView | Returns the left-most part of the view by chopping the given number of bytes from the right. | ||
| void | LeftChopInline
(
uint64 InSize |
Modifies the view by chopping the given number of bytes from the right. | |
| void | LeftInline
(
uint64 InSize |
Modifies the view to be the given number of bytes from the left. | |
| TMemoryView | Returns the middle part of the view by taking up to the given number of bytes from the given position. | ||
| void | Modifies the view to be the middle part by taking up to the given number of bytes from the given offset. | ||
| void | Reset () |
Resets to an empty view. | |
| TMemoryView | Returns the right-most part of the view by taking the given number of bytes from the right. | ||
| TMemoryView | 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 | |
|---|---|---|---|
| bool | operator!=
(
const TMemoryView< OtherDataType >& InView |
Returns whether the data pointers and sizes of this view and the other view are not equal. | |
| TMemoryView & | operator+=
(
uint64 InOffset |
Advances the start of the view by an offset, which is clamped to stay within the view. | |
| 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 |