Apparatus
Version 1.23
ECS data-oriented workflow for Unreal Engine.
|
A state of the chain iterating. More...
#include <Chain.h>
Public Types | |
using | CursorSuper = FCommonCursor |
The base cursor type. | |
typedef TVariant< FEmptyVariantState, ChunkItType, BeltItType > | IteratorType |
The common iterator type. | |
Public Member Functions | |
constexpr int32 | GetPartMappingSize () const |
Get the current size of the hinting mapping. | |
template<EParadigm RemappingParadigm = EParadigm::Safe> | |
int32 | RemapPartIndex (const int32 PartIndex) const |
Remap a part index hint using the current mapping. | |
TCursor & | operator= (TCursor &&InCursor) |
Move a cursor. | |
TCursor & | operator= (const TCursor &InCursor) |
Copy a cursor. | |
const TChain * | GetOwner () const |
Get the owning chain of the cursor. | |
UClass * | GetIterableClass () const |
Get the target sequence class. | |
bool | IsViable () const |
Check if the cursor is viable and has not finished the iterating. | |
operator bool () const | |
Check if the cursor is viable. | |
void | Reset () |
Detach the cursor from the chain making it an invalid one. | |
bool | Begin () |
Begin iterating with the cursor using the current range. | |
bool | Begin (const int32 InOffset, const int32 InLimit=TNumericLimits< int32 >::Max()) |
Begin iterating with the cursor using the supplied range. | |
bool | Advance () |
Advance the iterator to the next slot. | |
bool | Provide () |
Begin or advance iterating the chain using this cursor. | |
SubjectHandleType | GetSubject () const |
Get the subject of the current iteration. | |
SubjectivePtrType | GetSubjective () const |
Get the subjective of the current iteration of the cursor. | |
template<EParadigm Paradigm = DefaultParadigm, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitVoidPtrResult< Paradigm > > | GetTraitPtr (UScriptStruct *const TraitType) const |
Get a trait pointer of a certain type at the current cursor position. | |
template<EParadigm Paradigm, typename T , more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | GetTraitPtr () const |
Get a trait pointer of a certain type. | |
template<typename T , EParadigm Paradigm = DefaultParadigm, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | GetTraitPtr () const |
Get a trait pointer of a certain type. | |
template<EParadigm Paradigm, typename T , more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | GetTraitRef () const |
Get a trait reference of a certain type. | |
template<typename T , EParadigm Paradigm = DefaultParadigm, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | GetTraitRef () const |
Get a trait reference of a certain type. | |
template<EParadigm Paradigm, typename T > | |
TOutcome< Paradigm, T > | GetTrait () const |
Get a trait copy of a certain type. | |
template<typename T , EParadigm Paradigm = DefaultParadigm> | |
auto | GetTrait () const |
Get a trait copy of a certain type. | |
template<EParadigm Paradigm = DefaultParadigm> | |
TOutcome< Paradigm > | GetTrait (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const |
Get a trait of a certain type. | |
template<EParadigm Paradigm, typename T > | |
TOutcome< Paradigm > | GetTrait (T &OutTraitData, const bool bTraitDataInitialized=true) const |
Get a trait of a certain type. | |
template<typename T , EParadigm Paradigm = DefaultParadigm> | |
auto | GetTrait (T &OutTraitData, const bool bTraitDataInitialized=true) const |
Get a trait of a certain type. | |
template<EParadigm Paradigm, typename T , int32 TraitLineIndex> | |
TOutcome< Paradigm, T > | TraitAtLine () const |
Get a copy of a trait of a certain type with an index hint. | |
template<EParadigm Paradigm, typename T , int32 TraitLineIndex, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | TraitPtrAtLine () const |
Get a pointer to a trait of a certain type with an index hint. | |
template<EParadigm Paradigm, typename T , int32 TraitLineIndex, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | TraitRefAtLine () const |
Get a trait of a certain type with an index hint. | |
template<EParadigm Paradigm = DefaultParadigm, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitVoidPtrResult< Paradigm > > | GetTraitPtrHinted (UScriptStruct *const TraitType, const int32 TraitIndexHint) const |
Get a pointer to a trait of a certain type with an index hint. | |
template<EParadigm Paradigm, typename T , more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | GetTraitPtrHinted (const int32 TraitIndexHint) const |
Get a pointer to a trait of a certain type with an index hint. | |
template<typename T , EParadigm Paradigm = DefaultParadigm, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | GetTraitPtrHinted (const int32 TraitIndexHint) const |
Get a pointer to a trait of a certain type with an index hint. | |
template<EParadigm Paradigm, typename T , more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | GetTraitRefHinted (const int32 TraitIndexHint) const |
Get a trait of a certain type with an index hint. | |
template<typename T , EParadigm Paradigm = DefaultParadigm, more::enable_if_t< IsUnsafe(Paradigm)||AllowsDirectTraitAccess, int > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | GetTraitRefHinted (const int32 TraitIndexHint) const |
Get a trait of a certain type with an index hint. | |
template<EParadigm Paradigm, typename T > | |
TOutcome< Paradigm, T > | GetTraitHinted (const int32 TraitIndexHint) const |
Get a copy of a trait of a certain type with an index hint. | |
template<typename T , EParadigm Paradigm = DefaultParadigm> | |
TOutcome< Paradigm, T > | GetTraitHinted (const int32 TraitIndexHint) const |
Get a copy of a trait of a certain type with an index hint. | |
template<EParadigm Paradigm = DefaultParadigm> | |
TOutcome< Paradigm > | 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. | |
template<EParadigm Paradigm = DefaultParadigm, typename T = void> | |
TOutcome< Paradigm > | GetTraitHinted (const int32 TraitIndexHint, T &OutTraitData, const bool bTraitDataInitialized=true) const |
Get a trait of a certain type with an index hint. | |
template<EParadigm Paradigm = DefaultParadigm> | |
TOutcome< Paradigm, UDetail * > | GetDetailHinted (const TSubclassOf< UDetail > DetailClass, const int32 DetailIndexHint) const |
Get a detail of a certain class at an index hinted. | |
template<EParadigm Paradigm, class D , TDetailPtrResultSecurity< D > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< D > > | GetDetailHinted (const int32 DetailIndexHint) const |
Get a detail of a certain class at an index hinted. | |
template<class D , EParadigm Paradigm = DefaultParadigm> | |
auto | GetDetailHinted (const int32 DetailIndexHint) const |
Get a detail of a certain class at an index hinted. | |
template<EParadigm Paradigm = DefaultParadigm, TDetailPtrResultSecurity< UDetail > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< UDetail > > | GetDetail (const TSubclassOf< UDetail > DetailClass) const |
Get a detail of a certain class. | |
template<EParadigm Paradigm, class D , TDetailPtrResultSecurity< D > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< D > > | GetDetail () const |
Get a detail of a certain class. | |
template<class D , EParadigm Paradigm = DefaultParadigm, TDetailPtrResultSecurity< D > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< D > > | GetDetail () const |
Get a detail of a certain class. | |
template<EParadigm Paradigm = DefaultParadigm, TDetailPtrResultSecurity< UDetail > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< UDetail > > | DetailAtLine (const int32 LineIndex) const |
Get a detail at a certain line index. | |
template<class P > | |
constexpr int32 | IndexOfPart () const |
Find a hinting index for a part. | |
template<typename PartT > | |
PartT | GetPart () const |
Get a part (trait, detail, subject, other) of the current slot by its type. | |
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. | |
TCursor (const TChain *const InOwner, const int32 InOffset=0, const int32 InLimit=TNumericLimits< int32 >::Max()) | |
Initialize a new cursor instance for a chain. | |
TCursor (TCursor &&InCursor) | |
Move-initialize a cursor. | |
TCursor (const TCursor &InCursor) | |
Copy-initialize a cursor. | |
template<typename ... OtherPs> | |
TCursor (const TCursor< OtherPs... > &InCursor) | |
Copy-initialize a cursor from an another cursor type. | |
TCursor () | |
Initialize a new invalid cursor. | |
~TCursor () | |
Finalize the cursor. | |
Public Member Functions inherited from FCommonChain::FCommonCursor | |
const FCommonChain * | GetOwner () const |
Get the owning chain of the cursor. | |
int32 | GetChainSlotIndex () const |
Get the global (chain-relative) index of the current slot. | |
bool | IsLimitReached () const |
Check if the iterating limit was reached. | |
bool | ShouldStop () const |
Check if the cursor should stop iterating. | |
Static Public Attributes | |
static constexpr auto | ChunkItIndex = IteratorType::template IndexOfType<ChunkItType>() |
The index of the chunk iterator within the variant type. | |
static constexpr auto | BeltItIndex = IteratorType::template IndexOfType<BeltItType>() |
The index of the belt iterator within the variant type. | |
Friends | |
template<typename... OtherPs> | |
struct | TCursor |
Additional Inherited Members | |
Protected Member Functions inherited from FCommonChain::FCommonCursor | |
FCommonCursor (const FCommonChain *const InOwner, const int32 InOffset=0, const int32 InLimit=TNumericLimits< int32 >::Max()) | |
Initialize a new cursor instance for a chain. | |
FCommonCursor (FCommonCursor &&InCursor) | |
Move-initialize a cursor. | |
FCommonCursor (const FCommonCursor &InCursor) | |
Copy-initialize a cursor. | |
FCommonCursor () | |
Initialize a new invalid cursor. | |
virtual | ~FCommonCursor () |
Finalize the cursor. | |
Protected Attributes inherited from FCommonChain::FCommonCursor | |
const FCommonChain * | Owner = nullptr |
The owner of the cursor. | |
int32 | Offset = 0 |
The chain slot index offset to begin with. | |
int32 | Limit = TNumericLimits<int32>::Max() |
The maximum number of slots to iterate by. | |
int32 | SlotIndex = InvalidSlotIndex |
The current local slot index. | |
int32 | SegmentIndex = InvalidSegmentIndex |
The index of the currently iterated chain segment. | |
A state of the chain iterating.
Cursors also unify the component hinting indices across different chunks/belts.
Ps | The predefined types of parts to obtain efficiently while iterating. |
using TChain< ChunkItT, BeltItT, InDefaultParadigm >::TCursor< Ps >::CursorSuper = FCommonCursor |
The base cursor type.
typedef TVariant<FEmptyVariantState, ChunkItType, BeltItType> TChain< ChunkItT, BeltItT, InDefaultParadigm >::TCursor< Ps >::IteratorType |
The common iterator type.
|
inline |
Initialize a new cursor instance for a chain.
InOwner | The owner of the cursor to iterate. |
InOffset | The slot offset of the cursor to begin with. |
InLimit | The maximum number of slots to iterate by. |
|
inline |
Move-initialize a cursor.
|
inline |
Copy-initialize a cursor.
InCursor | The original cursor to copy. |
|
inline |
Copy-initialize a cursor from an another cursor type.
InCursor | The original cursor to copy. |
|
inline |
Initialize a new invalid cursor.
|
inline |
Finalize the cursor.
|
inline |
Advance the iterator to the next slot.
|
inline |
Begin iterating with the cursor using the current range.
|
inline |
Begin iterating with the cursor using the supplied range.
InOffset | The slot offset to begin iterating with. |
InLimit | The maximum number of slots to iterate by. |
|
inline |
Get a detail at a certain line index.
Paradigm | The paradigm to work under. |
LineIndex | The detail line index. |
|
inline |
Get a detail of a certain class.
Statically typed version.
Paradigm | The paradigm to work under. |
D | The class of detail to get. May be a base class. |
|
inline |
Get a detail of a certain class.
Statically typed default paradigm version.
D | The class of detail to get. May be a base class. |
Paradigm | The paradigm to work under. |
|
inline |
Get a detail of a certain class.
Paradigm | The paradigm to work under. |
DetailClass | The class of detail to get. May be a base class. |
|
inline |
Get a detail of a certain class at an index hinted.
Templated version.
The detail index hint is relative to the parts pack or the detailmark of the filter.
Paradigm | The paradigm to work under. |
D | The class of the detail to get. |
DetailIndexHint | The hinting detail index. |
|
inline |
Get a detail of a certain class at an index hinted.
Templated version.
The detail index hint is relative to the parts pack or the detailmark of the filter.
D | The class of the detail to get. |
Paradigm | The paradigm to work under. |
DetailIndexHint | The hinting detail index. |
|
inline |
Get a detail of a certain class at an index hinted.
The detail index hint is relative to the parts pack or the detailmark of the filter.
Paradigm | The paradigm to work under. |
DetailClass | The class of the detail to get. |
DetailIndexHint | The hinting detail index. |
|
inline |
Get the target sequence class.
|
inline |
Get the owning chain of the cursor.
|
inline |
Get a part (trait, detail, subject, other) of the current slot by its type.
Templated version.
If the specified part type is also within the cursor's specified parts list, the method is performed using a fast hinting.
PartT | The type of the part to get. Can be a value. a reference or a pointer. |
|
inline |
Get a part (trait, detail, subject, other) of the current slot by its type with an index hint.
Templated version.
PartT | The type of the part to get. Can be a value, a reference or a pointer. |
PartIndexHint | A component index hint, corresponding to an index within the locking filter. |
|
inlineconstexpr |
Get the current size of the hinting mapping.
This size is dependent on what is actually used as a mapping basis, i.e. a template pack of parts or a current filter's traitmark/detailmark.
|
inline |
Get the subject of the current iteration.
|
inline |
Get the subjective of the current iteration of the cursor.
|
inline |
Get a trait copy of a certain type.
Paradigm | The paradigm to work under. |
T | The type of the trait to get. |
|
inline |
Get a trait copy of a certain type.
T | The type of the trait to get. |
Paradigm | The paradigm to work under. |
|
inline |
Get a trait of a certain type.
Templated version.
|
inline |
Get a trait of a certain type.
Templated version.
|
inline |
Get a trait of a certain type.
|
inline |
Get a copy of a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a copy of a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a trait of a certain type with an index hint.
Templated version.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a trait pointer of a certain type.
Templated version.
Paradigm | The security paradigm to use. |
T | The type of the trait to get. |
|
inline |
Get a trait pointer of a certain type.
Templated version.
T | The type of the trait to get. |
Paradigm | The security paradigm to use. |
|
inline |
Get a trait pointer of a certain type at the current cursor position.
Paradigm | The security paradigm to use. |
|
inline |
Get a pointer to a trait of a certain type with an index hint.
Templated version.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a pointer to a trait of a certain type with an index hint.
Templated version.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a pointer to a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a trait reference of a certain type.
|
inline |
Get a trait reference of a certain type.
|
inline |
Get a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inlineconstexpr |
Find a hinting index for a part.
If there's a template part pack it will be used as a basis for the index. Otherwise, the current filter's traitmark/detailmark will be used instead.
P | The class of the part to find an index of. |
INDEX_NONE
, if it was not found for hinting.
|
inline |
Check if the cursor is viable and has not finished the iterating.
|
inline |
Check if the cursor is viable.
|
inline |
Copy a cursor.
|
inline |
Move a cursor.
|
inline |
Begin or advance iterating the chain using this cursor.
false
if the iterating should be ended.
|
inline |
Remap a part index hint using the current mapping.
|
inline |
Detach the cursor from the chain making it an invalid one.
The cursor will also release its owning chain as/if needed.
|
inline |
Get a copy of a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a pointer to a trait of a certain type with an index hint.
Templated version.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
inline |
Get a trait of a certain type with an index hint.
The trait index hint is relative to the parts pack or the traitmark of the filter.
|
friend |
|
staticconstexpr |
The index of the belt iterator within the variant type.
|
staticconstexpr |
The index of the chunk iterator within the variant type.