UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FStructArrayView Struct Reference

#include <StructArrayView.h>

Classes

struct  FIterator
 

Public Member Functions

 FStructArrayView ()=default
 
template<typename T >
 FStructArrayView (TArray< T > &InArray)
 
template<typename T >
 FStructArrayView (TArrayView< T > InArrayView)
 
 FStructArrayView (const UScriptStruct *InScriptStruct, void *InData, const uint32 InElementSize, const int32 InCount)
 
 FStructArrayView (const UScriptStruct &InScriptStruct, void *InData, const int32 InCount)
 
 FStructArrayView (const UScriptStruct *InScriptStruct, void *InData, const int32 InCount)
 
void CheckInvariants () const
 
void RangeCheck (int32 Index) const
 
void SliceRangeCheck (const int32 Index, const int32 InNum) const
 
bool IsValidIndex (const int32 Index) const
 
bool IsEmpty () const
 
voidGetData () const
 
voidGetDataAt (const int32 Index) const
 
voidGetMutableDataAt (const int32 Index) const
 
UE_FORCEINLINE_HINT uint32 GetTypeSize () const
 
SIZE_T GetElementSize () const
 
int32 Num () const
 
const UScriptStructGetElementType () const
 
const UScriptStructGetFragmentType () const
 
const UScriptStructGetScriptStruct () const
 
template<typename T >
T * GetPtrAt (const int32 Index) const
 
template<typename T >
T & GetAt (const int32 Index) const
 
template<typename T >
const T & GetElementAt (const int32 Index) const
 
template<typename T >
const T & GetElementAtChecked (const int32 Index) const
 
template<typename T >
T & GetMutableElementAt (const int32 Index) const
 
template<typename T >
T & GetMutableElementAtChecked (const int32 Index) const
 
FStructView operator[] (const int32 Index) const
 
template<typename T >
T & Last (const int32 IndexFromTheEnd=0) const
 
FStructArrayView Slice (const int32 Index, const int32 InNum) const
 
FStructArrayView Left (const int32 Count) const
 
FStructArrayView LeftChop (const int32 Count) const
 
FStructArrayView Right (const int32 Count) const
 
FStructArrayView RightChop (const int32 Count) const
 
FStructArrayView Mid (int32 Index, int32 Count=TNumericLimits< int32 >::Max()) const
 
void LeftInline (const int32 Count)
 
void LeftChopInline (const int32 Count)
 
void RightInline (const int32 Count)
 
void RightChopInline (const int32 Count)
 
void MidInline (const int32 Position, const int32 Count=TNumericLimits< int32 >::Max())
 
UE_FORCEINLINE_HINT FIterator begin () const
 
UE_FORCEINLINE_HINT FIterator end () const
 
UE_FORCEINLINE_HINT void Swap (const int32 Index1, const int32 Index2)
 

Detailed Description

A generic, transient view of a homogeneously-typed array of instances of a specific UScriptStruct FStructArrayView supplies mutable access to the elements of the Array. Note const FStructArrayView only what the view is pointing to can not be modified the actual struct data is still mutable. For a more indepth overview of the constness of views see FConstStructView

Constructor & Destructor Documentation

◆ FStructArrayView() [1/6]

FStructArrayView::FStructArrayView ( )
default

◆ FStructArrayView() [2/6]

template<typename T >
FStructArrayView::FStructArrayView ( TArray< T > &  InArray)
inlineexplicit

◆ FStructArrayView() [3/6]

template<typename T >
FStructArrayView::FStructArrayView ( TArrayView< T >  InArrayView)
inlineexplicit

◆ FStructArrayView() [4/6]

FStructArrayView::FStructArrayView ( const UScriptStruct InScriptStruct,
void InData,
const uint32  InElementSize,
const int32  InCount 
)
inline

◆ FStructArrayView() [5/6]

FStructArrayView::FStructArrayView ( const UScriptStruct InScriptStruct,
void InData,
const int32  InCount 
)
inline

◆ FStructArrayView() [6/6]

FStructArrayView::FStructArrayView ( const UScriptStruct InScriptStruct,
void InData,
const int32  InCount 
)
inline

Member Function Documentation

◆ begin()

UE_FORCEINLINE_HINT FIterator FStructArrayView::begin ( ) const
inline

Ranged iteration support. DO NOT USE DIRECTLY.

◆ CheckInvariants()

void FStructArrayView::CheckInvariants ( ) const
inline

Checks array invariants: if array size is greater than or equal to zero.

◆ end()

UE_FORCEINLINE_HINT FIterator FStructArrayView::end ( ) const
inline

◆ GetAt()

template<typename T >
T & FStructArrayView::GetAt ( const int32  Index) const
inline

Returns reference to element at given index. Index and template param T must be must be valid.

Parameters
IndexIndex of element
TType of stuct, this must either be the type or a parent type of the struct type in the array.
Returns
Reference to indexed element.

◆ GetData()

void * FStructArrayView::GetData ( ) const
inline

Helper function for returning a pointer to the first array element.

Returns
Pointer to first array entry.

◆ GetDataAt()

void * FStructArrayView::GetDataAt ( const int32  Index) const
inline

Helper function for returning a pointer to an element in the array.

Parameters
IndexIndex of element, this MUST be a valid element.
Returns
Pointer to array entry at index.

◆ GetElementAt()

template<typename T >
const T & FStructArrayView::GetElementAt ( const int32  Index) const
inline

◆ GetElementAtChecked()

template<typename T >
const T & FStructArrayView::GetElementAtChecked ( const int32  Index) const
inline

◆ GetElementSize()

SIZE_T FStructArrayView::GetElementSize ( ) const
inline

◆ GetElementType()

const UScriptStruct & FStructArrayView::GetElementType ( ) const
inline

◆ GetFragmentType()

const UScriptStruct & FStructArrayView::GetFragmentType ( ) const
inline

◆ GetMutableDataAt()

void * FStructArrayView::GetMutableDataAt ( const int32  Index) const
inline

◆ GetMutableElementAt()

template<typename T >
T & FStructArrayView::GetMutableElementAt ( const int32  Index) const
inline

◆ GetMutableElementAtChecked()

template<typename T >
T & FStructArrayView::GetMutableElementAtChecked ( const int32  Index) const
inline

◆ GetPtrAt()

template<typename T >
T * FStructArrayView::GetPtrAt ( const int32  Index) const
inline

Returns pointer to element at given index. The index MUST be valid. If parametre T is invalid then nullptr will be returned.

Parameters
IndexIndex of element
TType of stuct, this must either be the type or a parent type of the struct type in the array.
Returns
Pointer to indexed element.

◆ GetScriptStruct()

const UScriptStruct * FStructArrayView::GetScriptStruct ( ) const
inline

Returns struct type.

◆ GetTypeSize()

UE_FORCEINLINE_HINT uint32 FStructArrayView::GetTypeSize ( ) const
inline

Helper function returning the size of the inner type.

Returns
Size in bytes of array type.

◆ IsEmpty()

bool FStructArrayView::IsEmpty ( ) const
inline

Returns true if the array is empty and contains no elements.

Returns
True if array is empty.
See also
Num

◆ IsValidIndex()

bool FStructArrayView::IsValidIndex ( const int32  Index) const
inline

Tests if index is valid, i.e. greater than or equal to zero, and less than the number of elements in the array.

Parameters
IndexIndex to test.
Returns
True if index is valid. False otherwise.

◆ Last()

template<typename T >
T & FStructArrayView::Last ( const int32  IndexFromTheEnd = 0) const
inline

Returns n-th last element from the array.

Parameters
IndexFromTheEnd(Optional) Index from the end of array. This MUST index a valid element. Default is 0.
Returns
Reference to n-th last element from the array.

◆ Left()

FStructArrayView FStructArrayView::Left ( const int32  Count) const
inline

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

◆ LeftChop()

FStructArrayView FStructArrayView::LeftChop ( const int32  Count) const
inline

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

◆ LeftChopInline()

void FStructArrayView::LeftChopInline ( const int32  Count)
inline

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

◆ LeftInline()

void FStructArrayView::LeftInline ( const int32  Count)
inline

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

◆ Mid()

FStructArrayView FStructArrayView::Mid ( int32  Index,
int32  Count = TNumericLimits<int32>::Max() 
) const
inline

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

◆ MidInline()

void FStructArrayView::MidInline ( const int32  Position,
const int32  Count = TNumericLimits<int32>::Max() 
)
inline

Modifies the view to be the middle part by taking up to the given number of elements from the given position.

◆ Num()

int32 FStructArrayView::Num ( ) const
inline

Returns number of elements in array.

Returns
Number of elements in array.

◆ operator[]()

FStructView FStructArrayView::operator[] ( const int32  Index) const
inline

Array bracket operator. Returns FStructView to element at given index. Index must be valid.

Returns
FStructView to indexed element.

◆ RangeCheck()

void FStructArrayView::RangeCheck ( int32  Index) const
inline

Checks if index is in array range.

Parameters
IndexIndex to check.

◆ Right()

FStructArrayView FStructArrayView::Right ( const int32  Count) const
inline

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

◆ RightChop()

FStructArrayView FStructArrayView::RightChop ( const int32  Count) const
inline

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

◆ RightChopInline()

void FStructArrayView::RightChopInline ( const int32  Count)
inline

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

◆ RightInline()

void FStructArrayView::RightInline ( const int32  Count)
inline

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

◆ Slice()

FStructArrayView FStructArrayView::Slice ( const int32  Index,
const int32  InNum 
) const
inline

Returns a sliced view This is similar to Mid(), but with a narrow contract, i.e. slicing outside of the range of the view is illegal.

Parameters
Indexstarting index of the new view
InNumnumber of elements in the new view
Returns
Sliced view
See also
Mid

◆ SliceRangeCheck()

void FStructArrayView::SliceRangeCheck ( const int32  Index,
const int32  InNum 
) const
inline

Checks if a slice range [Index, Index+InNum) is in array range. Length is 0 is allowed on empty arrays; Index must be 0 in that case.

Parameters
IndexStarting index of the slice.
InNumLength of the slice.

◆ Swap()

UE_FORCEINLINE_HINT void FStructArrayView::Swap ( const int32  Index1,
const int32  Index2 
)
inline

Swaps the elements at the specified Indicies. The indicies must be valid!


The documentation for this struct was generated from the following file: