Apparatus
Version 1.23
ECS data-oriented workflow for Unreal Engine.
|
A generic chunk's iterator base. More...
#include <ChunkIt.h>
Public Types | |
typedef SubjectHandleT | SubjectHandleType |
The type of the subject handle used. | |
typedef SubjectHandleType::SubjectivePtrType | SubjectivePtrType |
The compatible type of the subjective used. | |
Public Member Functions | |
bool | IsLocking () const |
Check if the iterator is currently locking its chunk. | |
UChunk * | GetChunk () const |
Get the chunk of the iterator. | |
const FFilter & | GetFilter () const |
Get the filter of the iterator. | |
int32 | GetSlotIndex () const |
Get the current chunk's slot index. | |
UChunk * | GetIterationChunk () const |
Get the real working chunk of the current iteration. | |
EApparatusStatus | GetSubject (SubjectHandleT &OutSubject) const |
Get the subject from the chunk iterator. | |
SubjectHandleT | GetSubject () const |
Get a subject from the chunk iterator. | |
const FFingerprint & | GetFingerprint () const |
Get the subject fingerprint from the chunk iterator. | |
UObject * | GetSubjectiveObject () const |
Get the currently iterated subjective object (if available). | |
SubjectivePtrType | GetSubjective () const |
Get a subjective from the chunk iterator (if any). | |
void | MoveToEnd () |
Move the iterator to the end of the chunk. | |
void | Reset () |
Clear the iterator to a null-state. | |
bool | IsViable () const |
Check if the iterator is valid and is not at the end of the chunk. | |
operator bool () const | |
Check if the iterator is valid and is not at the end of the chunk. | |
TChunkIt & | operator= (TChunkIt &&Iterator) |
Move an iterator. | |
TChunkIt & | operator= (const TChunkIt &Iterator) |
Set the iterator equal to an another one. | |
EApparatusStatus | Advance () |
Move iterator to the next place (if available). | |
~TChunkIt () | |
Destroy the chunk iterator. | |
Traits Data Access | |
template<EParadigm Paradigm = EParadigm::Default, TTraitVoidPtrResultSecurity< Paradigm > = 0> | |
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 reference 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 reference of a certain type from a currently iterated subject. | |
template<EParadigm Paradigm = EParadigm::Default, typename T > | |
TOutcome< Paradigm, T > | TraitAtLine (const int32 TraitLineIndex) const |
Get a trait pointer at a line index from a currently iterated subject. | |
template<EParadigm Paradigm = EParadigm::Default, TTraitVoidPtrResultSecurity< Paradigm > = 0> | |
TOutcome< Paradigm, TTraitVoidPtrResult< Paradigm > > | TraitPtrAtLine (UScriptStruct *TraitType, const int32 TraitLineIndex) const |
Get a trait pointer at a line index from a currently iterated subject. | |
template<EParadigm Paradigm, typename T , TTraitPtrResultSecurity< Paradigm, T > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | TraitPtrAtLine (const int32 TraitLineIndex) const |
Get a trait pointer at a line index from a currently iterated subject. | |
template<EParadigm Paradigm, typename T , TTraitRefResultSecurity< Paradigm, T > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | TraitRefAtLine (const int32 TraitLineIndex) const |
Get a trait reference at a line index 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, T > | 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. | |
Details Getting | |
template<EParadigm Paradigm = EParadigm::Default, TDetailPtrResultSecurity< UDetail > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< UDetail > > | GetDetail (const TSubclassOf< UDetail > DetailClass) const |
Get a detail of a certain class from a currently iterated subject. | |
template<EParadigm Paradigm, class D , TDetailPtrResultSecurity< D > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< D > > | GetDetail () const |
Get a detail of a certain class from a currently iterated subject. | |
template<class D , EParadigm Paradigm = EParadigm::Default, TDetailPtrResultSecurity< D > = 0> | |
TOutcome< Paradigm, TDetailPtrResult< D > > | GetDetail () const |
Get a detail of a certain class from a currently iterated subject. | |
Hinted Traits Getting | |
int32 | HintTrait (UScriptStruct *const TraitType) const |
Get the hinting index of a trait. | |
template<typename T > | |
constexpr int32 | HintTrait () const |
Get the hinting index of a trait. | |
template<EParadigm Paradigm = EParadigm::Default, TTraitVoidPtrResultSecurity< Paradigm > = 0> | |
TOutcome< Paradigm, TTraitVoidPtrResult< Paradigm > > | GetTraitPtrHinted (UScriptStruct *const TraitType, const int32 TraitIndexHint) const |
Get a trait pointer at a hinted index from a currently iterated subject. | |
template<EParadigm Paradigm, typename T , TTraitPtrResultSecurity< Paradigm, T > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | GetTraitPtrHinted (const int32 TraitIndexHint) const |
Get a trait pointer at a hinted index from a currently iterated subject. | |
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitPtrResultSecurity< Paradigm, T > = 0> | |
TOutcome< Paradigm, TTraitPtrResult< Paradigm, T > > | GetTraitPtrHinted (const int32 TraitIndexHint) const |
Get a trait pointer at a hinted index from a currently iterated subject. | |
template<EParadigm Paradigm, typename T , TTraitRefResultSecurity< Paradigm, T > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | GetTraitRefHinted (const int32 TraitIndexHint) const |
Get a trait reference at a hinted index from a currently iterated subject. | |
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitRefResultSecurity< Paradigm, T > = 0> | |
TOutcome< Paradigm, TTraitRefResult< Paradigm, T > > | GetTraitRefHinted (const int32 TraitIndexHint) const |
Get a trait reference at a hinted index from a currently iterated subject. | |
template<EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm > | GetTraitHinted (UScriptStruct *const TraitType, const int32 TraitIndexHint, void *const OutTraitData, const bool bTraitDataInitialized=true) const |
Get a trait at index from a currently iterated subject. | |
template<EParadigm Paradigm, typename T > | |
TOutcome< Paradigm, T > | GetTraitHinted (const int32 TraitIndexHint) const |
Get a copy of a trait at a hinted index from a currently iterated subject. | |
template<typename T , EParadigm Paradigm = EParadigm::Default> | |
TOutcome< Paradigm, T > | GetTraitHinted (const int32 TraitIndexHint) const |
Get a copy of a trait at a hinted index from a currently iterated subject. | |
Initialization | |
TChunkIt () | |
Initialize an empty chunk iterator. | |
TChunkIt (TChunkIt &&Iterator) | |
Move-initialize a chunk iterator. | |
TChunkIt (const TChunkIt &Iterator) | |
Initialize a chunk iterator as a copy of another 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 = FSubjectInfo::InvalidSlotIndex |
Invalid subject index. | |
static constexpr auto | InvalidTraitIndex = UChunk::InvalidTraitLineIndex |
Invalid trait index. | |
Friends | |
class | UChunk |
template<typename ChunkItT , typename BeltItT , EParadigm Paradigm> | |
struct | TChain |
A generic chunk's iterator base.
Can be a solid or an ordinary mutable iterator.
StructHandleT | The type of the subject handle. |
typedef SubjectHandleT TChunkIt< SubjectHandleT >::SubjectHandleType |
The type of the subject handle used.
typedef SubjectHandleType::SubjectivePtrType TChunkIt< SubjectHandleT >::SubjectivePtrType |
The compatible type of the subjective used.
|
inline |
Initialize an empty chunk iterator.
|
inline |
Move-initialize a chunk iterator.
|
inline |
Initialize a chunk iterator as a copy of another iterator.
Destroy the chunk iterator.
|
inline |
Move iterator to the next place (if available).
Get the chunk of the iterator.
When an iterator comes to an end of a chunk it still persists this state value, unless cleared with Reset().
|
inline |
Get a detail of a certain class from a currently iterated subject.
Paradigm | The paradigm to work under. |
D | The class of the detail to get. |
|
inline |
Get a detail of a certain class from a currently iterated subject.
D | The class of the detail to get. |
Paradigm | The paradigm to work under. |
|
inline |
Get a detail of a certain class from a currently iterated subject.
Paradigm | The paradigm to work under. |
DetailClass | The class of the detail to get. |
|
inline |
Get the filter of the iterator.
|
inline |
Get the subject fingerprint from the chunk iterator.
Gets the fingerprint of the subject that is currently pointed by the chunk iterator.
|
inline |
Get the real working chunk of the current iteration.
If the current subject is removed from the iterated chunk, its actual present chunk is returned.
If the subject is despawned completely the current chunk is removed for safety.
|
inline |
Get the current chunk's slot index.
|
inline |
Get a subject from the chunk iterator.
Get a subject that is currently pointed by the chunk iterator.
|
inline |
Get the subject from the chunk iterator.
Get the active subject that is currently pointed by the chunk iterator.
OutSubject | The subject handle receiver. |
|
inline |
Get a subjective from the chunk iterator (if any).
Get a subjective that is currently pointed by the chunk iterator if there is any associated with a subject.
nullptr
, if there is none.
|
inline |
Get the currently iterated subjective object (if available).
|
inline |
Get a copy of a trait of a certain type from a currently iterated subject.
Paradigm | The paradigm to work under. |
T | The type of the trait to get. |
|
inline |
Get a copy of a trait of a certain type from a currently iterated subject.
T | The type of the trait to get. |
Paradigm | The paradigm to work under. |
|
inline |
Get a trait of a certain type from a currently iterated subject.
Paradigm | The paradigm to work under. |
[in] | TraitType | The type of the trait to get. |
[out] | OutTraitData | The trait data receiver. |
[in] | bTraitDataInitialized | Is the OutTraitData buffer actually initialized? |
|
inline |
Get a copy of a trait at a hinted index from a currently iterated subject.
Gets a trait from a currently iterated subject with its hinted index, relative to the current chunk-locking filter's traitmark.
Paradigm | The paradigm to work under. |
T | The type of trait to get. |
TraitIndexHint | The index of the trait to hint with. Relative to the current's filter traitmark. |
|
inline |
Get a copy of a trait at a hinted index from a currently iterated subject.
Gets a trait from a currently iterated subject with its hinted index, relative to the current chunk-locking filter's traitmark.
T | The type of trait to get. |
Paradigm | The paradigm to work under. |
TraitIndexHint | The index of the trait to hint with. Relative to the current's filter traitmark. |
|
inline |
Get a trait at index from a currently iterated subject.
Gets a trait from a currently iterated subject by its index, relative to the current chunk-locking filter's traitmark.
TraitType | The type of the trait to get. |
TraitIndexHint | The hinting index for the trait to get. Relative to the current's filter traitmark. |
OutTraitData | The trait data receiver. |
bTraitDataInitialized | Is the OutTraitData buffer actually initialized? |
|
inline |
Get a pointer to a trait of a certain type from a currently iterated subject.
Templated version.
Paradigm | The safety paradigm to use. |
T | The type of the trait to get. |
|
inline |
Get a pointer to a trait of a certain type from a currently iterated subject.
Templated version.
T | The type of the trait to get. |
Paradigm | The safety paradigm to use. |
|
inline |
Get a trait of a certain type from a currently iterated subject.
Can be used during the solid iterating only.
Paradigm | The safety paradigm to use. |
TraitType | The type of the trait to get. |
|
inline |
Get a trait pointer at a hinted index from a currently iterated subject.
Templated version.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
Paradigm | The access safety paradigm. |
T | The type of the trait to get. |
TraitIndexHint | The index hinting of the trait to get. |
|
inline |
Get a trait pointer at a hinted index from a currently iterated subject.
Templated version.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
T | The type of the trait to get. |
Paradigm | The access safety paradigm. |
TraitIndexHint | The index hinting of the trait to get. |
|
inline |
Get a trait pointer at a hinted index from a currently iterated subject.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
Paradigm | The access safety paradigm. |
TraitType | The type of the trait to get. |
TraitIndexHint | The index hinting of the trait to get. |
|
inline |
Get a trait reference of a certain type from a currently iterated subject.
Paradigm | The access safety paradigm. |
T | The type of the trait to get. |
|
inline |
Get a trait reference of a certain type from a currently iterated subject.
T | The type of the trait to get. |
Paradigm | The access safety paradigm. |
|
inline |
Get a trait reference at a hinted index from a currently iterated subject.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
Paradigm | The access safety paradigm. |
T | The type of trait to get. Must be a USTRUCT-type. |
TraitIndexHint | The index hint of the trait to get. |
|
inline |
Get a trait reference at a hinted index from a currently iterated subject.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
T | The type of trait to get. Must be a USTRUCT-type. |
Paradigm | The access safety paradigm. |
TraitIndexHint | The index hint of the trait to get. |
|
inlineconstexpr |
Get the hinting index of a trait.
Templated version.
INDEX_NONE
in that case.T | The trait type to query for. |
|
inline |
Get the hinting index of a trait.
TraitType | The trait type to query for. |
Check if the iterator is currently locking its chunk.
Check if the iterator is valid and is not at the end of the chunk.
|
inline |
Move the iterator to the end of the chunk.
This basically unlocks the locked chunk.
Check if the iterator is valid and is not at the end of the chunk.
|
inline |
Set the iterator equal to an another one.
|
inline |
Move an iterator.
|
inline |
Clear the iterator to a null-state.
|
inline |
Get a trait pointer at a line index from a currently iterated subject.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
Paradigm | The access safety paradigm. |
T | the typ of the trait to get. |
TraitLineIndex | The index of the trait line. |
|
inline |
Get a trait pointer at a line index from a currently iterated subject.
Templated version.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
Paradigm | The access safety paradigm. |
T | The type of the trait to get. |
TraitLineIndex | The index of the trait line to get from. |
|
inline |
Get a trait pointer at a line index from a currently iterated subject.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
Paradigm | The access safety paradigm. |
TraitType | The type of the trait to get. |
TraitLineIndex | The index of the trait line. |
|
inline |
Get a trait reference at a line index from a currently iterated subject.
Templated version.
Gets a trait from a currently iterated subject by its index, relative to the current chunk's traitmark.
Paradigm | The access safety paradigm. |
T | The type of the trait to get. |
TraitLineIndex | The index of the trait line to get from. |
|
friend |
|
friend |
|
staticconstexpr |
Is the subject of a mutable semantics.
|
staticconstexpr |
The direct trait data access status.
|
staticconstexpr |
Are structural changes (adding/removing components) allowed?
|
staticconstexpr |
Invalid subject index.
|
staticconstexpr |
Invalid trait index.
|
staticconstexpr |
The solidity state of the chunk iterator.