Apparatus
Version 1.23
ECS data-oriented workflow for Unreal Engine.
|
Dynamically-typed container of structs. More...
#include <ScriptStructArray.h>
Public Types | |
enum | EGatheringType { Clear , Collect } |
The type of gathering to use during the collection. More... | |
Public Member Functions | |
UScriptStruct * | GetElementType () const |
Get the type of the elements in the array. | |
int32 | GetElementSize () const |
Get the size of a single element. | |
int32 | Num () const |
Get the current number of elements currently in the array. | |
int32 | Max () const |
Get the maximum number of elements that can be stored in the array without any additional allocations. | |
void * | At (const int32 Index) |
Get an element data at specified index. | |
const void * | At (const int32 Index) const |
Get an element data at specified index. | |
template<typename T > | |
T & | RefAt (const int32 Index) |
Get an element reference at a specific index. | |
template<typename T > | |
const T & | RefAt (const int32 Index) const |
Get an element reference at a specific index. | |
template<typename T > | |
T * | PtrAt (const int32 Index) |
Get an element reference at a specific index. | |
template<typename T > | |
const T * | PtrAt (const int32 Index) const |
Get an element reference at a specific index. | |
void * | operator[] (const int32 Index) |
Get an element data at specified index. | |
const void * | operator[] (const int32 Index) const |
Get a read-only element data at specified index. | |
bool | Reserve (const int32 InCapacity) |
Reserve the space for a certain amount of elements. | |
void * | AppendDefaulted () |
Append a new struct element with default-initialized value. | |
void * | AppendDefaulted (const int32 InCount) |
Append several new struct elements with default-initialized values. | |
void | Reset (const int32 InCapacity=0) |
Clear the array without changing the allocated space, but only if the passed capacity is not larger than the present one. | |
void | Pop (const int32 InCount=1, const bool bAllowShrinking=true) |
Remove the elements from the end of the container. | |
void | Set (UScriptStruct *const InElementType, const int32 InCapacity=0) |
Set the container with an element type and a capacity. | |
void | Set (const FScriptStructArray &Array) |
FScriptStructArray () | |
FScriptStructArray (UScriptStruct *InElementType, int32 InCapacity=0) | |
FScriptStructArray (const FScriptStructArray &Array) | |
FScriptStructArray (FScriptStructArray &&Array) | |
Construct with moving an array. | |
~FScriptStructArray () | |
EApparatusStatus | ElementAt (const int32 ElementIndex, void *const OutData, const bool bDataInitialized=true) const |
Copy an element at a specific index to a struct data. | |
EApparatusStatus | SwapElementWith (const int32 ElementIndex, void *const OtherData, const bool bDataInitialized=true) |
Swap an element at a specific index to a struct data. | |
template<typename T > | |
EApparatusStatus | ElementAt (const int32 ElementIndex, T &OutStruct, const bool bStructInitialized=true) const |
Copies an element at a specific index to a struct. | |
template<typename T , typename AllocatorT > | |
EApparatusStatus | CopyTo (TArray< T, AllocatorT > &OutArray, const EGatheringType GatheringType=Clear) const |
Copy the elements of the array to a normal array. | |
template<typename T > | |
T | ElementAt (const int32 ElementIndex) const |
Gets a copy of an element at a specific index returning it to the caller. | |
EApparatusStatus | SetElementAt (const int32 ElementIndex, const void *const InData) |
Sets an element at a specific index to an initialized struct data. | |
template<typename T > | |
EApparatusStatus | SetElementAt (const int32 ElementIndex, const T &InElement) |
Sets an element at a specific index to an initialized struct data. | |
template<typename T > | |
EApparatusStatus | SetElementAt (const int32 ElementIndex, const T *const InElement) |
Sets an element at a specific index to an initialized struct data. | |
void | Swap (const int32 FirstIndexToSwap, const int32 SecondIndexToSwap) |
Swap two elements in the array. | |
void | ClearElementAt (const int32 ElementIndex) |
Clear an element at a specific index by finalizing and initializing it again. | |
int32 | CloneElementAt (const int32 ElementIndex) |
Clone an element at a specified index. | |
FScriptStructArray & | operator= (FScriptStructArray &&Array) |
Move an array. | |
FScriptStructArray & | operator= (const FScriptStructArray &Array) |
Set the array equal to an another one. | |
Dynamically-typed container of structs.
Unlike TArray<T> which is statically (compile-time) typed you can use this container with a runtime-defined struct type to store an array of those.
|
inline |
|
inline |
|
inline |
|
inline |
Construct with moving an array.
|
inline |
|
inline |
Append a new struct element with default-initialized value.
|
inline |
Append several new struct elements with default-initialized values.
InCount | The total number of elements to append. |
|
inline |
Get an element data at specified index.
Index | The index of an element to get the data of. |
|
inline |
Get an element data at specified index.
Constant version.
Index | The index of an element to get the data of. |
|
inline |
Clear an element at a specific index by finalizing and initializing it again.
ElementIndex | The index of an element to clear. |
|
inline |
Clone an element at a specified index.
ElementIndex | The index of an element to clone. |
|
inline |
Copy the elements of the array to a normal array.
T | The type of elements of the array. Must match the current element type. |
AllocatorT | The allocator used within an array. |
OutArray | The array to output the structs to. |
GatheringType | The type of gathering to apply. |
Gets a copy of an element at a specific index returning it to the caller.
T | The type of the element to copy. Must match the type of the array elements. |
ElementIndex | The index of an element to copy. |
|
inline |
Copies an element at a specific index to a struct.
Templated version.
T | The type of the element to copy. Must match the type of the array elements. |
ElementIndex | The index of an element to copy. |
OutStruct | A receiving struct. |
bStructInitialized | Is the receiving struct actually initialized? |
|
inline |
Copy an element at a specific index to a struct data.
ElementIndex | The index of an element to copy. |
OutData | A receiving struct data pointer. Must have enough allocated space. |
bDataInitialized | Is the receiving data actually initialized? |
|
inline |
Get the size of a single element.
|
inline |
Get the type of the elements in the array.
|
inline |
Get the maximum number of elements that can be stored in the array without any additional allocations.
|
inline |
Get the current number of elements currently in the array.
|
inline |
Set the array equal to an another one.
Array | An array to copy. |
|
inline |
Move an array.
|
inline |
Get an element data at specified index.
Index | The index of an element to get the data of. |
|
inline |
Get a read-only element data at specified index.
Index | The index of an element to get the data of. |
|
inline |
Remove the elements from the end of the container.
InCount | The number of elements to remove. |
bAllowShrinking | Is capacity shrinking allowed? |
Get an element reference at a specific index.
T | The type of the element to cast to. Used for extra safety. |
Index | The index of an element to get the data of. |
Get an element reference at a specific index.
Constant version.
T | The type of the element to cast to. Used for extra safety. |
Index | The index of an element to get the data of. |
Get an element reference at a specific index.
T | The type of the element to cast to. Used for extra safety. |
Index | The index of an element to get the data of. |
Get an element reference at a specific index.
Constant version.
T | The type of the element to cast to. Used for extra safety. |
Index | The index of an element to get the data of. |
|
inline |
Reserve the space for a certain amount of elements.
InCapacity | The new capacity to guarantee. |
|
inline |
Clear the array without changing the allocated space, but only if the passed capacity is not larger than the present one.
InCapacity | The new capacity to guarantee. |
|
inline |
|
inline |
Set the container with an element type and a capacity.
InElementType | The new element type. |
InCapacity | The new capacity to guarantee. |
|
inline |
Sets an element at a specific index to an initialized struct data.
T | The type of the element to set. Must match the element type of the array. |
[in] | ElementIndex | The index of an element to set. |
[in] | InElement | An initialized struct data to set with. |
|
inline |
Sets an element at a specific index to an initialized struct data.
T | The type of the element to set. Must match the element type of the array. |
[in] | ElementIndex | The index of an element to set. |
[in] | InElement | An initialized struct data to set with. |
|
inline |
Sets an element at a specific index to an initialized struct data.
[in] | ElementIndex | The index of an element to set. |
[in] | InData | An initialized struct data to set with. |
|
inline |
Swap two elements in the array.
|
inline |
Swap an element at a specific index to a struct data.
ElementIndex | The index of the element to swap. |
OtherData | The other struct data pointer. Must have enough allocated space. |
bDataInitialized | Is the receiving data actually initialized? |