Apparatus Version 1.21
ECS data-oriented workflow for Unreal Engine.
Classes | Public Member Functions | List of all members
TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor Struct Reference

A state of the chain iterating. More...

#include <Chain.h>

Inheritance diagram for TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor:
Inheritance graph
[legend]
Collaboration diagram for TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor:
Collaboration graph
[legend]

Public Member Functions

 FCursor (const TChain *const InOwner, const int64 InOffset=0, const int64 InLimit=TNumericLimits< int64 >::Max())
 Initialize a new cursor instance for a chain. More...
 
 FCursor (FCursor &&InCursor)
 Move-initialize a cursor. More...
 
 FCursor (const FCursor &InCursor)
 Copy-initialize a cursor. More...
 
FCursoroperator= (FCursor &&InCursor)
 Move a cursor. More...
 
FCursoroperator= (const FCursor &InCursor)
 Copy a cursor. More...
 
 FCursor ()
 Initialize a new invalid cursor. More...
 
 ~FCursor ()
 Finalize the cursor. More...
 
const TChainGetOwner () const
 Get the owning chain of the cursor. More...
 
int64 GetChainSlotIndex () const
 Get the global (chain-relative) index of the current slot. More...
 
UClass * GetIterableClass () const
 Get the target sequence class. More...
 
bool IsLimitReached () const
 Check if the iterating limit was reached. More...
 
bool ShouldStop () const
 Check if the cursor should stop iterating. More...
 
bool IsViable () const
 Check if the cursor is viable and has not finished the iterating. More...
 
 operator bool () const
 Check if the cursor is viable. More...
 
void Reset ()
 Detach the cursor from the chain making it an invalid one. More...
 
bool Begin ()
 Begin iterating with the cursor using the current range. More...
 
bool Begin (const int64 InOffset, const int64 InLimit=TNumericLimits< int64 >::Max())
 Begin iterating with the cursor using the supplied range. More...
 
bool Advance ()
 Advance the iterator to the next slot. More...
 
bool Provide ()
 Begin or advance iterating the chain using this cursor. More...
 
SubjectHandleType GetSubject () const
 Get the subject of the current iteration. More...
 
SubjectivePtrType GetSubjective () const
 Get the subjective of the current iteration of the cursor. More...
 
template<EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitVoidPtr< Paradigm > >::type GetTraitPtr (UScriptStruct *const TraitType) const
 Get a trait pointer of a certain type at the current cursor position. More...
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitPtr< T, Paradigm > >::type GetTraitPtr () const
 Get a trait pointer of a certain type. More...
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitRef< T, Paradigm > >::type GetTraitRef () const
 Get a trait reference of a certain type. More...
 
template<typename T >
T GetTrait () const
 Get a trait copy of a certain type. More...
 
EApparatusStatus GetTrait (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait of a certain type. More...
 
template<typename T >
EApparatusStatus GetTrait (T &OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait of a certain type. More...
 
template<EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitVoidPtr< Paradigm > >::type GetTraitPtrHinted (UScriptStruct *const TraitType, const int32 TraitIndexHint) const
 Get a pointer to a trait of a certain type with an index hint. More...
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitPtr< T, Paradigm > >::type GetTraitPtrHinted (const int32 TraitIndexHint) const
 Get a pointer to a trait of a certain type with an index hint. More...
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitRef< T, Paradigm > >::type GetTraitRefHinted (const int32 TraitIndexHint) const
 Get a trait of a certain type with an index hint. More...
 
template<typename T >
T GetTraitHinted (const int32 TraitIndexHint) const
 Get a copy of a trait of a certain type with an index hint. More...
 
EApparatusStatus GetTraitHinted (UScriptStruct *const TraitType, const int32 TraitIndexHint, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait of a certain type with an index hint. More...
 
template<typename T >
EApparatusStatus GetTraitHinted (const int32 TraitIndexHint, T &OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait of a certain type with an index hint. More...
 
UDetailDetailAt (const int32 Index) const
 Get a detail at a certain index hinted. More...
 
UDetailGetDetailHinted (const TSubclassOf< UDetail > DetailClass, const int32 DetailIndexHint) const
 Get a detail of a certain class at an index hinted. More...
 
template<class D >
TResultDetailPtr< DGetDetailHinted (const int32 DetailIndexHint) const
 Get a detail of a certain class at an index hinted. More...
 
TResultDetailPtr< UDetailGetDetail (const TSubclassOf< UDetail > DetailClass) const
 Get a detail of a certain class. More...
 
template<class D >
TResultDetailPtr< DGetDetail () const
 Get a detail of a certain class. More...
 
template<typename PartT >
PartT GetPart () const
 Get a part (trait, detail, subject, other) of the current slot by its type. More...
 
template<typename PartT >
PartT GetPartHinted (const int32 PartIndexHint) const
 Get a part (trait, detail, subject, other) of the current slot by its type with an index hint. More...
 

Detailed Description

template<typename ChunkItT, typename BeltItT, EParadigm InDefaultParadigm>
struct TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor

A state of the chain iterating.

Constructor & Destructor Documentation

◆ FCursor() [1/4]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::FCursor ( const TChain *const  InOwner,
const int64  InOffset = 0,
const int64  InLimit = TNumericLimits<int64>::Max() 
)
inline

Initialize a new cursor instance for a chain.

Parameters
InOwnerThe owner of the cursor to iterate.
InOffsetThe slot offset of the cursor to begin with.
InLimitThe maximum number of slots to iterate by.

◆ FCursor() [2/4]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::FCursor ( FCursor &&  InCursor)
inline

Move-initialize a cursor.

◆ FCursor() [3/4]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::FCursor ( const FCursor InCursor)
inline

Copy-initialize a cursor.

Parameters
InCursorThe original cursor to copy.

◆ FCursor() [4/4]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::FCursor ( )
inline

Initialize a new invalid cursor.

◆ ~FCursor()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::~FCursor ( )
inline

Finalize the cursor.

Member Function Documentation

◆ Advance()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
bool TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::Advance ( )
inline

Advance the iterator to the next slot.

Returns
Does the next iteration makes sense?

◆ Begin() [1/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
bool TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::Begin ( )
inline

Begin iterating with the cursor using the current range.

Returns
Does the first iteration makes sense?

◆ Begin() [2/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
bool TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::Begin ( const int64  InOffset,
const int64  InLimit = TNumericLimits<int64>::Max() 
)
inline

Begin iterating with the cursor using the supplied range.

Parameters
InOffsetThe slot offset to begin iterating with.
InLimitThe maximum number of slots to iterate by.
Returns
Does the first iteration makes sense?

◆ DetailAt()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
UDetail * TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::DetailAt ( const int32  Index) const
inline

Get a detail at a certain index hinted.

◆ GetChainSlotIndex()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
int64 TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetChainSlotIndex ( ) const
inline

Get the global (chain-relative) index of the current slot.

◆ GetDetail() [1/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<class D >
TResultDetailPtr< D > TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetDetail ( ) const
inline

Get a detail of a certain class.

Templated version.

Template Parameters
DThe class of detail to get. May be a base class.
Returns
A pointer to the detail of the specified type.
nullptr If there is no such detail within the current iteration.

◆ GetDetail() [2/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
TResultDetailPtr< UDetail > TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetDetail ( const TSubclassOf< UDetail DetailClass) const
inline

Get a detail of a certain class.

Parameters
DetailClassThe class of detail to get. May be a base class.
Returns
A pointer to the detail of the specified type.
nullptr If there is no such detail within the current iteration.

◆ GetDetailHinted() [1/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<class D >
TResultDetailPtr< D > TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetDetailHinted ( const int32  DetailIndexHint) const
inline

Get a detail of a certain class at an index hinted.

Templated version.

◆ GetDetailHinted() [2/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
UDetail * TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetDetailHinted ( const TSubclassOf< UDetail DetailClass,
const int32  DetailIndexHint 
) const
inline

Get a detail of a certain class at an index hinted.

◆ GetIterableClass()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
UClass * TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetIterableClass ( ) const
inline

Get the target sequence class.

◆ GetOwner()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
const TChain * TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetOwner ( ) const
inline

Get the owning chain of the cursor.

◆ GetPart()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename PartT >
PartT TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetPart ( ) const
inline

Get a part (trait, detail, subject, other) of the current slot by its type.

Templated version.

Template Parameters
PartTThe type of the part to get. Can be a value a reference or a pointer.
Returns
The part of the current slot in the designated type.

◆ GetPartHinted()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename PartT >
PartT TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetPartHinted ( const int32  PartIndexHint) const
inline

Get a part (trait, detail, subject, other) of the current slot by its type with an index hint.

Templated version.

Template Parameters
PartTThe type of the part to get. Can be a value, a reference or a pointer.
Parameters
PartIndexHintA component index hint, corresponding to an index within the locking filter.
Returns
The part of the current slot in the designated type.

◆ GetSubject()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
SubjectHandleType TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetSubject ( ) const
inline

Get the subject of the current iteration.

◆ GetSubjective()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
SubjectivePtrType TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetSubjective ( ) const
inline

Get the subjective of the current iteration of the cursor.

Returns
The subjective at the current cursor position.

◆ GetTrait() [1/3]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T >
T TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTrait ( ) const
inline

Get a trait copy of a certain type.

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

◆ GetTrait() [2/3]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T >
EApparatusStatus TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTrait ( T OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait of a certain type.

Templated version.

◆ GetTrait() [3/3]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
EApparatusStatus TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTrait ( UScriptStruct *const  TraitType,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait of a certain type.

◆ GetTraitHinted() [1/3]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T >
T TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitHinted ( const int32  TraitIndexHint) const
inline

Get a copy of a trait of a certain type with an index hint.

◆ GetTraitHinted() [2/3]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T >
EApparatusStatus TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitHinted ( const int32  TraitIndexHint,
T OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait of a certain type with an index hint.

Templated version.

◆ GetTraitHinted() [3/3]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
EApparatusStatus TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitHinted ( UScriptStruct *const  TraitType,
const int32  TraitIndexHint,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait of a certain type with an index hint.

◆ GetTraitPtr() [1/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitPtr< T, Paradigm > >::type TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitPtr ( ) const
inline

Get a trait pointer of a certain type.

Templated version.

Template Parameters
TThe type of the trait to get.
ParadigmThe security paradigm to use.
Returns
A pointer to the trait of the designated type.

◆ GetTraitPtr() [2/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitVoidPtr< Paradigm > >::type TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitPtr ( UScriptStruct *const  TraitType) const
inline

Get a trait pointer of a certain type at the current cursor position.

Template Parameters
ParadigmThe security paradigm to use.
Returns
A pointer to the trait of the designated type.

◆ GetTraitPtrHinted() [1/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitPtr< T, Paradigm > >::type TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitPtrHinted ( const int32  TraitIndexHint) const
inline

Get a pointer to a trait of a certain type with an index hint.

Templated version.

◆ GetTraitPtrHinted() [2/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitVoidPtr< Paradigm > >::type TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitPtrHinted ( UScriptStruct *const  TraitType,
const int32  TraitIndexHint 
) const
inline

Get a pointer to a trait of a certain type with an index hint.

◆ GetTraitRef()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitRef< T, Paradigm > >::type TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitRef ( ) const
inline

Get a trait reference of a certain type.

◆ GetTraitRefHinted()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
template<typename T , EParadigm Paradigm = DefaultParadigm>
std::enable_if< AllowsDirectTraitAccess||(Paradigm<=EParadigm::Unsafe), TResultTraitRef< T, Paradigm > >::type TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::GetTraitRefHinted ( const int32  TraitIndexHint) const
inline

Get a trait of a certain type with an index hint.

◆ IsLimitReached()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
bool TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::IsLimitReached ( ) const
inline

Check if the iterating limit was reached.

◆ IsViable()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
bool TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::IsViable ( ) const
inline

Check if the cursor is viable and has not finished the iterating.

Returns
The state of examination.

◆ operator bool()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::operator bool ( ) const
inline

Check if the cursor is viable.

◆ operator=() [1/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
FCursor & TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::operator= ( const FCursor InCursor)
inline

Copy a cursor.

◆ operator=() [2/2]

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
FCursor & TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::operator= ( FCursor &&  InCursor)
inline

Move a cursor.

◆ Provide()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
bool TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::Provide ( )
inline

Begin or advance iterating the chain using this cursor.

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

◆ Reset()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
void TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::Reset ( )
inline

Detach the cursor from the chain making it an invalid one.

The cursor will also release its owning chain as/if needed.

◆ ShouldStop()

template<typename ChunkItT , typename BeltItT , EParadigm InDefaultParadigm>
bool TChain< ChunkItT, BeltItT, InDefaultParadigm >::FCursor::ShouldStop ( ) const
inline

Check if the cursor should stop iterating.


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