Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
UBelt Class Reference

The conveyor belt consisting of subjects. More...

#include <Belt.h>

Inheritance diagram for UBelt:
Inheritance graph
[legend]
Collaboration diagram for UBelt:
Collaboration graph
[legend]

Public Types

enum  { InvalidSlotIndex = FBeltSlot::InvalidIndex , InvalidDetailLineIndex = FBeltSlot::InvalidDetailIndex }
 
typedef uint32 TagType
 The belt's tag type.
 
- Public Types inherited from IIterable
enum  { InvalidSlotIndex = -1 }
 

Public Member Functions

constexpr bool IsSparse () const
 Is this a sparse belt allowing some empty detail spaces?
 
const FDetailmarkGetDetailmark () const
 The current decomposed detailmark of the belt.
 
int32 DetailLineIndexOf (const TSubclassOf< UDetail > DetailClass) const
 Get the line index for a detail class.
 
template<class D >
constexpr int32 DetailLineIndexOf () const
 Get the line index for a detail class.
 
AMechanismGetOwner () const
 Get the owning mechanism of the belt.
 
TagType GetTag () const
 Get the preset tag of the belt.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > Expand (const FDetailmark &InDetailmark)
 Expand a belt to accommodate the new detailmark.
 
const FBeltSlotSlotAt (const int32 SlotIndex) const
 Get a belt slot by its index.
 
FBeltSlotSlotAt (const int32 SlotIndex)
 Get a belt slot by its index.
 
const FBeltSlotoperator[] (const int32 SlotIndex) const
 Get a belt slot by its index.
 
FBeltSlotoperator[] (const int32 SlotIndex)
 Get a belt slot by its index.
 
template<typename BeltItT >
BeltItT Begin (const FFilter &Filter, const int32 Offset=0)
 Begin iterating the belt under a certain filter.
 
template<typename BeltItT >
BeltItT End () const
 Get the ending iterator.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > Refresh (ISubjective *const Subjective)
 Refresh a subjective within the belt.
 
bool Matches (const FFilter &Filter) const override
 Check if the belt matches a filter.
 
- Public Member Functions inherited from IIterable
AMechanismGetOwner () const
 Get the owning mechanism of the iterable.
 
bool IsLocked () const
 Check if the sequence is currently locked.
 
bool IsLiquidLocked () const
 Check if the iterable is currently locked in a liquid manner.
 
bool IsSolidLocked () const
 Check if the iterable is currently locked in a solid manner.
 
bool IsSolid () const
 Check if the iterable is currently solid.
 
bool HasQueuedForRemoval () const
 Check if there are any slots marked for removal within the iterable.
 
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.
 
virtual bool Matches (const FFilter &InFilter) const
 Check whether the sequence matches a filter.
 
template<bool bInSolid>
EApparatusStatus Lock () const
 Lock the iterable, preparing it for the iterating process.
 
EApparatusStatus LockLiquid () const
 Lock the iterable in a liquid manner.
 
EApparatusStatus LockSolid () const
 Lock the iterable in a solid manner.
 
template<bool bInSolid>
EApparatusStatus Unlock () const
 Unlock the iterable, applying the pending changes.
 

Static Public Member Functions

static UBeltNew (UObject *const Owner, const FDetailmark &InDetailmark)
 Create a new belt instance.
 
static UBeltNew (UObject *const Owner, const FName &Name, const FDetailmark &InDetailmark)
 Create a new belt instance with a specific name.
 

Static Public Attributes

static constexpr TagType InvalidTag = (TagType)INDEX_NONE
 An invalid belt tag constant.
 

Protected Member Functions

EApparatusStatus DoUnlock (const bool bWasSolid) const override
 Unlock the iterable, applying the pending changes.
 
- Protected Member Functions inherited from IIterable
void EnqueueForRemoval (const int32 SlotIndex) const
 Enqueue a slot for removal.
 
bool DequeueFromRemoved (int32 &OutSlotIndex) const
 Dequeue a slot from being removed.
 
int32 DequeueFromRemoved () const
 Dequeue a slot from being removed.
 
virtual EApparatusStatus DoUnlock (const bool bWasSolid) const
 Unlock the iterable, applying the pending changes.
 

Friends

struct FBeltSlot
 
template<typename SubjectHandleT >
struct TBeltIt
 
class USubjectiveActorComponent
 
class USubjectiveUserWidget
 
class UDetail
 
class AMechanism
 
class UMachine
 
class ISubjective
 

Additional Inherited Members

- Protected Attributes inherited from IIterable
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.
 
std::atomic< int32 > IterableCount {-1}
 A number of currently iterable slots, excluding those, that were added before the unlocking.
 

Detailed Description

The conveyor belt consisting of subjects.

Member Typedef Documentation

◆ TagType

typedef uint32 UBelt::TagType

The belt's tag type.

This should be able to hold the UObject's Unique Id.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidSlotIndex 

Invalid slot index.

InvalidDetailLineIndex 

Invalid detail line index.

Member Function Documentation

◆ Begin()

template<typename BeltItT >
BeltItT UBelt::Begin ( const FFilter Filter,
const int32  Offset = 0 
)
inline

Begin iterating the belt under a certain filter.

Template Parameters
BeltItTThe type of the belt iterator to use.
Parameters
FilterThe filter to iterate under.
OffsetThe offset for the slot to begin with.
Returns
The iterator to use for the iterating. Will point to the end, if the were no suiting slots currently available.

◆ DetailLineIndexOf() [1/2]

template<class D >
constexpr int32 UBelt::DetailLineIndexOf ( ) const
inlineconstexpr

Get the line index for a detail class.

Note
The method actually supports non-detail classes, i.e. INDEX_NONE will be safely returned in that case.
Template Parameters
DThe detail class to query for.
Returns
The hinting detail index.

◆ DetailLineIndexOf() [2/2]

int32 UBelt::DetailLineIndexOf ( const TSubclassOf< UDetail DetailClass) const
inline

Get the line index for a detail class.

Parameters
DetailClassThe detail class to query for.
Returns
The hinting detail index.

◆ DoUnlock()

EApparatusStatus UBelt::DoUnlock ( const bool  bWasSolid) const
inlineoverrideprotectedvirtual

Unlock the iterable, applying the pending changes.

Must be implemented in the descendants.

The procedure is guaranteed to be executed under a locked critical section for this chunk.

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

Reimplemented from IIterable.

◆ End()

template<typename BeltItT >
BeltItT UBelt::End ( ) const
inline

Get the ending iterator.

Template Parameters
BeltItTThe type of the belt iterator.
Returns
The ending iterator.

◆ Expand()

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > UBelt::Expand ( const FDetailmark InDetailmark)

Expand a belt to accommodate the new detailmark.

Note
The target detailmark will be added while being decomposed to its base classes.
Template Parameters
ParadigmThe paradigm to work under.
Parameters
InDetailmarkThe new detailmark to include.
Returns
The outcome of the operation.
EApparatusStatus::Noop If nothing was actually changed.

◆ GetDetailmark()

const FDetailmark & UBelt::GetDetailmark ( ) const
inline

The current decomposed detailmark of the belt.

Note
All of the base class details are decomposed into separate details here.
This is a detailmark for a sparse storage and some details may actually be missing within the physical belt slots.
This detailmark can change due to further belt expansions.
Returns
The current detailmark of the belt.

◆ GetOwner()

AMechanism * UBelt::GetOwner ( ) const
inline

Get the owning mechanism of the belt.

◆ GetTag()

TagType UBelt::GetTag ( ) const
inline

Get the preset tag of the belt.

This one is set automatically when creating a belt from a preferred one.

Returns
The preset tag of the belt or UBelt::InvalidTag, if none is assigned.

◆ IsSparse()

constexpr bool UBelt::IsSparse ( ) const
inlineconstexpr

Is this a sparse belt allowing some empty detail spaces?

◆ Matches()

bool UBelt::Matches ( const FFilter Filter) const
inlineoverridevirtual

Check if the belt matches a filter.

Reimplemented from IIterable.

◆ New() [1/2]

static UBelt * UBelt::New ( UObject *const  Owner,
const FDetailmark InDetailmark 
)
inlinestatic

Create a new belt instance.

◆ New() [2/2]

static UBelt * UBelt::New ( UObject *const  Owner,
const FName &  Name,
const FDetailmark InDetailmark 
)
inlinestatic

Create a new belt instance with a specific name.

◆ operator[]() [1/2]

FBeltSlot & UBelt::operator[] ( const int32  SlotIndex)
inline

Get a belt slot by its index.

Parameters
SlotIndexThe index of the belt slot.
Returns
The belt slot.

◆ operator[]() [2/2]

const FBeltSlot & UBelt::operator[] ( const int32  SlotIndex) const
inline

Get a belt slot by its index.

Constant version.

Parameters
SlotIndexThe index of the belt slot.
Returns
The belt slot.

◆ Refresh()

template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > UBelt::Refresh ( ISubjective *const  Subjective)
inline

Refresh a subjective within the belt.

The subjective might actually be in a different belt before calling this method. In such case it will be moved to this belt.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectiveA subjective to refresh. Must not be a nullptr.
Returns
The outcome of the operation.

◆ SlotAt() [1/2]

FBeltSlot & UBelt::SlotAt ( const int32  SlotIndex)
inline

Get a belt slot by its index.

Parameters
SlotIndexThe index of the belt slot.
Returns
The belt slot.

◆ SlotAt() [2/2]

const FBeltSlot & UBelt::SlotAt ( const int32  SlotIndex) const
inline

Get a belt slot by its index.

Constant version.

Parameters
SlotIndexThe index of the belt slot.
Returns
The belt slot.

Friends And Related Function Documentation

◆ AMechanism

friend class AMechanism
friend

◆ FBeltSlot

friend struct FBeltSlot
friend

◆ ISubjective

friend class ISubjective
friend

◆ TBeltIt

template<typename SubjectHandleT >
friend struct TBeltIt
friend

◆ UDetail

friend class UDetail
friend

◆ UMachine

friend class UMachine
friend

◆ USubjectiveActorComponent

friend class USubjectiveActorComponent
friend

◆ USubjectiveUserWidget

friend class USubjectiveUserWidget
friend

Member Data Documentation

◆ InvalidTag

constexpr TagType UBelt::InvalidTag = (TagType)INDEX_NONE
staticconstexpr

An invalid belt tag constant.

Matches the Object's default internal index value.


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