Apparatus Version 1.3.0
ECS data-driven workflow for Unreal Engine.
Public Member Functions | List of all members
FScriptStructArray Struct Reference

Runtime-safe container for structs. More...

#include <ScriptStructArray.h>

Public Member Functions

UScriptStruct * GetElementType () const
 Get the type of the elements in the array. More...
 
int32 GetElementSize () const
 Get the size of a single element. More...
 
int32 Num () const
 Get the current number of elements in the array. More...
 
int32 Max () const
 Get the maximum number of elements that can be stored in the array without any additional allocations. More...
 
void * At (const int32 Index) const
 Get an element data at specified index. More...
 
void * operator[] (const int32 Index) const
 Get an element data at specified index. More...
 
bool Reserve (const int32 InCapacity)
 Reserve the space for a certain amount of elements. More...
 
void * AppendDefaulted ()
 Append a new struct element with default-initialized value. More...
 
void * AppendDefaulted (const int32 InCount)
 Append several new struct elements with default-initialized values. More...
 
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. More...
 
void Pop (const int32 InCount=1, bool bAllowShrinking=true)
 Remove the elements from the end of the container. More...
 
void Set (UScriptStruct *InElementType, const int32 InCapacity=0)
 Set the container with an element type and a capacity. More...
 
void Set (const FScriptStructArray &Array)
 
 FScriptStructArray ()
 
 FScriptStructArray (UScriptStruct *InElementType, int32 InCapacity=0)
 
 FScriptStructArray (const FScriptStructArray &Array)
 
 FScriptStructArray (FScriptStructArray &&Array)
 Construct with moving an array. More...
 
 ~FScriptStructArray ()
 
EApparatusStatus CopyElementTo (const int32 ElementIndex, void *const OutData, const bool bDataInitialized=true) const
 Copies an element at a specific index to a struct data. More...
 
FScriptStructArrayoperator= (FScriptStructArray &&Array)
 Move an array. More...
 
void SetElementAt (const int32 ElementIndex, const void *const InData)
 Sets an element at a specific index to an initialized struct data. More...
 
void Swap (const int32 FirstIndexToSwap, const int32 SecondIndexToSwap)
 Swap two elements in the array. More...
 
void ClearElementAt (const int32 ElementIndex)
 Clears an element at a specific index by finalizing and initializing it again. More...
 
FScriptStructArrayoperator= (const FScriptStructArray &Array)
 Set the array to an another one. More...
 

Detailed Description

Runtime-safe container for structs.

Constructor & Destructor Documentation

◆ FScriptStructArray() [1/4]

FScriptStructArray::FScriptStructArray ( )
inline

◆ FScriptStructArray() [2/4]

FScriptStructArray::FScriptStructArray ( UScriptStruct *  InElementType,
int32  InCapacity = 0 
)
inline

◆ FScriptStructArray() [3/4]

FScriptStructArray::FScriptStructArray ( const FScriptStructArray Array)
inline

◆ FScriptStructArray() [4/4]

FScriptStructArray::FScriptStructArray ( FScriptStructArray &&  Array)
inline

Construct with moving an array.

◆ ~FScriptStructArray()

FScriptStructArray::~FScriptStructArray ( )
inline

Member Function Documentation

◆ AppendDefaulted() [1/2]

void* FScriptStructArray::AppendDefaulted ( )
inline

Append a new struct element with default-initialized value.

Returns
The data of the added element.

◆ AppendDefaulted() [2/2]

void* FScriptStructArray::AppendDefaulted ( const int32  InCount)
inline

Append several new struct elements with default-initialized values.

Returns
The data of the first added element.

◆ At()

void* FScriptStructArray::At ( const int32  Index) const
inline

Get an element data at specified index.

Parameters
IndexThe index of an element to get the data of.
Returns
The initialized data of the element struct.

◆ ClearElementAt()

void FScriptStructArray::ClearElementAt ( const int32  ElementIndex)
inline

Clears an element at a specific index by finalizing and initializing it again.

Parameters
ElementIndexThe index of an element to clear.

◆ CopyElementTo()

EApparatusStatus FScriptStructArray::CopyElementTo ( const int32  ElementIndex,
void *const  OutData,
const bool  bDataInitialized = true 
) const
inline

Copies an element at a specific index to a struct data.

Parameters
ElementIndexThe index of an element to copy.
OutDataA receiving struct data.
bDataInitializedIs the receiving data actually initialized?
Returns
The status of the operation.

◆ GetElementSize()

int32 FScriptStructArray::GetElementSize ( ) const
inline

Get the size of a single element.

Returns
The size of the element in bytes.

◆ GetElementType()

UScriptStruct* FScriptStructArray::GetElementType ( ) const
inline

Get the type of the elements in the array.

◆ Max()

int32 FScriptStructArray::Max ( ) const
inline

Get the maximum number of elements that can be stored in the array without any additional allocations.

◆ Num()

int32 FScriptStructArray::Num ( ) const
inline

Get the current number of elements in the array.

◆ operator=() [1/2]

FScriptStructArray& FScriptStructArray::operator= ( const FScriptStructArray Array)
inline

Set the array to an another one.

Parameters
ArrayAn array to copy.
Returns
Returns itself.

◆ operator=() [2/2]

FScriptStructArray& FScriptStructArray::operator= ( FScriptStructArray &&  Array)
inline

Move an array.

◆ operator[]()

void* FScriptStructArray::operator[] ( const int32  Index) const
inline

Get an element data at specified index.

Parameters
IndexThe index of an element to get the data of.
Returns
The initialized data of the element struct.

◆ Pop()

void FScriptStructArray::Pop ( const int32  InCount = 1,
bool  bAllowShrinking = true 
)
inline

Remove the elements from the end of the container.

Parameters
InCountThe number of elements to remove.
bAllowShrinkingIs capacity shrinking allowed?

◆ Reserve()

bool FScriptStructArray::Reserve ( const int32  InCapacity)
inline

Reserve the space for a certain amount of elements.

Parameters
InCapacityThe new capacity to guarantee.
Returns
Was anything actually changed?

◆ Reset()

void FScriptStructArray::Reset ( const int32  InCapacity = 0)
inline

Clear the array without changing the allocated space, but only if the passed capacity is not larger than the present one.

Parameters
InCapacityThe new capacity to guarantee.

◆ Set() [1/2]

void FScriptStructArray::Set ( const FScriptStructArray Array)
inline

◆ Set() [2/2]

void FScriptStructArray::Set ( UScriptStruct *  InElementType,
const int32  InCapacity = 0 
)
inline

Set the container with an element type and a capacity.

Parameters
InElementTypeThe new element type.
InCapacityThe new capacity to guarantee.

◆ SetElementAt()

void FScriptStructArray::SetElementAt ( const int32  ElementIndex,
const void *const  InData 
)
inline

Sets an element at a specific index to an initialized struct data.

Parameters
ElementIndexThe index of an element to set.
InDataAn initialized struct data to set with.

◆ Swap()

void FScriptStructArray::Swap ( const int32  FirstIndexToSwap,
const int32  SecondIndexToSwap 
)
inline

Swap two elements in the array.


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