Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
TChunkProxy< SubjectHandleT, Ts > Struct Template Reference

A strongly typed chunk proxy. More...

#include <ChunkProxy.h>

Public Types

template<EParadigm Paradigm>
using TTraitVoidPtrResult = typename SubjectHandleT::template TTraitVoidPtrResult< Paradigm >
 The type of a trait void pointer returned by the methods.
 
template<EParadigm Paradigm, typename T >
using TTraitPtrResult = typename SubjectHandleT::template TTraitPtrResult< Paradigm, T >
 The type of a trait pointer returned by the methods.
 
template<EParadigm Paradigm, typename T >
using TTraitRefResult = typename SubjectHandleT::template TTraitRefResult< Paradigm, T >
 The type of a trait reference returned by the methods.
 
template<class D >
using TDetailPtrResult = typename SubjectHandleT::template TDetailPtrResult< D >
 The class of a detail pointer returned by the methods.
 

Public Member Functions

virtual ~TChunkProxy ()
 
Slots
const FChunkSlotAt (const int32 SlotIndex) const
 Get a slot at a certain position.
 
std::conditional_t< AllowsChanges, FChunkSlot &, const FChunkSlot & > At (const int32 SlotIndex)
 Get a slot at a certain position.
 
const FChunkSlotoperator[] (const int32 SlotIndex) const
 Get a slot at a certain position.
 
std::conditional_t< AllowsChanges, FChunkSlot &, const FChunkSlot & > operator[] (const int32 SlotIndex)
 Get a slot at a certain position.
 
bool IsStaleAt (const int32 SlotIndex) const
 Check if the slot is actually stale at a certain position.
 
Subjects
SubjectHandleT SubjectAt (const int32 SlotIndex) const
 Get a subject at a certain index within the chunk.
 
const FFingerprintSubjectFingerprintAt (const int32 SlotIndex) const
 Get a subject's fingerprint at a specific slot index.
 
EFlagmark SubjectFlagmarkAt (const int32 SlotIndex) const
 Get a subject's flagmark at a specific slot index.
 
bool HasSubjectFlagAt (const int32 SlotIndex, const EFlagmarkBit Flag) const
 Check a subject's flag at a specific slot index.
 
template<EParadigm Paradigm = EParadigm::Safe>
EFlagmark SetSubjectFlagmarkAt (const int32 SlotIndex, const EFlagmark Flagmark) const
 Set a subject's flagmark at a specific slot index.
 
template<EParadigm Paradigm = EParadigm::Safe>
EFlagmark SetSubjectFlagmarkMaskedAt (const int32 SlotIndex, const EFlagmark Flagmark, const EFlagmark Mask)
 Set the masked flagmark for the subject.
 
template<EParadigm Paradigm = EParadigm::Safe>
bool SetSubjectFlagAt (const int32 SlotIndex, const EFlagmarkBit Flag, const bool bState=true) const
 Set a subject's flag at a specific slot index.
 
template<EParadigm Paradigm = EParadigm::Safe>
bool ToggleSubjectFlagAt (const int32 SlotIndex, const EFlagmarkBit Flag) const
 Toggle a subject's flag at a specific slot index.
 
Traits Access
template<typename T >
T TraitAt (const int32 SlotIndex) const
 Get a trait from the chunk at a certain subject index.
 
template<typename T >
EApparatusStatus TraitAt (const int32 SlotIndex, T &OutStruct, const bool bStructInitialized=true) const
 Get a trait from the chunk at a certain subject index.
 
Traits Data Access
template<EParadigm Paradigm, typename T >
TTraitRefResult< Paradigm, const TTraitRefAt (const int32 SlotIndex) const
 Get the trait reference from the chunk.
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitRefResult< Paradigm, const TTraitRefAt (const int32 SlotIndex) const
 Get the trait reference from the chunk.
 
template<EParadigm Paradigm, typename T >
TTraitRefResult< Paradigm, TTraitRefAt (const int32 SlotIndex)
 Get the trait reference from the chunk.
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitRefResult< Paradigm, TTraitRefAt (const int32 SlotIndex)
 Get the trait reference from the chunk.
 
template<EParadigm Paradigm, typename T >
TTraitPtrResult< Paradigm, const TTraitPtrAt (const int32 Index) const
 Get the trait pointer from the chunk.
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitPtrResult< Paradigm, const TTraitPtrAt (const int32 Index) const
 Get the trait pointer from the chunk.
 
template<EParadigm Paradigm, typename T >
TTraitPtrResult< Paradigm, TTraitPtrAt (const int32 Index)
 Get the trait pointer from the chunk.
 
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitPtrResult< Paradigm, TTraitPtrAt (const int32 Index)
 Get the trait pointer from the chunk.
 
Iterating
int32 Num () const
 Get the total number of slots currently in the iterable.
 
int32 IterableNum () const
 Get the current number of elements valid for iterating.
 
Locking & Unlocking
EApparatusStatus Lock ()
 Lock the chunk for iterating.
 
EApparatusStatus Unlock ()
 Unlock the chunk from iterating.
 
Initialization
 TChunkProxy (UChunk *const InTarget, const bool bLock=false)
 Initialize a new proxy for a chunk.
 
 TChunkProxy (const TChunkProxy &InProxyChunk)
 Copy a proxy chunk.
 
 TChunkProxy (TChunkProxy &&InProxyChunk)
 Move a proxy chunk.
 

Static Public Attributes

static constexpr auto AllowsChanges = SubjectHandleT::AllowsChanges
 Should subject changes be allowed.
 
static constexpr auto AllowsStructuralChanges = SubjectHandleT::AllowsStructuralChanges
 Should structural (adding/removing traits) subject changes be allowed.
 
static constexpr auto AllowsDirectTraitAccess = SubjectHandleT::AllowsDirectTraitAccess
 Can the trait data be accessed directly?
 
static constexpr auto ShouldLockSolid = SubjectHandleT::IsHandleSolid()
 Is the chunk a solid-locking one?
 
static constexpr EParadigm DefaultParadigm = ParadigmCombine<Ts...>()
 The security paradigm to use by default.
 

Detailed Description

template<typename SubjectHandleT, typename... Ts>
struct TChunkProxy< SubjectHandleT, Ts >

A strongly typed chunk proxy.

Template Parameters
SubjectHandleTThe subject handle to utilize.
ParadigmThe access security paradigm to use.
TsThe types of traits to proxy. Some of them may actually be missing from the target chunk. May include the TParadigm specifications.

Member Typedef Documentation

◆ TDetailPtrResult

template<typename SubjectHandleT , typename... Ts>
template<class D >
using TChunkProxy< SubjectHandleT, Ts >::TDetailPtrResult = typename SubjectHandleT::template TDetailPtrResult<D>

The class of a detail pointer returned by the methods.

Template Parameters
DThe class of the detail.

◆ TTraitPtrResult

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm, typename T >
using TChunkProxy< SubjectHandleT, Ts >::TTraitPtrResult = typename SubjectHandleT::template TTraitPtrResult<Paradigm, T>

The type of a trait pointer returned by the methods.

Template Parameters
TThe type of the trait.
ParadigmThe access safety paradigm.

◆ TTraitRefResult

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm, typename T >
using TChunkProxy< SubjectHandleT, Ts >::TTraitRefResult = typename SubjectHandleT::template TTraitRefResult<Paradigm, T>

The type of a trait reference returned by the methods.

Template Parameters
TThe type of the trait.
ParadigmThe access safety paradigm.

◆ TTraitVoidPtrResult

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm>
using TChunkProxy< SubjectHandleT, Ts >::TTraitVoidPtrResult = typename SubjectHandleT::template TTraitVoidPtrResult<Paradigm>

The type of a trait void pointer returned by the methods.

Template Parameters
ParadigmThe access safety paradigm.

Constructor & Destructor Documentation

◆ TChunkProxy() [1/3]

template<typename SubjectHandleT , typename... Ts>
TChunkProxy< SubjectHandleT, Ts >::TChunkProxy ( UChunk *const  InTarget,
const bool  bLock = false 
)
inline

Initialize a new proxy for a chunk.

Parameters
InTargetThe chunk to proxy.
bLockShould the target chunk be locked.

◆ TChunkProxy() [2/3]

template<typename SubjectHandleT , typename... Ts>
TChunkProxy< SubjectHandleT, Ts >::TChunkProxy ( const TChunkProxy< SubjectHandleT, Ts > &  InProxyChunk)
inline

Copy a proxy chunk.

Parameters
InProxyChunkThe proxy chunk to copy.

◆ TChunkProxy() [3/3]

template<typename SubjectHandleT , typename... Ts>
TChunkProxy< SubjectHandleT, Ts >::TChunkProxy ( TChunkProxy< SubjectHandleT, Ts > &&  InProxyChunk)
inline

Move a proxy chunk.

Parameters
InProxyChunkThe proxy chunk to move.

◆ ~TChunkProxy()

template<typename SubjectHandleT , typename... Ts>
virtual TChunkProxy< SubjectHandleT, Ts >::~TChunkProxy ( )
inlinevirtual

Member Function Documentation

◆ At() [1/2]

template<typename SubjectHandleT , typename... Ts>
std::conditional_t< AllowsChanges, FChunkSlot &, const FChunkSlot & > TChunkProxy< SubjectHandleT, Ts >::At ( const int32  SlotIndex)
inline

Get a slot at a certain position.

◆ At() [2/2]

template<typename SubjectHandleT , typename... Ts>
const FChunkSlot & TChunkProxy< SubjectHandleT, Ts >::At ( const int32  SlotIndex) const
inline

Get a slot at a certain position.

Constant version.

◆ HasSubjectFlagAt()

template<typename SubjectHandleT , typename... Ts>
bool TChunkProxy< SubjectHandleT, Ts >::HasSubjectFlagAt ( const int32  SlotIndex,
const EFlagmarkBit  Flag 
) const
inline

Check a subject's flag at a specific slot index.

The operation is thread-safe and atomic.

The method is cache efficient during the iterating process, cause the flagmarks are stored within the chunk slots.

Parameters
SlotIndexThe index of the subject slot to examine.
FlagThe flag to test.
Returns
The state of the flag.
See also
SetSubjectFlagAt(const int32, const EFlagmarkBit, const bool)

◆ IsStaleAt()

template<typename SubjectHandleT , typename... Ts>
bool TChunkProxy< SubjectHandleT, Ts >::IsStaleAt ( const int32  SlotIndex) const
inline

Check if the slot is actually stale at a certain position.

Stale slots should generally be skipped during the iterating process.

◆ IterableNum()

template<typename SubjectHandleT , typename... Ts>
int32 TChunkProxy< SubjectHandleT, Ts >::IterableNum ( ) const
inline

Get the current number of elements valid for iterating.

Note
This number includes the stale (to be skipped) slots also.

◆ Lock()

template<typename SubjectHandleT , typename... Ts>
EApparatusStatus TChunkProxy< SubjectHandleT, Ts >::Lock ( )
inline

Lock the chunk for iterating.

See also
Unlock()

◆ Num()

template<typename SubjectHandleT , typename... Ts>
int32 TChunkProxy< SubjectHandleT, Ts >::Num ( ) const
inline

Get the total number of slots currently in the iterable.

Note
Returns the active iterable slots number when the iterable is locked, which also includes the stale (to be skipped) slots.
Returns
The current number of slots.

◆ operator[]() [1/2]

template<typename SubjectHandleT , typename... Ts>
std::conditional_t< AllowsChanges, FChunkSlot &, const FChunkSlot & > TChunkProxy< SubjectHandleT, Ts >::operator[] ( const int32  SlotIndex)
inline

Get a slot at a certain position.

◆ operator[]() [2/2]

template<typename SubjectHandleT , typename... Ts>
const FChunkSlot & TChunkProxy< SubjectHandleT, Ts >::operator[] ( const int32  SlotIndex) const
inline

Get a slot at a certain position.

Constant version.

◆ SetSubjectFlagAt()

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm = EParadigm::Safe>
bool TChunkProxy< SubjectHandleT, Ts >::SetSubjectFlagAt ( const int32  SlotIndex,
const EFlagmarkBit  Flag,
const bool  bState = true 
) const
inline

Set a subject's flag at a specific slot index.

The operation is thread-safe and atomic.

The method is cache efficient during the iterating process, cause the flagmarks are stored within the chunk slots.

Template Parameters
ParadigmThe safety paradigm to utilize.
Parameters
SlotIndexThe index of the subject slot to examine.
FlagThe flag to set or reset.
bStateThe state of the flag to set to.
Returns
The previous state of the flag.
See also
HasSubjectFlagAt(const int32, const EFlagmarkBit)

◆ SetSubjectFlagmarkAt()

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm = EParadigm::Safe>
EFlagmark TChunkProxy< SubjectHandleT, Ts >::SetSubjectFlagmarkAt ( const int32  SlotIndex,
const EFlagmark  Flagmark 
) const
inline

Set a subject's flagmark at a specific slot index.

The operation is thread-safe and atomic.

The method is cache efficient during the iterating process, cause the flagmarks are stored within the chunk slots.

Template Parameters
ParadigmThe safety paradigm to utilize.
Parameters
SlotIndexThe index of the subject slot to examine.
FlagmarkThe flagmark to set to.
Returns
The flagmark of the subject.

◆ SetSubjectFlagmarkMaskedAt()

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm = EParadigm::Safe>
EFlagmark TChunkProxy< SubjectHandleT, Ts >::SetSubjectFlagmarkMaskedAt ( const int32  SlotIndex,
const EFlagmark  Flagmark,
const EFlagmark  Mask 
)
inline

Set the masked flagmark for the subject.

This operation is atomic and thread-safe.

All of the system-level flags get removed from the mask argument prior to application.

The method is cache efficient during the iterating process, cause the flagmarks are stored within the chunk slots.

Template Parameters
ParadigmThe safety paradigm to utilize.
Parameters
SlotIndexThe index of the subject slot to examine.
FlagmarkThe new flagmark to set to.
MaskThe mask to apply on the flagmark bits to set.
Returns
The previous flagmark of the subject.
See also
SetSubjectFlagmarkAt(const int32, const EFlagmark)

◆ SubjectAt()

template<typename SubjectHandleT , typename... Ts>
SubjectHandleT TChunkProxy< SubjectHandleT, Ts >::SubjectAt ( const int32  SlotIndex) const
inline

Get a subject at a certain index within the chunk.

Parameters
SlotIndexThe index of the slot to get the subject of.
Returns
A handle to the subject.

◆ SubjectFingerprintAt()

template<typename SubjectHandleT , typename... Ts>
const FFingerprint & TChunkProxy< SubjectHandleT, Ts >::SubjectFingerprintAt ( const int32  SlotIndex) const
inline

Get a subject's fingerprint at a specific slot index.

The operation is thread-safe and atomic.

The method is cache efficient during the iterating process, cause the fingerprints are stored within the chunk slots.

Parameters
SlotIndexThe index of the subject slot to examine.
Returns
The fingerprint of the subject.

◆ SubjectFlagmarkAt()

template<typename SubjectHandleT , typename... Ts>
EFlagmark TChunkProxy< SubjectHandleT, Ts >::SubjectFlagmarkAt ( const int32  SlotIndex) const
inline

Get a subject's flagmark at a specific slot index.

The operation is thread-safe and atomic.

The method is cache efficient during the iterating process, cause the flagmarks are stored within the chunk slots.

Parameters
SlotIndexThe index of the subject slot to examine.
Returns
The flagmark of the subject.

◆ ToggleSubjectFlagAt()

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm = EParadigm::Safe>
bool TChunkProxy< SubjectHandleT, Ts >::ToggleSubjectFlagAt ( const int32  SlotIndex,
const EFlagmarkBit  Flag 
) const
inline

Toggle a subject's flag at a specific slot index.

The operation is thread-safe and atomic.

The method is cache efficient during the iterating process, cause the flagmarks are stored within the chunk slots.

Template Parameters
ParadigmThe safety paradigm to utilize.
Parameters
SlotIndexThe index of the subject slot to examine.
FlagThe flag to toggle.
Returns
The previous state of the flag.
See also
SetSubjectFlagAt(const int32, const EFlagmarkBit, const bool)

◆ TraitAt() [1/2]

template<typename SubjectHandleT , typename... Ts>
template<typename T >
T TChunkProxy< SubjectHandleT, Ts >::TraitAt ( const int32  SlotIndex) const
inline

Get a trait from the chunk at a certain subject index.

Template Parameters
TThe type of the trait to get.
Parameters
SlotIndexThe index of the subject to examine.
Returns
The trait reference.

◆ TraitAt() [2/2]

template<typename SubjectHandleT , typename... Ts>
template<typename T >
EApparatusStatus TChunkProxy< SubjectHandleT, Ts >::TraitAt ( const int32  SlotIndex,
T OutStruct,
const bool  bStructInitialized = true 
) const
inline

Get a trait from the chunk at a certain subject index.

Template Parameters
TThe type of the trait to get.
Parameters
SlotIndexThe index of the subject to examine.
OutStructThe struct to receive the trait.
bStructInitializedWas the output struct actually initialized?
Returns
The status of the operation.
EApparatusStatus::Missing If there's no such trait within the chunk.

◆ TraitPtrAt() [1/4]

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm, typename T >
TTraitPtrResult< Paradigm, T > TChunkProxy< SubjectHandleT, Ts >::TraitPtrAt ( const int32  Index)
inline

Get the trait pointer from the chunk.

Template Parameters
TThe type of the trait to get.
Parameters
IndexThe index of the subject to examine.
Returns
A pointer to the trait.
nullptr If there is no such trait within the chunk.

◆ TraitPtrAt() [2/4]

template<typename SubjectHandleT , typename... Ts>
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitPtrResult< Paradigm, T > TChunkProxy< SubjectHandleT, Ts >::TraitPtrAt ( const int32  Index)
inline

Get the trait pointer from the chunk.

Template Parameters
TThe type of the trait to get.
Parameters
IndexThe index of the subject to examine.
Returns
A pointer to the trait.
nullptr If there is no such trait within the chunk.

◆ TraitPtrAt() [3/4]

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm, typename T >
TTraitPtrResult< Paradigm, const T > TChunkProxy< SubjectHandleT, Ts >::TraitPtrAt ( const int32  Index) const
inline

Get the trait pointer from the chunk.

Constant version.

Template Parameters
TThe type of the trait to get.
Parameters
IndexThe index of the subject to examine.
Returns
A pointer to the trait.
nullptr If there is no such trait within the chunk.

◆ TraitPtrAt() [4/4]

template<typename SubjectHandleT , typename... Ts>
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitPtrResult< Paradigm, const T > TChunkProxy< SubjectHandleT, Ts >::TraitPtrAt ( const int32  Index) const
inline

Get the trait pointer from the chunk.

Constant version.

Template Parameters
TThe type of the trait to get.
Parameters
IndexThe index of the subject to examine.
Returns
A pointer to the trait.
nullptr If there is no such trait within the chunk.

◆ TraitRefAt() [1/4]

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm, typename T >
TTraitRefResult< Paradigm, T > TChunkProxy< SubjectHandleT, Ts >::TraitRefAt ( const int32  SlotIndex)
inline

Get the trait reference from the chunk.

Template Parameters
TThe type of the trait to get.
Parameters
SlotIndexThe index of the subject to examine.
Returns
The trait reference.

◆ TraitRefAt() [2/4]

template<typename SubjectHandleT , typename... Ts>
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitRefResult< Paradigm, T > TChunkProxy< SubjectHandleT, Ts >::TraitRefAt ( const int32  SlotIndex)
inline

Get the trait reference from the chunk.

Template Parameters
TThe type of the trait to get.
Parameters
SlotIndexThe index of the subject to examine.
Returns
The trait reference.

◆ TraitRefAt() [3/4]

template<typename SubjectHandleT , typename... Ts>
template<EParadigm Paradigm, typename T >
TTraitRefResult< Paradigm, const T > TChunkProxy< SubjectHandleT, Ts >::TraitRefAt ( const int32  SlotIndex) const
inline

Get the trait reference from the chunk.

Constant version.

Template Parameters
TThe type of the trait to get.
Parameters
SlotIndexThe index of the subject to examine.
Returns
The trait reference.

◆ TraitRefAt() [4/4]

template<typename SubjectHandleT , typename... Ts>
template<typename T , EParadigm Paradigm = DefaultParadigm>
TTraitRefResult< Paradigm, const T > TChunkProxy< SubjectHandleT, Ts >::TraitRefAt ( const int32  SlotIndex) const
inline

Get the trait reference from the chunk.

Constant version.

Template Parameters
TThe type of the trait to get.
Parameters
SlotIndexThe index of the subject to examine.
Returns
The trait reference.

◆ Unlock()

template<typename SubjectHandleT , typename... Ts>
EApparatusStatus TChunkProxy< SubjectHandleT, Ts >::Unlock ( )
inline

Unlock the chunk from iterating.

See also
Lock()

Member Data Documentation

◆ AllowsChanges

template<typename SubjectHandleT , typename... Ts>
constexpr auto TChunkProxy< SubjectHandleT, Ts >::AllowsChanges = SubjectHandleT::AllowsChanges
staticconstexpr

Should subject changes be allowed.

◆ AllowsDirectTraitAccess

template<typename SubjectHandleT , typename... Ts>
constexpr auto TChunkProxy< SubjectHandleT, Ts >::AllowsDirectTraitAccess = SubjectHandleT::AllowsDirectTraitAccess
staticconstexpr

Can the trait data be accessed directly?

◆ AllowsStructuralChanges

template<typename SubjectHandleT , typename... Ts>
constexpr auto TChunkProxy< SubjectHandleT, Ts >::AllowsStructuralChanges = SubjectHandleT::AllowsStructuralChanges
staticconstexpr

Should structural (adding/removing traits) subject changes be allowed.

◆ DefaultParadigm

template<typename SubjectHandleT , typename... Ts>
constexpr EParadigm TChunkProxy< SubjectHandleT, Ts >::DefaultParadigm = ParadigmCombine<Ts...>()
staticconstexpr

The security paradigm to use by default.

◆ ShouldLockSolid

template<typename SubjectHandleT , typename... Ts>
constexpr auto TChunkProxy< SubjectHandleT, Ts >::ShouldLockSolid = SubjectHandleT::IsHandleSolid()
staticconstexpr

Is the chunk a solid-locking one?


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