Apparatus Version 1.8
ECS data-oriented workflow for Unreal Engine.
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
IIterable Class Reference

An interface for all sorts of sequences. More...

#include <Iterable.h>

Inheritance diagram for IIterable:
Inheritance graph
[legend]

Public Member Functions

UMechanismGetOwner () const
 Get the owning mechanism of the iterable. More...
 
bool IsLocked () const
 Check if the sequence is currently locked. More...
 
bool IsSolid () const
 Check if the iterable is locked in a solid manner. More...
 
int32 Num () const
 Get the total number of slots currently in the iterable. More...
 
int32 IterableNum () const
 Get the current number of elements valid for iterating. More...
 
virtual bool Matches (const FFilter &InFilter) const
 Check whether the sequence matches a filter. More...
 
const FFilterGetLockingFilter () const
 Get the active locking filter of the sequence. More...
 

Protected Member Functions

virtual EApparatusStatus DoLock (const FFilter &InFilter) const
 Lock the iterable under a chosen filter. More...
 
template<bool bInSolid>
EApparatusStatus Lock (const FFilter &InFilter) const
 Lock the iterable under a chosen filter. More...
 
template<bool bInSolid>
EApparatusStatus Lock () const
 Add locks to the iterable under the existing already locking filter. More...
 
virtual EApparatusStatus DoUnlock () const
 Unlock the iterable, applying the pending changes. More...
 
template<bool bInSolid>
EApparatusStatus Unlock () const
 Unlock the iterable, applying the pending changes. More...
 

Protected Attributes

TArray< int32 > LockedMapping
 A mapping from the locked traitmark/detailmark to the sequence's own traitmark/detailmark. More...
 
int32 Count = 0
 The logical (un-buffered) number of slots in the belt that are actually candidates for being iterated once the iterable is locked. More...
 
int32 IterableCount = -1
 A number of currently iterable slots, excluding those, that were added before the unlocking. More...
 
TArray< int32 > Removed
 The indices of the slots queued to be removed once the belt becomes unlocked. More...
 

Friends

template<typename SubjectHandleT >
struct TChunkIt
 
template<typename ChunkItT , typename BeltItT >
struct TChain
 

Detailed Description

An interface for all sorts of sequences.

Member Function Documentation

◆ DoLock()

virtual EApparatusStatus IIterable::DoLock ( const FFilter InFilter) const
inlineprotectedvirtual

Lock the iterable under a chosen filter.

Must be implemented in the descendants.

Parameters
InFilterA filter to lock under.
Returns
The status of the operation.

Reimplemented in UChunk, and UBelt.

◆ DoUnlock()

virtual EApparatusStatus IIterable::DoUnlock ( ) const
inlineprotectedvirtual

Unlock the iterable, applying the pending changes.

Must be implemented in the descedants.

Parameters
bInSolidShould the iterable be unlocked from a solid state.
Returns
The status of the operation.

Reimplemented in UChunk, and UBelt.

◆ GetLockingFilter()

const FFilter& IIterable::GetLockingFilter ( ) const
inline

Get the active locking filter of the sequence.

Returns an empty filter, if the iterable is not currently locked.

Returns
A filter this iterable is currently locked under.

◆ GetOwner()

UMechanism * IIterable::GetOwner ( ) const
inline

Get the owning mechanism of the iterable.

◆ IsLocked()

bool IIterable::IsLocked ( ) const
inline

Check if the sequence is currently locked.

The sequence is locked if its locks count is more than a zero.

Returns
The lock state.

◆ IsSolid()

bool IIterable::IsSolid ( ) const
inline

Check if the iterable is locked in a solid manner.

Returns
The state of examination.

◆ IterableNum()

int32 IIterable::IterableNum ( ) const
inline

Get the current number of elements valid for iterating.

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

◆ Lock() [1/2]

template<bool bInSolid>
EApparatusStatus IIterable::Lock ( ) const
inlineprotected

Add locks to the iterable under the existing already locking filter.

Template Parameters
bInSolidShould the iterable be locked in a solid manner.
Returns
The status of the operation.

◆ Lock() [2/2]

template<bool bInSolid>
EApparatusStatus IIterable::Lock ( const FFilter InFilter) const
inlineprotected

Lock the iterable under a chosen filter.

Template Parameters
bInSolidShould the iterable be locked in a solid manner.
Parameters
InFilterA filter to lock under.
Returns
The status of the operation.

◆ Matches()

virtual bool IIterable::Matches ( const FFilter InFilter) const
inlinevirtual

Check whether the sequence matches a filter.

Parameters
InFilterA filter to match.
Returns
The state of matching.

Reimplemented in UChunk, and UBelt.

◆ Num()

int32 IIterable::Num ( ) const
inline

Get the total number of slots currently in the iterable.

Returns the active meaningful slots count. Doesn't include non-iterable slots during the iterating process.

Returns
The current number of slots.

◆ Unlock()

template<bool bInSolid>
EApparatusStatus IIterable::Unlock
inlineprotected

Unlock the iterable, applying the pending changes.

Template Parameters
bInSolidShould the iterable be unlocked from a solid state.
Returns
The status of the operation.

Friends And Related Function Documentation

◆ TChain

template<typename ChunkItT , typename BeltItT >
friend struct TChain
friend

◆ TChunkIt

template<typename SubjectHandleT >
friend struct TChunkIt
friend

Member Data Documentation

◆ Count

int32 IIterable::Count = 0
protected

The logical (un-buffered) number of slots in the belt that are actually candidates for being iterated once the iterable is locked.

◆ IterableCount

int32 IIterable::IterableCount = -1
mutableprotected

A number of currently iterable slots, excluding those, that were added before the unlocking.

This value is available and is valid only during iterating. Otherwise, it should be -1.

◆ LockedMapping

TArray<int32> IIterable::LockedMapping
mutableprotected

A mapping from the locked traitmark/detailmark to the sequence's own traitmark/detailmark.

Used for optimized iterating.

◆ Removed

TArray<int32> IIterable::Removed
protected

The indices of the slots queued to be removed once the belt becomes unlocked.


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