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

The generic base for the iterators of the belt slots. More...

#include <BeltIt.h>

Public Types

enum  { InvalidSlotIndex = FBeltSlot::InvalidIndex , InvalidComboIndex = FBeltSlot::InvalidComboIndex , IsSolid = SubjectHandleType::IsSolid }
 
typedef SubjectHandleT SubjectHandleType
 The type of the subject handle used within the belt iterator. More...
 
typedef SubjectHandleType::SubjectiveType SubjectiveType
 The type of the subjective used. More...
 

Public Member Functions

int32 GetSlotIndex () const
 Get the current belt's slot index. 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 has locked 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...
 
int32 GetComboIndex () const
 The current combination within the slot. More...
 
const FFilterGetFilter () const
 Get the filter of the current iterating. More...
 
const FBeltSlotGetSlot () const
 Get the current slot of the iterator. More...
 
UObject * GetSubjectiveObject () const
 Get the currently iterated subjective object. More...
 
SubjectiveTypeGetSubjective () const
 Get the currently iterated subjective. More...
 
SubjectHandleT GetSubject () const
 Get the currently iterated subject. More...
 
UDetailGetDetailAt (const int32 DetailIndex) const
 Get a detail at a certain index. More...
 
UDetailGetDetailHinted (const TSubclassOf< UDetail > DetailClass, const int32 DetailIndexHinted) const
 Get a detail by a class at a certain index hinted. More...
 
template<typename T >
T * GetDetailHinted (const int32 DetailIndexHinted) const
 Get a detail by a class at a certain index hinted. More...
 
UDetailGetDetail (const TSubclassOf< UDetail > DetailClass) const
 Get a detail of a certain class. More...
 
template<typename T >
T * GetDetail () const
 Get a detail of a certain class. More...
 
template<bool S = IsSolid>
std::enable_if< S, void * >::type GetTraitPtr (UScriptStruct *const TraitType) const
 Get a trait of a certain type from a currently iterated subject. More...
 
template<typename T >
std::enable_if< IsSolid, T * >::type GetTraitPtr () const
 Get a pointer to a trait of a certain type from a currently iterated subject. More...
 
template<typename T >
std::enable_if< IsSolid, T & >::type GetTraitRef () const
 Get a trait of a certain type from a currently iterated subject. More...
 
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 >
GetTrait () const
 Get a copy of a trait of a certain type from a currently iterated subject. More...
 
const struct FDetailmarkGetDetailmark () const
 Get the detailmark of the current iterating. 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...
 

Friends

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

Detailed Description

template<typename SubjectHandleT>
struct TBeltIt< SubjectHandleT >

The generic base for the iterators of the belt slots.

Member Typedef Documentation

◆ SubjectHandleType

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

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

◆ SubjectiveType

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

The type of the subjective used.

Member Enumeration Documentation

◆ anonymous enum

template<typename SubjectHandleT >
anonymous enum
Enumerator
InvalidSlotIndex 

Invalid belt slot index.

InvalidComboIndex 

Invalid combination index.

IsSolid 

Is the belt iterator homogenous?

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.

◆ GetComboIndex()

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

The current combination within the slot.

◆ GetDetail() [1/2]

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

◆ GetDetailAt()

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

Get a detail at a certain index.

◆ GetDetailHinted() [1/2]

template<typename SubjectHandleT >
template<typename T >
T* TBeltIt< SubjectHandleT >::GetDetailHinted ( const int32  DetailIndexHinted) const
inline

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

Templated version.

◆ GetDetailHinted() [2/2]

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

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

◆ GetDetailmark()

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

Get the detailmark of the current iterating.

Returns
The detailmark of the iterating.

◆ 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.

◆ 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 >
SubjectiveType* TBeltIt< SubjectHandleT >::GetSubjective ( ) const
inline

Get the currently iterated subjective.

◆ GetSubjectiveObject()

template<typename SubjectHandleT >
UObject* TBeltIt< SubjectHandleT >::GetSubjectiveObject ( ) const
inline

Get the currently iterated subjective object.

◆ 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 >
std::enable_if<IsSolid, T*>::type 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.
Returns
A pointer to the trait data.

◆ GetTraitPtr() [2/2]

template<typename SubjectHandleT >
template<bool S = IsSolid>
std::enable_if<S, void*>::type 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 >
std::enable_if<IsSolid, T&>::type 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.
Returns
A reference to the trait.

◆ IsLocking()

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

Check if the iterator has locked 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 >
friend struct TChain
friend

◆ UBelt

template<typename SubjectHandleT >
friend class UBelt
friend

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