Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
TBeltIt< SubjectHandleT > Struct Template Reference

The iterator of the belt slots. More...

#include <BeltIt.h>

Public Types

typedef SubjectHandleT SubjectHandleType
 The type of the subject handle used within the belt iterator.
 
typedef SubjectHandleType::SubjectivePtrType SubjectivePtrType
 The type of the subjective used.
 

Public Member Functions

UBeltGetBelt () const
 Get the belt of the iterator.
 
const FFilterGetFilter () const
 Get the filter of the current iterating.
 
const FDetailmarkGetDetailmark () const
 Get the detailmark of the current iterating.
 
const TArray< int32 > & GetMainlineDetailsIndices () const
 Get the indices of the used details during the iterating.
 
int32 GetSlotIndex () const
 Get the current belt's slot index.
 
int32 GetComboIndex () const
 Get the current sub-slot combination index.
 
int32 GetCombosCount () const
 Get the current number of combinations within the active slot.
 
 TBeltIt ()
 Construct a new uninitialized iterator.
 
 TBeltIt (TBeltIt &&InIterator)
 Move-construct a new belt iterator.
 
 TBeltIt (const TBeltIt &InIterator)
 Copy-construct a new belt iterator.
 
bool IsLocking () const
 Check if the iterator should be locking its belt.
 
TBeltItoperator= (TBeltIt &&InIterator)
 Move-assign the iterator.
 
TBeltItoperator= (const TBeltIt &InIterator)
 Assign the iterator.
 
bool IsViable () const
 Check if the iterator is viable and is not at the end of its belt.
 
 operator bool () const
 Check if the iterator is valid and not at the end.
 
const FBeltSlotGetSlot () const
 Get the current slot of the iterator.
 
SubjectivePtrType GetSubjective () const
 Get the currently iterated subjective.
 
SubjectHandleT GetSubject () const
 Get the currently iterated subject.
 
EApparatusStatus Advance ()
 Advance to the next iteration.
 
TBeltItoperator++ ()
 Get the next iterator (prefix version).
 
TBeltIt operator++ (int)
 Get the next iterator (postfix version).
 
bool operator== (const TBeltIt &Other) const
 
bool operator!= (const TBeltIt &Other) const
 
 ~TBeltIt ()
 Destroy the iterator unlocking the belt if necessary.
 
Details Getting
UDetailDetailAt (const int32 DetailIndex) const
 Get a detail at a certain index.
 
template<EParadigm Paradigm = EParadigm::Default>
auto GetDetail (const TSubclassOf< UDetail > DetailClass) const
 Get a detail of a certain class.
 
template<EParadigm Paradigm, class D >
auto GetDetail () const
 Get a detail of a certain class.
 
template<class D , EParadigm Paradigm = EParadigm::Default>
auto GetDetail () const
 Get a detail of a certain class.
 
Hinted Details Getting
int32 HintDetail (const TSubclassOf< UDetail > DetailClass) const
 Get the hinting index of a detail.
 
template<typename D >
constexpr int32 HintDetail () const
 Get the hinting index of a detail.
 
template<EParadigm Paradigm = EParadigm::Default, TDetailPtrResultSecurity< UDetail > = 0>
TOutcome< Paradigm, UDetail * > GetDetailHinted (const TSubclassOf< UDetail > DetailClass, const int32 DetailIndexHint) const
 Get a detail by a class at a certain index hinted.
 
template<EParadigm Paradigm, class D , TDetailPtrResultSecurity< D > = 0>
TOutcome< Paradigm, TDetailPtrResult< D > > GetDetailHinted (const int32 DetailIndexHint) const
 Get a detail by a class at a certain index hinted.
 
template<class D , EParadigm Paradigm = EParadigm::Default, TDetailPtrResultSecurity< D > = 0>
TOutcome< Paradigm, TDetailPtrResult< D > > GetDetailHinted (const int32 DetailIndexHint) const
 Get a detail by a class at a certain index hinted.
 
Traits Data Access
template<EParadigm Paradigm = EParadigm::Default, TTraitVoidPtrResultSecurity< Paradigm > = 0>
TOutcome< Paradigm, TTraitVoidPtrResult< Paradigm > > GetTraitPtr (UScriptStruct *const TraitType) const
 Get a trait of a certain type from a currently iterated subject.
 
template<EParadigm Paradigm, typename T , TTraitPtrResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > GetTraitPtr () const
 Get a pointer to a trait of a certain type from a currently iterated subject.
 
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitPtrResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > GetTraitPtr () const
 Get a pointer to a trait of a certain type from a currently iterated subject.
 
template<EParadigm Paradigm, typename T , TTraitRefResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > GetTraitRef () const
 Get a trait of a certain type from a currently iterated subject.
 
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitRefResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > GetTraitRef () const
 Get a trait of a certain type from a currently iterated subject.
 
Traits Getting
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > GetTrait (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait of a certain type from a currently iterated subject.
 
template<EParadigm Paradigm, typename T >
TOutcome< Paradigm > GetTrait (T &OutTrait, const bool bTraitInitialized=true) const
 Get a trait of a certain type from a currently iterated subject.
 
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto GetTrait (T &OutTrait, const bool bTraitInitialized=true) const
 Get a trait of a certain type from a currently iterated subject.
 
template<EParadigm Paradigm, typename T >
auto GetTrait () const
 Get a copy of a trait of a certain type from a currently iterated subject.
 
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto GetTrait () const
 Get a copy of a trait of a certain type from a currently iterated subject.
 

Static Public Member Functions

static constexpr bool IsHandleSolid ()
 The solidity state of the iterator.
 

Static Public Attributes

static constexpr bool IsSolid = SubjectHandleType::IsHandleSolid()
 The solidity state of the chunk iterator.
 
static constexpr bool AllowsChanges = SubjectHandleType::AllowsChanges
 Is the subject of a mutable semantics.
 
static constexpr bool AllowsStructuralChanges = SubjectHandleType::AllowsStructuralChanges
 Are structural changes (adding/removing components) allowed?
 
static constexpr bool AllowsDirectTraitAccess = SubjectHandleType::AllowsDirectTraitAccess
 The direct trait data access status.
 
static constexpr auto InvalidSlotIndex = FBeltSlot::InvalidIndex
 Invalid belt slot index.
 
static constexpr auto InvalidComboIndex = FBeltSlot::InvalidComboIndex
 Invalid combination index.
 
static constexpr auto InvalidDetailIndex = UBelt::InvalidDetailLineIndex
 Invalid detail index.
 

Friends

template<typename ChunkItT , typename BeltItT , EParadigm Paradigm>
struct TChain
 
class UBelt
 

Detailed Description

template<typename SubjectHandleT>
struct TBeltIt< SubjectHandleT >

The iterator of the belt slots.

This actually iterates inter-combinations when there are multiple details of the same type within the slot and the locking filter.

Warning
You should never persist (save) instances of this class within your code. It must be used solely within a loop.

Member Typedef Documentation

◆ SubjectHandleType

template<typename SubjectHandleT >
typedef SubjectHandleT TBeltIt< SubjectHandleT >::SubjectHandleType

The type of the subject handle used within the belt iterator.

◆ SubjectivePtrType

template<typename SubjectHandleT >
typedef SubjectHandleType::SubjectivePtrType TBeltIt< SubjectHandleT >::SubjectivePtrType

The type of the subjective used.

Constructor & Destructor Documentation

◆ TBeltIt() [1/3]

template<typename SubjectHandleT >
TBeltIt< SubjectHandleT >::TBeltIt ( )
inline

Construct a new uninitialized iterator.

◆ TBeltIt() [2/3]

template<typename SubjectHandleT >
TBeltIt< SubjectHandleT >::TBeltIt ( TBeltIt< SubjectHandleT > &&  InIterator)
inline

Move-construct a new belt iterator.

◆ TBeltIt() [3/3]

template<typename SubjectHandleT >
TBeltIt< SubjectHandleT >::TBeltIt ( const TBeltIt< SubjectHandleT > &  InIterator)
inline

Copy-construct a new belt iterator.

◆ ~TBeltIt()

template<typename SubjectHandleT >
TBeltIt< SubjectHandleT >::~TBeltIt ( )
inline

Destroy the iterator unlocking the belt if necessary.

Member Function Documentation

◆ Advance()

template<typename SubjectHandleT >
EApparatusStatus TBeltIt< SubjectHandleT >::Advance ( )
inline

Advance to the next iteration.

Returns
The status of the operation.

◆ DetailAt()

template<typename SubjectHandleT >
UDetail * TBeltIt< SubjectHandleT >::DetailAt ( const int32  DetailIndex) const
inline

Get a detail at a certain index.

Parameters
DetailIndexThe detail index, relative to the belt's detailmark.
Returns
The detail at the specified index.

◆ GetBelt()

template<typename SubjectHandleT >
UBelt * TBeltIt< SubjectHandleT >::GetBelt ( ) const
inline

Get the belt of the iterator.

◆ GetComboIndex()

template<typename SubjectHandleT >
int32 TBeltIt< SubjectHandleT >::GetComboIndex ( ) const
inline

Get the current sub-slot combination index.

◆ GetCombosCount()

template<typename SubjectHandleT >
int32 TBeltIt< SubjectHandleT >::GetCombosCount ( ) const
inline

Get the current number of combinations within the active slot.

◆ GetDetail() [1/3]

template<typename SubjectHandleT >
template<EParadigm Paradigm, class D >
auto TBeltIt< SubjectHandleT >::GetDetail ( ) const
inline

Get a detail of a certain class.

Statically typed version.

◆ GetDetail() [2/3]

template<typename SubjectHandleT >
template<class D , EParadigm Paradigm = EParadigm::Default>
auto TBeltIt< SubjectHandleT >::GetDetail ( ) const
inline

Get a detail of a certain class.

Statically typed version.

◆ GetDetail() [3/3]

template<typename SubjectHandleT >
template<EParadigm Paradigm = EParadigm::Default>
auto TBeltIt< SubjectHandleT >::GetDetail ( const TSubclassOf< UDetail DetailClass) const
inline

Get a detail of a certain class.

◆ GetDetailHinted() [1/3]

template<typename SubjectHandleT >
template<EParadigm Paradigm, class D , TDetailPtrResultSecurity< D > = 0>
TOutcome< Paradigm, TDetailPtrResult< D > > TBeltIt< SubjectHandleT >::GetDetailHinted ( const int32  DetailIndexHint) const
inline

Get a detail by a class at a certain index hinted.

Templated version.

Template Parameters
DThe class of the detail to get.
Parameters
DetailIndexHintThe hinting index of the detail.
Returns
The requested detail.
nullptr If the detail is not available.

◆ GetDetailHinted() [2/3]

template<typename SubjectHandleT >
template<class D , EParadigm Paradigm = EParadigm::Default, TDetailPtrResultSecurity< D > = 0>
TOutcome< Paradigm, TDetailPtrResult< D > > TBeltIt< SubjectHandleT >::GetDetailHinted ( const int32  DetailIndexHint) const
inline

Get a detail by a class at a certain index hinted.

Templated version.

Template Parameters
DThe class of the detail to get.
Parameters
DetailIndexHintThe hinting index of the detail.
Returns
The requested detail.
nullptr If the detail is not available.

◆ GetDetailHinted() [3/3]

template<typename SubjectHandleT >
template<EParadigm Paradigm = EParadigm::Default, TDetailPtrResultSecurity< UDetail > = 0>
TOutcome< Paradigm, UDetail * > TBeltIt< SubjectHandleT >::GetDetailHinted ( const TSubclassOf< UDetail DetailClass,
const int32  DetailIndexHint 
) const
inline

Get a detail by a class at a certain index hinted.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
DetailClassThe class of the detail to get.
DetailIndexHintThe hinting index of the detail.
Returns
The requested detail.
nullptr If the detail is not available.

◆ GetDetailmark()

template<typename SubjectHandleT >
const FDetailmark & TBeltIt< SubjectHandleT >::GetDetailmark ( ) const
inline

Get the detailmark of the current iterating.

Returns
The detailmark of the iterating.
See also
GetFilter()

◆ GetFilter()

template<typename SubjectHandleT >
const FFilter & TBeltIt< SubjectHandleT >::GetFilter ( ) const
inline

Get the filter of the current iterating.

Returns
The filter of the current iterating.

◆ GetMainlineDetailsIndices()

template<typename SubjectHandleT >
const TArray< int32 > & TBeltIt< SubjectHandleT >::GetMainlineDetailsIndices ( ) const
inline

Get the indices of the used details during the iterating.

Maps indices from the current filter's detailmark to the belt's detailmark.

◆ GetSlot()

template<typename SubjectHandleT >
const FBeltSlot & TBeltIt< SubjectHandleT >::GetSlot ( ) const
inline

Get the current slot of the iterator.

Returns
The slot of the iterator.

◆ GetSlotIndex()

template<typename SubjectHandleT >
int32 TBeltIt< SubjectHandleT >::GetSlotIndex ( ) const
inline

Get the current belt's slot index.

Returns
The current iterated slot index.

◆ GetSubject()

template<typename SubjectHandleT >
SubjectHandleT TBeltIt< SubjectHandleT >::GetSubject ( ) const
inline

Get the currently iterated subject.

◆ GetSubjective()

template<typename SubjectHandleT >
SubjectivePtrType TBeltIt< SubjectHandleT >::GetSubjective ( ) const
inline

Get the currently iterated subjective.

◆ GetTrait() [1/5]

template<typename SubjectHandleT >
template<EParadigm Paradigm, typename T >
auto TBeltIt< SubjectHandleT >::GetTrait ( ) const
inline

Get a copy of a trait of a certain type from a currently iterated subject.

Copy-returning version.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to get.
Returns
A copy of the trait.

◆ GetTrait() [2/5]

template<typename SubjectHandleT >
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto TBeltIt< SubjectHandleT >::GetTrait ( ) const
inline

Get a copy of a trait of a certain type from a currently iterated subject.

Copy-returning default paradigm version.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to get.
Returns
A copy of the trait.

◆ GetTrait() [3/5]

template<typename SubjectHandleT >
template<EParadigm Paradigm, typename T >
TOutcome< Paradigm > TBeltIt< SubjectHandleT >::GetTrait ( T OutTrait,
const bool  bTraitInitialized = true 
) const
inline

Get a trait of a certain type from a currently iterated subject.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to get.
Parameters
OutTraitThe trait receiver.
bTraitInitializedIs the OutTrait actually initialized?
Returns
The outcome of the operation.

◆ GetTrait() [4/5]

template<typename SubjectHandleT >
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto TBeltIt< SubjectHandleT >::GetTrait ( T OutTrait,
const bool  bTraitInitialized = true 
) const
inline

Get a trait of a certain type from a currently iterated subject.

Template Parameters
TThe type of the trait to get.
ParadigmThe paradigm to work under.
Parameters
OutTraitThe trait receiver.
bTraitInitializedIs the OutTrait actually initialized?
Returns
The outcome of the operation.

◆ GetTrait() [5/5]

template<typename SubjectHandleT >
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > TBeltIt< SubjectHandleT >::GetTrait ( UScriptStruct *const  TraitType,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait of a certain type from a currently iterated subject.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
TraitTypeThe type of the trait to get.
OutTraitDataThe trait data receiver.
bTraitDataInitializedIs the OutTraitData buffer actually initialized?
Returns
The outcome of the operation.

◆ GetTraitPtr() [1/3]

template<typename SubjectHandleT >
template<EParadigm Paradigm, typename T , TTraitPtrResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > TBeltIt< SubjectHandleT >::GetTraitPtr ( ) const
inline

Get a pointer to a trait of a certain type from a currently iterated subject.

Statically typed paradigm version.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to get.
Returns
The pointer to the trait data.

◆ GetTraitPtr() [2/3]

template<typename SubjectHandleT >
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitPtrResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > TBeltIt< SubjectHandleT >::GetTraitPtr ( ) const
inline

Get a pointer to a trait of a certain type from a currently iterated subject.

Statically typed version.

Template Parameters
ParadigmThe paradigm to work under.
TThe type of the trait to get a pointer of.
Returns
The pointer to the trait data.

◆ GetTraitPtr() [3/3]

template<typename SubjectHandleT >
template<EParadigm Paradigm = EParadigm::Default, TTraitVoidPtrResultSecurity< Paradigm > = 0>
TOutcome< Paradigm, TTraitVoidPtrResult< Paradigm > > TBeltIt< SubjectHandleT >::GetTraitPtr ( UScriptStruct *const  TraitType) const
inline

Get a trait of a certain type from a currently iterated subject.

Dynamically-typed version.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
TraitTypeThe type of the trait to get.
Returns
A pointer to the trait data.

◆ GetTraitRef() [1/2]

template<typename SubjectHandleT >
template<EParadigm Paradigm, typename T , TTraitRefResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > TBeltIt< SubjectHandleT >::GetTraitRef ( ) const
inline

Get a trait of a certain type from a currently iterated subject.

Templated version.

Template Parameters
TThe type of the trait to get.
ParadigmThe access safety paradigm to use.
Returns
A reference to the trait.

◆ GetTraitRef() [2/2]

template<typename SubjectHandleT >
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitRefResultSecurity< Paradigm, T > = 0>
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > TBeltIt< SubjectHandleT >::GetTraitRef ( ) const
inline

Get a trait of a certain type from a currently iterated subject.

Templated version.

Template Parameters
TThe type of the trait to get.
ParadigmThe access safety paradigm to use.
Returns
A reference to the trait.

◆ HintDetail() [1/2]

template<typename SubjectHandleT >
template<typename D >
constexpr int32 TBeltIt< SubjectHandleT >::HintDetail ( ) const
inlineconstexpr

Get the hinting index of a detail.

Templated version.

Note
May actually be safely used on non-detail types and will return INDEX_NONE in that case.
Template Parameters
DThe detail class to query for.
Returns
The hinting index of the detail.

◆ HintDetail() [2/2]

template<typename SubjectHandleT >
int32 TBeltIt< SubjectHandleT >::HintDetail ( const TSubclassOf< UDetail DetailClass) const
inline

Get the hinting index of a detail.

Parameters
DetailClassThe detail class to query for.
Returns
The hinting index of the detail.

◆ IsHandleSolid()

template<typename SubjectHandleT >
static constexpr bool TBeltIt< SubjectHandleT >::IsHandleSolid ( )
inlinestaticconstexpr

The solidity state of the iterator.

◆ IsLocking()

template<typename SubjectHandleT >
bool TBeltIt< SubjectHandleT >::IsLocking ( ) const
inline

Check if the iterator should be locking its belt.

◆ IsViable()

template<typename SubjectHandleT >
bool TBeltIt< SubjectHandleT >::IsViable ( ) const
inline

Check if the iterator is viable and is not at the end of its belt.

During the iteration process the current state of the iterator may point to some invalid slot (missing subjective) after its processing, but that doesn't mean that the iterator is not viable itself, since it can still advance to the next valid slot (if there is any).

◆ operator bool()

template<typename SubjectHandleT >
TBeltIt< SubjectHandleT >::operator bool ( ) const
inline

Check if the iterator is valid and not at the end.

◆ operator!=()

template<typename SubjectHandleT >
bool TBeltIt< SubjectHandleT >::operator!= ( const TBeltIt< SubjectHandleT > &  Other) const
inline

◆ operator++() [1/2]

template<typename SubjectHandleT >
TBeltIt & TBeltIt< SubjectHandleT >::operator++ ( )
inline

Get the next iterator (prefix version).

◆ operator++() [2/2]

template<typename SubjectHandleT >
TBeltIt TBeltIt< SubjectHandleT >::operator++ ( int  )
inline

Get the next iterator (postfix version).

◆ operator=() [1/2]

template<typename SubjectHandleT >
TBeltIt & TBeltIt< SubjectHandleT >::operator= ( const TBeltIt< SubjectHandleT > &  InIterator)
inline

Assign the iterator.

Parameters
InIteratorAn iterator to assign from.

◆ operator=() [2/2]

template<typename SubjectHandleT >
TBeltIt & TBeltIt< SubjectHandleT >::operator= ( TBeltIt< SubjectHandleT > &&  InIterator)
inline

Move-assign the iterator.

Parameters
InIteratorAn iterator to move.

◆ operator==()

template<typename SubjectHandleT >
bool TBeltIt< SubjectHandleT >::operator== ( const TBeltIt< SubjectHandleT > &  Other) const
inline

Friends And Related Function Documentation

◆ TChain

template<typename SubjectHandleT >
template<typename ChunkItT , typename BeltItT , EParadigm Paradigm>
friend struct TChain
friend

◆ UBelt

template<typename SubjectHandleT >
friend class UBelt
friend

Member Data Documentation

◆ AllowsChanges

template<typename SubjectHandleT >
constexpr bool TBeltIt< SubjectHandleT >::AllowsChanges = SubjectHandleType::AllowsChanges
staticconstexpr

Is the subject of a mutable semantics.

◆ AllowsDirectTraitAccess

template<typename SubjectHandleT >
constexpr bool TBeltIt< SubjectHandleT >::AllowsDirectTraitAccess = SubjectHandleType::AllowsDirectTraitAccess
staticconstexpr

The direct trait data access status.

◆ AllowsStructuralChanges

template<typename SubjectHandleT >
constexpr bool TBeltIt< SubjectHandleT >::AllowsStructuralChanges = SubjectHandleType::AllowsStructuralChanges
staticconstexpr

Are structural changes (adding/removing components) allowed?

◆ InvalidComboIndex

template<typename SubjectHandleT >
constexpr auto TBeltIt< SubjectHandleT >::InvalidComboIndex = FBeltSlot::InvalidComboIndex
staticconstexpr

Invalid combination index.

◆ InvalidDetailIndex

template<typename SubjectHandleT >
constexpr auto TBeltIt< SubjectHandleT >::InvalidDetailIndex = UBelt::InvalidDetailLineIndex
staticconstexpr

Invalid detail index.

◆ InvalidSlotIndex

template<typename SubjectHandleT >
constexpr auto TBeltIt< SubjectHandleT >::InvalidSlotIndex = FBeltSlot::InvalidIndex
staticconstexpr

Invalid belt slot index.

◆ IsSolid

template<typename SubjectHandleT >
constexpr bool TBeltIt< SubjectHandleT >::IsSolid = SubjectHandleType::IsHandleSolid()
staticconstexpr

The solidity state of the chunk iterator.


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