UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TMemoryView< DataType > Class Template Reference

#include <MemoryView.h>

Public Member Functions

constexpr TMemoryView ()=default
 
template<typename OtherDataType >
constexpr TMemoryView (const TMemoryView< OtherDataType > &InView)
 
constexpr TMemoryView (DataType *InData, uint64 InSize)
 
template<typename DataEndType >
 TMemoryView (DataType *InData, DataEndType *InDataEnd)
 
constexpr DataType * GetData () const
 
DataType * GetDataEnd () const
 
constexpr uint64 GetSize () const
 
constexpr bool IsEmpty () const
 
constexpr void Reset ()
 
constexpr TMemoryView Left (uint64 InSize) const
 
constexpr TMemoryView LeftChop (uint64 InSize) const
 
TMemoryView Right (uint64 InSize) const
 
TMemoryView RightChop (uint64 InSize) const
 
TMemoryView Mid (uint64 InOffset, uint64 InSize=TNumericLimits< uint64 >::Max()) const
 
constexpr void LeftInline (uint64 InSize)
 
constexpr void LeftChopInline (uint64 InSize)
 
void RightInline (uint64 InSize)
 
void RightChopInline (uint64 InSize)
 
void MidInline (uint64 InOffset, uint64 InSize=TNumericLimits< uint64 >::Max())
 
template<typename OtherDataType >
bool Contains (const TMemoryView< OtherDataType > &InView) const
 
template<typename OtherDataType >
bool Intersects (const TMemoryView< OtherDataType > &InView) const
 
template<typename OtherDataType >
int32 CompareBytes (const TMemoryView< OtherDataType > &InView) const
 
template<typename OtherDataType >
bool EqualBytes (const TMemoryView< OtherDataType > &InView) const
 
template<typename OtherDataType >
constexpr bool Equals (const TMemoryView< OtherDataType > &InView) const
 
template<typename OtherDataType >
constexpr bool operator== (const TMemoryView< OtherDataType > &InView) const
 
template<typename OtherDataType >
constexpr bool operator!= (const TMemoryView< OtherDataType > &InView) const
 
constexpr TMemoryViewoperator+= (uint64 InOffset)
 
TMemoryView CopyFrom (FMemoryView InView) const
 

Friends

template<typename OtherDataType >
class TMemoryView
 

Detailed Description

template<typename DataType>
class TMemoryView< DataType >

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.

Constructor & Destructor Documentation

◆ TMemoryView() [1/4]

template<typename DataType >
constexpr TMemoryView< DataType >::TMemoryView ( )
constexprdefault

Construct an empty view.

◆ TMemoryView() [2/4]

template<typename DataType >
template<typename OtherDataType >
constexpr TMemoryView< DataType >::TMemoryView ( const TMemoryView< OtherDataType > &  InView)
inlineconstexpr

Construct a view of by copying a view with compatible const/volatile qualifiers.

◆ TMemoryView() [3/4]

template<typename DataType >
constexpr TMemoryView< DataType >::TMemoryView ( DataType *  InData,
uint64  InSize 
)
inlineconstexpr

Construct a view of InSize bytes starting at InData.

◆ TMemoryView() [4/4]

template<typename DataType >
template<typename DataEndType >
TMemoryView< DataType >::TMemoryView ( DataType *  InData,
DataEndType InDataEnd 
)
inline

Construct a view starting at InData and ending at InDataEnd.

Member Function Documentation

◆ CompareBytes()

template<typename DataType >
template<typename OtherDataType >
int32 TMemoryView< DataType >::CompareBytes ( const TMemoryView< OtherDataType > &  InView) const
inline

Returns whether the bytes of this view are equal or less/greater than the bytes of the other view.

◆ Contains()

template<typename DataType >
template<typename OtherDataType >
bool TMemoryView< DataType >::Contains ( const TMemoryView< OtherDataType > &  InView) const
inline

Returns whether this view fully contains the other view.

◆ CopyFrom()

template<typename DataType >
TMemoryView TMemoryView< DataType >::CopyFrom ( FMemoryView  InView) const
inline

Copies bytes from the input view into this view, and returns the remainder of this view.

◆ EqualBytes()

template<typename DataType >
template<typename OtherDataType >
bool TMemoryView< DataType >::EqualBytes ( const TMemoryView< OtherDataType > &  InView) const
inline

Returns whether the bytes of this views are equal to the bytes of the other view.

◆ Equals()

template<typename DataType >
template<typename OtherDataType >
constexpr bool TMemoryView< DataType >::Equals ( const TMemoryView< OtherDataType > &  InView) const
inlineconstexpr

Returns whether the data pointers and sizes of this view and the other view are equal.

◆ GetData()

template<typename DataType >
constexpr DataType * TMemoryView< DataType >::GetData ( ) const
inlineconstexpr

Returns a pointer to the start of the view.

◆ GetDataEnd()

template<typename DataType >
DataType * TMemoryView< DataType >::GetDataEnd ( ) const
inline

Returns a pointer to the end of the view.

◆ GetSize()

template<typename DataType >
constexpr uint64 TMemoryView< DataType >::GetSize ( ) const
inlineconstexpr

Returns the number of bytes in the view.

◆ Intersects()

template<typename DataType >
template<typename OtherDataType >
bool TMemoryView< DataType >::Intersects ( const TMemoryView< OtherDataType > &  InView) const
inline

Returns whether this view intersects the other view.

◆ IsEmpty()

template<typename DataType >
constexpr bool TMemoryView< DataType >::IsEmpty ( ) const
inlineconstexpr

Returns whether the view has a size of 0 regardless of its data pointer.

◆ Left()

template<typename DataType >
constexpr TMemoryView TMemoryView< DataType >::Left ( uint64  InSize) const
inlineconstexpr

Returns the left-most part of the view by taking the given number of bytes from the left.

◆ LeftChop()

template<typename DataType >
constexpr TMemoryView TMemoryView< DataType >::LeftChop ( uint64  InSize) const
inlineconstexpr

Returns the left-most part of the view by chopping the given number of bytes from the right.

◆ LeftChopInline()

template<typename DataType >
constexpr void TMemoryView< DataType >::LeftChopInline ( uint64  InSize)
inlineconstexpr

Modifies the view by chopping the given number of bytes from the right.

◆ LeftInline()

template<typename DataType >
constexpr void TMemoryView< DataType >::LeftInline ( uint64  InSize)
inlineconstexpr

Modifies the view to be the given number of bytes from the left.

◆ Mid()

template<typename DataType >
TMemoryView TMemoryView< DataType >::Mid ( uint64  InOffset,
uint64  InSize = TNumericLimits<uint64>::Max() 
) const
inline

Returns the middle part of the view by taking up to the given number of bytes from the given position.

◆ MidInline()

template<typename DataType >
void TMemoryView< DataType >::MidInline ( uint64  InOffset,
uint64  InSize = TNumericLimits<uint64>::Max() 
)
inline

Modifies the view to be the middle part by taking up to the given number of bytes from the given offset.

◆ operator!=()

template<typename DataType >
template<typename OtherDataType >
constexpr bool TMemoryView< DataType >::operator!= ( const TMemoryView< OtherDataType > &  InView) const
inlineconstexpr

Returns whether the data pointers and sizes of this view and the other view are not equal.

◆ operator+=()

template<typename DataType >
constexpr TMemoryView & TMemoryView< DataType >::operator+= ( uint64  InOffset)
inlineconstexpr

Advances the start of the view by an offset, which is clamped to stay within the view.

◆ operator==()

template<typename DataType >
template<typename OtherDataType >
constexpr bool TMemoryView< DataType >::operator== ( const TMemoryView< OtherDataType > &  InView) const
inlineconstexpr

Returns whether the data pointers and sizes of this view and the other view are equal.

◆ Reset()

template<typename DataType >
constexpr void TMemoryView< DataType >::Reset ( )
inlineconstexpr

Resets to an empty view.

◆ Right()

template<typename DataType >
TMemoryView TMemoryView< DataType >::Right ( uint64  InSize) const
inline

Returns the right-most part of the view by taking the given number of bytes from the right.

◆ RightChop()

template<typename DataType >
TMemoryView TMemoryView< DataType >::RightChop ( uint64  InSize) const
inline

Returns the right-most part of the view by chopping the given number of bytes from the left.

◆ RightChopInline()

template<typename DataType >
void TMemoryView< DataType >::RightChopInline ( uint64  InSize)
inline

Modifies the view by chopping the given number of bytes from the left.

◆ RightInline()

template<typename DataType >
void TMemoryView< DataType >::RightInline ( uint64  InSize)
inline

Modifies the view to be the given number of bytes from the right.

Friends And Related Symbol Documentation

◆ TMemoryView

template<typename DataType >
template<typename OtherDataType >
friend class TMemoryView
friend

The documentation for this class was generated from the following files: