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

The iterator of the belt slots. More...

#include <BeltIt.h>

Public Types

enum  {
  IsSolid = SubjectHandleType::IsHandleSolid() , AllowsChanges = SubjectHandleType::AllowsChanges , AllowsStructuralChanges = SubjectHandleType::AllowsStructuralChanges , AllowsDirectTraitAccess = SubjectHandleType::AllowsDirectTraitAccess ,
  InvalidSlotIndex = FBeltSlot::InvalidIndex , InvalidComboIndex = FBeltSlot::InvalidComboIndex , InvalidDetailIndex = UBelt::InvalidDetailLineIndex
}
 
typedef SubjectHandleT SubjectHandleType
 The type of the subject handle used within the belt iterator. More...
 
typedef SubjectHandleType::SubjectivePtrType SubjectivePtrType
 The type of the subjective used. More...
 

Public Member Functions

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

Static Public Member Functions

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

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.

Member Enumeration Documentation

◆ anonymous enum

template<typename SubjectHandleT >
anonymous enum
Enumerator
IsSolid 

The solidity state of the chunk iterator.

AllowsChanges 

Is the subject of a mutable semantics.

AllowsStructuralChanges 

Are structural changes (adding/removing components) allowed?

AllowsDirectTraitAccess 

The direct trait data access status.

InvalidSlotIndex 

Invalid belt slot index.

InvalidComboIndex 

Invalid combination index.

InvalidDetailIndex 

Invalid detail index.

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/2]

template<typename SubjectHandleT >
template<typename D >
D * TBeltIt< SubjectHandleT >::GetDetail ( ) const
inline

Get a detail of a certain class.

Templated version.

◆ GetDetail() [2/2]

template<typename SubjectHandleT >
UDetail * TBeltIt< SubjectHandleT >::GetDetail ( const TSubclassOf< UDetail DetailClass) const
inline

Get a detail of a certain class.

◆ GetDetailHinted() [1/2]

template<typename SubjectHandleT >
template<class D >
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/2]

template<typename SubjectHandleT >
UDetail * TBeltIt< SubjectHandleT >::GetDetailHinted ( const TSubclassOf< UDetail DetailClass,
const int32  DetailIndexHint 
) const
inline

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

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/3]

template<typename SubjectHandleT >
template<typename T >
T TBeltIt< SubjectHandleT >::GetTrait ( ) const
inline

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

Template Parameters
TThe type of the trait to get.
Returns
A copy of the trait.

◆ GetTrait() [2/3]

template<typename SubjectHandleT >
template<typename T >
EApparatusStatus 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.
Parameters
OutTraitThe trait receiver.
bTraitInitializedIs the OutTrait actually initialized?
Returns
The status of the operation.

◆ GetTrait() [3/3]

template<typename SubjectHandleT >
EApparatusStatus 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.

Parameters
TraitTypeThe type of the trait to get.
OutTraitDataThe trait data receiver.
bTraitDataInitializedIs the OutTraitData buffer actually initialized?
Returns
The status of the operation.

◆ GetTraitPtr() [1/2]

template<typename SubjectHandleT >
template<typename T , EParadigm Paradigm = EParadigm::Safe>
TResultTraitPtr< T, Paradigm > TBeltIt< SubjectHandleT >::GetTraitPtr ( ) const
inline

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

Templated version.

Template Parameters
TraitTypeThe type of the trait to get.
ParadigmThe access safety paradigm to use.
Returns
A pointer to the trait data.

◆ GetTraitPtr() [2/2]

template<typename SubjectHandleT >
template<EParadigm Paradigm = EParadigm::Safe>
TResultTraitVoidPtr< Paradigm > TBeltIt< SubjectHandleT >::GetTraitPtr ( UScriptStruct *const  TraitType) const
inline

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

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

◆ GetTraitRef()

template<typename SubjectHandleT >
template<typename T , EParadigm Paradigm = EParadigm::Safe>
TResultTraitRef< T, Paradigm > 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

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