Navigation
API > API/Plugins > API/Plugins/StructUtils
References
| Module | StructUtils |
| Header | /Engine/Plugins/Experimental/StructUtils/Source/StructUtils/Public/StructArrayView.h |
| Include | #include "StructArrayView.h" |
Syntax
struct FStructArrayView
Remarks
A generic, transient view of a homogeneously-typed array of instances of a specific UScriptStructFStructArrayView 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
Constructors
| Type | Name | Description | |
|---|---|---|---|
FStructArrayView
(
TArray< T >& InArray |
|||
FStructArrayView
(
TArrayView< T > InArrayView |
|||
FStructArrayView
(
const UScriptStruct& InScriptStruct, |
|||
FStructArrayView
(
const UScriptStruct* InScriptStruct, |
Use constructor that takes a reference instead | ||
FStructArrayView
(
const UScriptStruct* InScriptStruct, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FIterator | begin () |
Ranged iteration support. DO NOT USE DIRECTLY. | |
| void | Checks array invariants: if array size is greater than or equal to zero. | ||
| FIterator | end () |
||
| T & | GetAt
(
const int32 Index |
Returns reference to element at given index. | |
| void * | GetData () |
Helper function for returning a pointer to the first array element. | |
| void * | GetDataAt
(
const int32 Index |
Helper function for returning a pointer to an element in the array. | |
| T * | GetPtrAt
(
const int32 Index |
Returns pointer to element at given index. | |
| const UScriptStruct * | Returns struct type. | ||
| uint32 | GetTypeSize () |
Helper function returning the size of the inner type. | |
| bool | IsEmpty () |
Returns true if the array is empty and contains no elements. | |
| bool | IsValidIndex
(
const int32 Index |
Tests if index is valid, i.e. greater than or equal to zero, and less than the number of elements in the array. | |
| T & | Last
(
const int32 IndexFromTheEnd |
Returns n-th last element from the array. | |
| FStructArrayView | Left
(
const int32 Count |
Returns the left-most part of the view by taking the given number of elements from the left. | |
| FStructArrayView | LeftChop
(
const int32 Count |
Returns the left-most part of the view by chopping the given number of elements from the right. | |
| void | LeftChopInline
(
const int32 Count |
Modifies the view by chopping the given number of elements from the right. | |
| void | LeftInline
(
const int32 Count |
Modifies the view to be the given number of elements from the left. | |
| FStructArrayView | Mid
(
int32 Index, |
Returns the middle part of the view by taking up to the given number of elements from the given position. | |
| void | MidInline
(
const int32 Position, |
Modifies the view to be the middle part by taking up to the given number of elements from the given position. | |
| int32 | Num () |
Returns number of elements in array. | |
| void | RangeCheck
(
int32 Index |
Checks if index is in array range. | |
| FStructArrayView | Right
(
const int32 Count |
Returns the right-most part of the view by taking the given number of elements from the right. | |
| FStructArrayView | RightChop
(
const int32 Count |
Returns the right-most part of the view by chopping the given number of elements from the left. | |
| void | RightChopInline
(
const int32 Count |
Modifies the view by chopping the given number of elements from the left. | |
| void | RightInline
(
const int32 Count |
Modifies the view to be the given number of elements from the right. | |
| FStructArrayView | Slice
(
const int32 Index, |
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. | |
| void | SliceRangeCheck
(
const int32 Index, |
Checks if a slice range [Index, Index+InNum) is in array range. | |
| void | Swap
(
const int32 Index1, |
Swaps the elements at the specified Indicies. The indicies must be valid! |
Operators
| Type | Name | Description | |
|---|---|---|---|
| FStructView | operator[]
(
const int32 Index |
Array bracket operator. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FIterator |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
FStructArrayView
(
const UScriptStruct* InScriptStruct, |
Use constructor that takes a reference instead | ||
| const T & | GetElementAt
(
const int32 Index |
Use GetAt() instead! | |
| const T & | GetElementAtChecked
(
const int32 Index |
Use GetAt() instead! | |
| SIZE_T | Removed to bring in to line with ArrayView, use GetTypeSize() instead | ||
| const UScriptStruct & | Use GetScriptStruct() instead | ||
| const UScriptStruct & | Use GetScriptStruct() instead | ||
| void * | GetMutableDataAt
(
const int32 Index |
Use GetDataAt() instead | |
| T & | GetMutableElementAt
(
const int32 Index |
Use GetAt() instead! | |
| T & | GetMutableElementAtChecked
(
const int32 Index |
Use GetAt() instead! |