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

#include <StructArrayView.h>

Classes

struct  FIterator
 

Public Member Functions

 FConstStructArrayView ()=default
 
template<typename T >
 FConstStructArrayView (TArray< T > &InArray)
 
template<typename T >
 FConstStructArrayView (TArrayView< T > InArrayView)
 
 FConstStructArrayView (const FStructArrayView Src)
 
 FConstStructArrayView (const UScriptStruct *InScriptStruct, const void *InData, const uint32 InElementSize, const int32 InCount)
 
 FConstStructArrayView (const UScriptStruct &InScriptStruct, const void *InData, const int32 InCount)
 
FConstStructArrayViewoperator= (const FStructArrayView StructArrayView)
 
void CheckInvariants () const
 
void RangeCheck (int32 Index) const
 
void SliceRangeCheck (int32 Index, int32 InNum) const
 
bool IsValidIndex (int32 Index) const
 
bool IsEmpty () const
 
const voidGetData () const
 
const voidGetDataAt (const int32 Index) const
 
UE_FORCEINLINE_HINT uint32 GetTypeSize ()
 
int32 Num () const
 
const UScriptStructGetScriptStruct () const
 
template<typename T >
requires (std::is_const_v<T>)
constexpr T * GetPtrAt (const int32 Index) const
 
template<typename T >
requires (std::is_const_v<T>)
constexpr T & GetAt (const int32 Index) const
 
FConstStructView operator[] (int32 Index) const
 
template<typename T >
requires (std::is_const_v<T>)
constexpr T & Last (int32 IndexFromTheEnd=0) const
 
FConstStructArrayView Slice (const int32 Index, const int32 InNum) const
 
FConstStructArrayView Left (const int32 Count) const
 
FConstStructArrayView LeftChop (const int32 Count) const
 
FConstStructArrayView Right (const int32 Count) const
 
FConstStructArrayView RightChop (const int32 Count) const
 
FConstStructArrayView 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
 

Detailed Description

A generic, transient view of a homogeneously-typed array of instances of a specific UScriptStruct FConstStructArrayView supplies immutable access to the elements of the Array. For a more indepth overview of the constness of views see FConstStructView

Constructor & Destructor Documentation

◆ FConstStructArrayView() [1/6]

FConstStructArrayView::FConstStructArrayView ( )
default

◆ FConstStructArrayView() [2/6]

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

◆ FConstStructArrayView() [3/6]

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

◆ FConstStructArrayView() [4/6]

FConstStructArrayView::FConstStructArrayView ( const FStructArrayView  Src)
inline

◆ FConstStructArrayView() [5/6]

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

◆ FConstStructArrayView() [6/6]

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

Member Function Documentation

◆ begin()

UE_FORCEINLINE_HINT FIterator FConstStructArrayView::begin ( ) const
inline

Ranged iteration support. DO NOT USE DIRECTLY.

◆ CheckInvariants()

void FConstStructArrayView::CheckInvariants ( ) const
inline

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

◆ end()

UE_FORCEINLINE_HINT FIterator FConstStructArrayView::end ( ) const
inline

◆ GetAt()

template<typename T >
requires (std::is_const_v<T>)
constexpr T & FConstStructArrayView::GetAt ( const int32  Index) const
inlineconstexpr

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
const reference to indexed element.

◆ GetData()

const void * FConstStructArrayView::GetData ( ) const
inline

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

Returns
const Pointer to first array entry.

◆ GetDataAt()

const void * FConstStructArrayView::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
const Pointer to entry.

◆ GetPtrAt()

template<typename T >
requires (std::is_const_v<T>)
constexpr T * FConstStructArrayView::GetPtrAt ( const int32  Index) const
inlineconstexpr

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
const pointer to indexed element.

◆ GetScriptStruct()

const UScriptStruct * FConstStructArrayView::GetScriptStruct ( ) const
inline

Returns struct type.

◆ GetTypeSize()

UE_FORCEINLINE_HINT uint32 FConstStructArrayView::GetTypeSize ( )
inline

Helper function returning the size of the inner type.

Returns
Size in bytes of array type.

◆ IsEmpty()

bool FConstStructArrayView::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 FConstStructArrayView::IsValidIndex ( 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 >
requires (std::is_const_v<T>)
constexpr T & FConstStructArrayView::Last ( int32  IndexFromTheEnd = 0) const
inlineconstexpr

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
const reference to n-th last element from the array.

◆ Left()

FConstStructArrayView FConstStructArrayView::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()

FConstStructArrayView FConstStructArrayView::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 FConstStructArrayView::LeftChopInline ( const int32  Count)
inline

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

◆ LeftInline()

void FConstStructArrayView::LeftInline ( const int32  Count)
inline

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

◆ Mid()

FConstStructArrayView FConstStructArrayView::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 FConstStructArrayView::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 FConstStructArrayView::Num ( ) const
inline

Returns number of elements in array.

Returns
Number of elements in array.

◆ operator=()

FConstStructArrayView & FConstStructArrayView::operator= ( const FStructArrayView  StructArrayView)
inline

◆ operator[]()

FConstStructView FConstStructArrayView::operator[] ( int32  Index) const
inline

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

Returns
FConstStructView to indexed element.

◆ RangeCheck()

void FConstStructArrayView::RangeCheck ( int32  Index) const
inline

Checks if index is in array range.

Parameters
IndexIndex to check.

◆ Right()

FConstStructArrayView FConstStructArrayView::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()

FConstStructArrayView FConstStructArrayView::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 FConstStructArrayView::RightChopInline ( const int32  Count)
inline

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

◆ RightInline()

void FConstStructArrayView::RightInline ( const int32  Count)
inline

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

◆ Slice()

FConstStructArrayView FConstStructArrayView::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 FConstStructArrayView::SliceRangeCheck ( int32  Index,
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.

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