Apparatus Version 1.7
ECS data-driven workflow for Unreal Engine.
Classes | Public Types | Public Member Functions | Friends | List of all members
FChain Struct Reference

An iterable belt sequence holder. More...

#include <Chain.h>

Public Types

enum  {
  InvalidId = -1 , FirstId = 0 , InvalidCursorId = -1 , DefaultCursorId = 0 ,
  InvalidSegmentIndex = -1
}
 

Public Member Functions

EApparatusStatus Reset ()
 Unchain the belts and reset the state completely. More...
 
template<typename TAllocator >
EApparatusStatus Enchain (const FFilter &InFilter, const TArray< UChunk *, TAllocator > &InChunks)
 Set to chain a set of chunks with a filter. More...
 
template<typename TAllocator >
EApparatusStatus Enchain (const FFilter &InFilter, const TArray< UBelt *, TAllocator > &InBelts)
 Set to chain a set of belts with a filter. More...
 
int32 FindSegment (const int32 InSlotIndex) const
 Find a certain chain segment by a chain slot index. More...
 
bool Begin (const int32 CursorId=DefaultCursorId) const
 Begin iterating the chain. More...
 
bool Advance (const int32 CursorId=DefaultCursorId) const
 Advance iterating the chain to the next index. More...
 
bool BeginOrAdvance (const int32 CursorId=DefaultCursorId) const
 Begin or advance iterating the chain. More...
 
FChainoperator= (FChain &&InChain)
 Move a chain. More...
 
FChainoperator= (const FChain &InChain)
 Set a chain equal to another chain. More...
 
FSubjectHandle GetSubject (const int32 CursorId=DefaultCursorId) const
 Get the subject of the current iteration. More...
 
TScriptInterface< ISubjectiveGetSubjective (const int32 CursorId=DefaultCursorId) const
 Get the subjective of the current iteration (if any). More...
 
EApparatusStatus GetTrait (const int32 CursorId, UScriptStruct *TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait on the current iteration. More...
 
void * GetTrait (const int32 CursorId, UScriptStruct *const TraitType) const
 Get a trait on the current iteration. More...
 
template<typename T >
T & GetTrait (const int32 CursorId) const
 Get a trait on the current iteration. More...
 
void * GetTrait (UScriptStruct *const TraitType) const
 Get a trait on the current iteration. More...
 
template<typename T >
T & GetTrait () const
 Get a trait on the current iteration. More...
 
EApparatusStatus GetTrait (UScriptStruct *TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get the trait on the current iteration. More...
 
template<typename T >
EApparatusStatus GetTrait (const int32 CursorId, T &OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait on the current iteration. More...
 
template<typename T >
EApparatusStatus GetTrait (T &OutTraitData, const bool bTraitDataInitialized=true) const
 Get the trait on the current iteration. More...
 
void * GetTraitHinted (const int32 CursorId, UScriptStruct *const TraitType, const int32 TraitIndexHint) const
 Get the trait on the current iteration at a specified index hinted. More...
 
void * GetTraitHinted (UScriptStruct *const TraitType, const int32 TraitIndexHint) const
 Get the trait on the current iteration at a specified index hinted. More...
 
template<typename T >
T & GetTraitHinted (const int32 CursorId, const int32 TraitIndexHint) const
 Get the trait on the current iteration at a specified index hinted. More...
 
template<typename T >
T & GetTraitHinted (const int32 TraitIndexHint) const
 Get the trait on the current iteration at a specified index hinted. More...
 
EApparatusStatus GetTraitHinted (const int32 CursorId, UScriptStruct *TraitType, const int32 TraitIndexHint, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get the trait on the current iteration at a specified index hinted. More...
 
EApparatusStatus GetTraitHinted (UScriptStruct *TraitType, const int32 TraitIndexHint, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get the trait on the current iteration at a specified index hinted. More...
 
template<typename T >
EApparatusStatus GetTraitHinted (const int32 CursorId, const int32 TraitIndexHint, T &OutTraitData, const bool bTraitDataInitialized=true) const
 Get the trait on the current iteration at a specified index hinted. More...
 
template<typename T >
EApparatusStatus GetTraitHinted (const int32 TraitIndexHint, T &OutTraitData, const bool bTraitDataInitialized=true) const
 Get the trait on the current iteration at a specified index hinted. More...
 
UDetailGetDetail (const int32 CursorId, const TSubclassOf< UDetail > DetailClass) const
 Get a detail of a specific type on the current iteration. More...
 
UDetailGetDetail (const TSubclassOf< UDetail > DetailClass) const
 Get the detail on the current iteration of a certain class. More...
 
template<typename T >
T * GetDetail (const int32 CursorId=DefaultCursorId) const
 Get the detail on the current iteration of a certain class. More...
 
UDetailGetDetailHinted (const int32 CursorId, const TSubclassOf< UDetail > DetailClass, const int32 IndexHint) const
 Get the detail on the current iteration at a certain index. More...
 
UDetailGetDetailHinted (const TSubclassOf< UDetail > DetailClass, const int32 IndexHint) const
 Get the detail on the current iteration at a certain index. More...
 
template<typename T >
T * GetDetailHinted (const int32 CursorId, const int32 IndexHint) const
 Get the detail on the current iteration at a certain index. More...
 
template<typename T >
T * GetDetailHinted (const int32 IndexHint) const
 Get the detail on the current iteration at a certain index. More...
 
 FChain ()
 The default constructor leaving the chain uninitialized. More...
 
 FChain (FChain &InChain)
 Construct a new chain as a copy of another one. More...
 
bool IsIterating () const
 Check if the chain currently being iterated by some cursor. More...
 
int32 IterableNum () const
 Get the total number of iterable entities available. More...
 
bool IsUsed () const
 Check if the chain is currently used (not available to be reused). More...
 

Friends

class UApparatusFunctionLibrary
 
class UMachine
 

Detailed Description

An iterable belt sequence holder.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidId 

Invalid chain identifier.

FirstId 

First chain identifier.

InvalidCursorId 

Invalid cursor identifier.

DefaultCursorId 

Default cursor identifier.

InvalidSegmentIndex 

Invalid segment index.

Constructor & Destructor Documentation

◆ FChain() [1/2]

FChain::FChain ( )
inline

The default constructor leaving the chain uninitialized.

◆ FChain() [2/2]

FChain::FChain ( FChain InChain)
inline

Construct a new chain as a copy of another one.

Parameters
InChainA chain to copy.

Member Function Documentation

◆ Advance()

bool FChain::Advance ( const int32  CursorId = DefaultCursorId) const
inline

Advance iterating the chain to the next index.

Returns
Was the advancement successful?

◆ Begin()

bool FChain::Begin ( const int32  CursorId = DefaultCursorId) const
inline

Begin iterating the chain.

Returns
Are there any actual slots to be iterated?

◆ BeginOrAdvance()

bool FChain::BeginOrAdvance ( const int32  CursorId = DefaultCursorId) const
inline

Begin or advance iterating the chain.

Returns
Is the iteration possible? Returns false if the iteration should be ended.

◆ Enchain() [1/2]

template<typename TAllocator >
EApparatusStatus FChain::Enchain ( const FFilter InFilter,
const TArray< UBelt *, TAllocator > &  InBelts 
)
inline

Set to chain a set of belts with a filter.

Parameters
InFilterThe target filter to enchain with.
InBeltsThe belts to enchain.
Returns
The status of the operation.

◆ Enchain() [2/2]

template<typename TAllocator >
EApparatusStatus FChain::Enchain ( const FFilter InFilter,
const TArray< UChunk *, TAllocator > &  InChunks 
)
inline

Set to chain a set of chunks with a filter.

Parameters
InFilterThe target filter to enchain with.
InChunksThe chunks to enchain.
Returns
The status of the operation.

◆ FindSegment()

int32 FChain::FindSegment ( const int32  InSlotIndex) const
inline

Find a certain chain segment by a chain slot index.

◆ GetDetail() [1/3]

UDetail* FChain::GetDetail ( const int32  CursorId,
const TSubclassOf< UDetail DetailClass 
) const
inline

Get a detail of a specific type on the current iteration.

◆ GetDetail() [2/3]

template<typename T >
T* FChain::GetDetail ( const int32  CursorId = DefaultCursorId) const
inline

Get the detail on the current iteration of a certain class.

Templated version.

Returns
The detail of the current iteration at a certain class.

◆ GetDetail() [3/3]

UDetail* FChain::GetDetail ( const TSubclassOf< UDetail DetailClass) const
inline

Get the detail on the current iteration of a certain class.

Returns
The detail of the current iteration at a certain class.

◆ GetDetailHinted() [1/4]

template<typename T >
T* FChain::GetDetailHinted ( const int32  CursorId,
const int32  IndexHint 
) const
inline

Get the detail on the current iteration at a certain index.

Templated version.

Template Parameters
TThe class of the detail to get.
Parameters
CursorIdThe identifier of the cursor.
IndexHintThe index of the detail hinting.
Returns
The detail of the current iteration at a certain index.

◆ GetDetailHinted() [2/4]

UDetail* FChain::GetDetailHinted ( const int32  CursorId,
const TSubclassOf< UDetail DetailClass,
const int32  IndexHint 
) const
inline

Get the detail on the current iteration at a certain index.

Returns
The detail of the current iteration at a certain index.

◆ GetDetailHinted() [3/4]

template<typename T >
T* FChain::GetDetailHinted ( const int32  IndexHint) const
inline

Get the detail on the current iteration at a certain index.

Templated version.

Template Parameters
TThe class of the detail to get.
Parameters
IndexHintThe index of the detail hinting.
Returns
The detail of the current iteration at a certain index.

◆ GetDetailHinted() [4/4]

UDetail* FChain::GetDetailHinted ( const TSubclassOf< UDetail DetailClass,
const int32  IndexHint 
) const
inline

Get the detail on the current iteration at a certain index.

Parameters
DetailClassThe class of the detail to get.
IndexHintThe index of the detail hinting.
Returns
The detail of the current iteration at a certain index.

◆ GetSubject()

FSubjectHandle FChain::GetSubject ( const int32  CursorId = DefaultCursorId) const
inline

Get the subject of the current iteration.

Returns
The subject of the current iteration.

◆ GetSubjective()

TScriptInterface< ISubjective > FChain::GetSubjective ( const int32  CursorId = DefaultCursorId) const
inline

Get the subjective of the current iteration (if any).

Returns
The subjective of the current iteration or nullptr, if there is none.

◆ GetTrait() [1/8]

template<typename T >
T& FChain::GetTrait ( ) const
inline

Get a trait on the current iteration.

Template Parameters
TThe type of the trait to get.
Returns
The resulting trait data.

◆ GetTrait() [2/8]

template<typename T >
T& FChain::GetTrait ( const int32  CursorId) const
inline

Get a trait on the current iteration.

Template Parameters
TThe type of the trait to get.
Parameters
CursorIdThe identifier of the cursor to get from.
Returns
The resulting trait data.

◆ GetTrait() [3/8]

template<typename T >
EApparatusStatus FChain::GetTrait ( const int32  CursorId,
T &  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait on the current iteration.

Templated version.

Template Parameters
TThe type of the trait to get.
Parameters
CursorIdThe identifier of the cursor to get from.
OutTraitDataThe output trait data buffer. The size of the buffer must be enough to store the whole trait.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ GetTrait() [4/8]

void* FChain::GetTrait ( const int32  CursorId,
UScriptStruct *const  TraitType 
) const
inline

Get a trait on the current iteration.

Parameters
CursorIdThe identifier of the cursor to get from.
TraitTypeThe type of the trait.
Returns
The resulting trait data.

◆ GetTrait() [5/8]

EApparatusStatus FChain::GetTrait ( const int32  CursorId,
UScriptStruct *  TraitType,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait on the current iteration.

Parameters
CursorIdThe identifier of the cursor to get from.
TraitTypeThe type of the trait.
OutTraitDataThe output trait data.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ GetTrait() [6/8]

template<typename T >
EApparatusStatus FChain::GetTrait ( T &  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get the trait on the current iteration.

Templated version.

Template Parameters
TThe type of the trait.
Parameters
OutTraitDataThe output trait data.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ GetTrait() [7/8]

void* FChain::GetTrait ( UScriptStruct *const  TraitType) const
inline

Get a trait on the current iteration.

Parameters
TraitTypeThe type of the trait.
Returns
The resulting trait data.

◆ GetTrait() [8/8]

EApparatusStatus FChain::GetTrait ( UScriptStruct *  TraitType,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get the trait on the current iteration.

Parameters
TraitTypeThe type of the trait to get.
OutTraitDataThe output trait data buffer. The size of the buffer must be enough to store the whole trait.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ GetTraitHinted() [1/8]

template<typename T >
T& FChain::GetTraitHinted ( const int32  CursorId,
const int32  TraitIndexHint 
) const
inline

Get the trait on the current iteration at a specified index hinted.

Templated version.

Template Parameters
TThe type of the trait to get.
Parameters
CursorIdThe identifier of the cursor to get from.
TraitIndexHintThe index of the trait.
Returns
A reference to the trait.

◆ GetTraitHinted() [2/8]

template<typename T >
EApparatusStatus FChain::GetTraitHinted ( const int32  CursorId,
const int32  TraitIndexHint,
T &  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get the trait on the current iteration at a specified index hinted.

Templated version.

Template Parameters
TThe type of the trait to get.
Parameters
CursorIdThe identifier of the cursor to get from.
TraitIndexHintThe index of the trait hinting.
OutTraitDataThe output trait data.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ GetTraitHinted() [3/8]

void* FChain::GetTraitHinted ( const int32  CursorId,
UScriptStruct *const  TraitType,
const int32  TraitIndexHint 
) const
inline

Get the trait on the current iteration at a specified index hinted.

Parameters
CursorIdThe identifier of the cursor to get from.
TraitIndexHintThe index of the trait.
TraitTypeThe type of the trait to get.
Returns
A pointer to the trait data.

◆ GetTraitHinted() [4/8]

EApparatusStatus FChain::GetTraitHinted ( const int32  CursorId,
UScriptStruct *  TraitType,
const int32  TraitIndexHint,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get the trait on the current iteration at a specified index hinted.

Parameters
CursorIdThe identifier of the cursor to get from.
TraitIndexHintThe index of the trait.
TraitTypeThe type of the trait.
OutTraitDataThe output trait data.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ GetTraitHinted() [5/8]

template<typename T >
T& FChain::GetTraitHinted ( const int32  TraitIndexHint) const
inline

Get the trait on the current iteration at a specified index hinted.

Templated version.

Template Parameters
TThe type of the trait to get.
Parameters
TraitIndexHintThe index of the trait.
Returns
A reference to the trait.

◆ GetTraitHinted() [6/8]

template<typename T >
EApparatusStatus FChain::GetTraitHinted ( const int32  TraitIndexHint,
T &  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get the trait on the current iteration at a specified index hinted.

Templated version.

Template Parameters
TThe type of the trait.
Parameters
TraitIndexHintThe index of the trait hint.
OutTraitDataThe output trait data.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ GetTraitHinted() [7/8]

void* FChain::GetTraitHinted ( UScriptStruct *const  TraitType,
const int32  TraitIndexHint 
) const
inline

Get the trait on the current iteration at a specified index hinted.

Parameters
TraitIndexHintThe index of the trait.
TraitTypeThe type of the trait to get.
Returns
A pointer to the trait data.

◆ GetTraitHinted() [8/8]

EApparatusStatus FChain::GetTraitHinted ( UScriptStruct *  TraitType,
const int32  TraitIndexHint,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get the trait on the current iteration at a specified index hinted.

Parameters
TraitTypeThe type of the trait to get.
TraitIndexHintThe index of the trait hinting.
OutTraitDataThe output trait data.
bTraitDataInitializedWas trait data initialized prior to calling this function?
Returns
The status of the operation.

◆ IsIterating()

bool FChain::IsIterating ( ) const
inline

Check if the chain currently being iterated by some cursor.

◆ IsUsed()

bool FChain::IsUsed ( ) const
inline

Check if the chain is currently used (not available to be reused).

◆ IterableNum()

int32 FChain::IterableNum ( ) const
inline

Get the total number of iterable entities available.

◆ operator=() [1/2]

FChain & FChain::operator= ( const FChain InChain)
inline

Set a chain equal to another chain.

◆ operator=() [2/2]

FChain & FChain::operator= ( FChain &&  InChain)
inline

Move a chain.

◆ Reset()

EApparatusStatus FChain::Reset ( )
inline

Unchain the belts and reset the state completely.

Friends And Related Function Documentation

◆ UApparatusFunctionLibrary

friend class UApparatusFunctionLibrary
friend

◆ UMachine

friend class UMachine
friend

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