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

The scoped Apparatus state manager. More...

#include <Mechanism.h>

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

Classes

struct  TDeferredsApplicator
 A safe applicator for the deferred changes (or deferreds). More...
 

Public Types

enum  { InvalidChainId = FChain::InvalidId , FirstChainId = FChain::FirstId }
 
typedef FSubjectInfo::MechanismIdType IdType
 The type of the mechanism identifier.
 
typedef FSubjectInfo::IdType SubjectIdType
 The type for the unique subject identifiers.
 

Public Member Functions

const TSet< ISubjective * > & GetSubjectives () const
 All of the subjectives currently available and registered.
 
FAdjectiveInfoGetAdjective (const int32 Id)
 Get subject information by an identifier.
 
void FindBeltsMatchingFingerprint (const FFingerprint &Fingerprint, TArray< UBelt * > &OutBelts)
 Get all of the belts matching a fingerprint.
 
void BootAll ()
 Boot all of the halted subjectives currently present in the Mechanism.
 
template<typename IterableT , typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
auto EnchainIterables (FilterT &&Filter, ChainT &OutChain)
 Enchain multiple iterables with a filter.
 
template<typename IterableT , typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
TSharedRef< ChainT > EnchainIterables (FilterT &&Filter)
 Enchain multiple iterables with a filter.
 
template<typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
auto Enchain (FilterT &&Filter, ChainT &OutChain)
 Enchain multiple iterable sequences based on a filter.
 
template<typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
TSharedRef< ChainT > Enchain (FilterT &&Filter)
 Enchain multiple iterable sequences based on a filter.
 
template<typename FilterT = FFilter, typename... Ts, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
void Enchain (FilterT &&Filter, TArray< TChunkProxy< Ts... > > &OutChunkProxies, const bool bIncludeEmpty=false)
 Enchain the matching chunks into proxies.
 
template<typename FilterT = FFilter>
TSharedRef< FSolidChainEnchainSolid (FilterT &&Filter)
 Enchain multiple iterable sequences based on a filter, returning a solid chain.
 
template<bool bInSolidity, typename FilterT = FFilter>
std::conditional< bInSolidity, TSharedRef< FSolidChain >, TSharedRef< FChain > >::type EnchainWithSolidity (FilterT &&Filter)
 Enchain subjects using a specific solidity.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > ActualizeBelt (ISubjective *const Subjective)
 Update a subjective's belt.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > RegisterSubjective (ISubjective *const Subjective)
 Register a subjective within the mechanism.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > UnregisterSubjective (ISubjective *const Subjective)
 Remove a subjective from the mechanism completely.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > UnregisterAllSubjectives ()
 Unregister all of the currently registered subjectives.
 
template<typename ChainT = FChain>
TSharedRef< ChainT > ObtainChain (const int32 ChainId) const
 Obtain an embedded chain of a specific identifier.
 
template<typename ChainT = FChain>
TSharedRef< ChainT > ObtainChain () const
 Obtain a chain of a specific type.
 
EApparatusStatus RegisterMechanical (TScriptInterface< IMechanical > Mechanical)
 Register a mechanical within the mechanism.
 
EApparatusStatus UnregisterMechanical (TScriptInterface< IMechanical > Mechanical)
 Unregister a mechanical from the mechanism.
 
EApparatusStatus UnregisterAllMechanicals ()
 Unregister all of the currently registered mechanicals.
 
UChunkObtainChunk (const struct FTraitmark &Traitmark, EApparatusStatus &OutStatus, const int32 Capacity=32)
 Find existing or create a new chunk for a traitmark.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, UChunk * > ObtainChunk (const struct FTraitmark &Traitmark, const int32 Capacity=32)
 Find existing or create a new chunk for a traitmark.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > DespawnAllSubjects ()
 Despawn all of the subjects currently available within the mechanism.
 
void Reset () override
 Reset the mechanism completely, unregistering all of the entities and despawning all of the subjects.
 
bool IsSolid () const
 Check if the mechanism is currently in the uniform mode preventing any structural changes to its subjects and subjectives.
 
bool IsLiquid () const
 Check if the mechanism is currently in the mutable mode allowing any structural changes to its subjects and subjectives.
 
bool IsLocked () const
 Check if the mechanism is currently locked in any manner.
 
 AMechanism (const FObjectInitializer &ObjectInitializer)
 Construct a new mechanism object.
 
Inspection
SubjectIdType SubjectsNum () const
 Get the current number of subjects residing within the mechanism.
 
int32 SubjectivesNum () const
 Get the current number of effective subjectives in the mechanism.
 
Concurrency
bool IsInConcurrentEnvironment () const
 Check if the mechanism is currently inside a multi-threaded context.
 
Spawning
EApparatusStatus SpawnSubject (FSubjectHandle &OutSubjectHandle, const FTraitmark &Traitmark, const EFlagmark Flagmark=FM_None)
 Spawn a new subject within the mechanism and a chunk of a specific traitmark.
 
EApparatusStatus SpawnSubject (FSubjectHandle &OutSubjectHandle, FTraitmark &&Traitmark, const EFlagmark Flagmark=FM_None)
 Spawn a new subject within the mechanism and a chunk of a specific traitmark.
 
EApparatusStatus SpawnSubject (FSubjectHandle &OutSubjectHandle, const EFlagmark Flagmark=FM_None)
 Spawn a new subject within the mechanism.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandleSpawnSubject (const FSubjectRecord &SubjectRecord)
 Spawn a new subject based on a packed subject data record.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandleSpawnSubject (FSubjectRecord &&SubjectRecord)
 Spawn a new subject based on a packed subject data record.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandleSpawnSubject (FSubjectRecord &SubjectRecord)
 Spawn a new subject based on a packed subject data record.
 
FSubjectHandle SpawnSubject (const FSubjectRecord &SubjectRecord, EApparatusStatus &OutStatus)
 Spawn a new subject within the mechanism based on a record.
 
FSubjectHandle SpawnSubject (FSubjectRecord &&SubjectRecord, EApparatusStatus &OutStatus)
 Spawn a new subject based on a packed subject data record.
 
FSubjectHandle SpawnSubject (FSubjectRecord &SubjectRecord, EApparatusStatus &OutStatus)
 Spawn a new subject based on a packed subject data record.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > SpawnSubjectDeferred (const FSubjectRecord &SubjectRecord)
 Spawn a new subject based on a packed subject data record.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > SpawnSubjectDeferred (FSubjectRecord &&SubjectRecord)
 Spawn a new subject based on a packed subject data record.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > SpawnSubjectDeferred (FSubjectRecord &SubjectRecord)
 Spawn a new subject based on a packed subject data record.
 
template<EParadigm Paradigm = EParadigm::Default>
auto SpawnSubject (const EFlagmark Flagmark)
 Spawn a new subject with a flagmark within the mechanism, returning the handle to the caller.
 
template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm, FSubjectHandleSpawnSubject (Ts &&... Traits)
 Spawn a new subject with traits, returning the handle.
 
template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm, FSubjectHandleSpawnSubject (Ts &&... Traits, const EFlagmark Flagmark)
 Spawn a new subject with traits, returning the handle.
 
template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto SpawnSubject (Ts &&... Traits)
 Spawn a new subject with traits, returning the handle.
 
template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto SpawnSubject (Ts &&... Traits, const EFlagmark Flagmark)
 Spawn a new subject with traits, returning the handle.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandleSpawnSubject (UScriptStruct *const TraitType, void *const TraitData, const EFlagmark Flagmark=FM_None)
 Spawn a new subject with a typed trait data, returning the handle.
 
Deferred Spawning
template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm > SpawnSubjectDeferred (Ts &&... Traits)
 Spawn a new subject with traits.
 
template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm > SpawnSubjectDeferred (Ts &&... Traits, const EFlagmark Flagmark)
 Spawn a new subject with traits and a flagmark.
 
template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto SpawnSubjectDeferred (Ts &&... Traits)
 Spawn a new subject with traits.
 
template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto SpawnSubjectDeferred (Ts &&... Traits, const EFlagmark Flagmark)
 Spawn a new subject with traits and a flagmark.
 
Deferreds
bool HasDeferreds () const
 Check if there are any deferreds queued.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > ApplyDeferreds ()
 Apply all of the currently pending changes.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > ApplyDeferreds (const EDeferred InFilter)
 Apply a certain kind of the currently pending changes.
 
template<EParadigm Paradigm = EParadigm::Default, typename ContainerT = TArray<EDeferred>>
TOutcome< Paradigm > ApplyDeferreds (const ContainerT &InKinds)
 Apply a subset of the currently pending changes.
 
bool IsAutomaticDeferredsApplicationPossible () const
 Check if the automatic deferreds application is possible within the current context.
 
template<EParadigm Paradigm = EParadigm::Default>
TDeferredsApplicator< Paradigm > CreateDeferredsApplicator (const EDeferred InFilter=EDeferred::All)
 Create a new deferreds applicator.
 
Collecting
template<typename AllocatorT >
EApparatusStatus CollectSubjects (TArray< FSubjectHandle, AllocatorT > &OutSubjects, const FFilter &Filter=FFilter::Default)
 Collect all of the subjects being part of the mechanism.
 
EApparatusStatus CollectSubjects (USubjectRecordCollection *const OutSubjects, const FFilter &Filter=FFilter::Default, const EFlagmark FlagmarkMask=FM_AllUserLevel)
 Collect the subjects being part of the mechanism.
 
Operating
auto OperatingsNum () const
 Get the number of current operatings happening within the mechanism.
 
void WaitForOperatingsCompletion () const
 Wait for all the current operatings to be completed within all chains.
 
bool WaitForOperatingsCompletion (const uint32 WaitTimeMsec, const bool bIgnoreThreadIdleStats=false) const
 Wait for all the current operatings to be completed within all chains.
 
bool WaitForOperatingsCompletion (const FTimespan &WaitTime, const bool bIgnoreThreadIdleStats=false) const
 Wait for all the current operatings to be completed within all chains.
 
template<typename ChainT = void, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto Operate (FilterT &&Filter, const MechanicT &Mechanic)
 Process the mechanism using a functor mechanic.
 
template<typename ChainT = void, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto Operate (FilterT &&Filter, MechanicT &Mechanic)
 Process the mechanism using a functor mechanic.
 
template<typename ChainT = void, typename FilterT = void, typename FunctionT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto Operate (FilterT &&Filter, FunctionT *const Mechanic)
 Process the chain using a free function mechanic.
 
template<typename ChainT = void, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto Operate (const MechanicT &Mechanic)
 Process the mechanism using a functor mechanic.
 
template<typename ChainT = void, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto Operate (MechanicT &Mechanic)
 Process the mechanism using a functor mechanic.
 
template<typename ChainT = void, typename FunctionT = void, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto Operate (FunctionT *const Mechanic)
 Process the chain using a free function mechanic.
 
template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto OperateConcurrently (FilterT &&Filter, const MechanicT &Mechanic, const int32 ThreadsCountMax, const int32 SlotsPerThreadMin=1, const bool bSync=true)
 Process the mechanism using a functor mechanic in a threaded manner.
 
template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto OperateConcurrently (FilterT &&Filter, MechanicT &Mechanic, const int32 ThreadsCountMax, const int32 SlotsPerThreadMin=1, const bool bSync=true)
 Process the mechanism using a functor mechanic in a threaded manner.
 
template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FilterT = void, typename FunctionT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto OperateConcurrently (FilterT &&Filter, FunctionT *const Mechanic, const int32 ThreadsCountMax, const int32 SlotsPerThreadMin=1, const bool bSync=true)
 Process the chain using a free function mechanic in a parallel manner.
 
template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto OperateConcurrently (const MechanicT &Mechanic, const int32 ThreadsCountMax, const int32 SlotsPerThreadMin=1, const bool bSync=true)
 Process the mechanism using a functor mechanic in a threaded manner.
 
template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto OperateConcurrently (MechanicT &Mechanic, const int32 ThreadsCountMax, const int32 SlotsPerThreadMin=1, const bool bSync=true)
 Process the mechanism using a functor mechanic in a threaded manner.
 
template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FunctionT = void, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto OperateConcurrently (FunctionT *const Mechanic, const int32 ThreadsCountMax, const int32 SlotsPerThreadMin=1, const bool bSync=true)
 Process the chain using a free function mechanic in a parallel manner.
 

Static Public Attributes

static constexpr IdType InvalidId = 0x00
 Invalid mechanism identifier.
 
static constexpr IdType FirstId = 0x01
 The first valid mechanism identifier.
 
static constexpr IdType LastId = TNumericLimits<IdType>::Max() - 1
 The last valid mechanism identifier.
 
static constexpr int32 InstancesMax = LastId - FirstId + 1
 The maximum possible number of mechanisms within the machine.
 
static constexpr SubjectIdType InvalidSubjectId = FSubjectInfo::InvalidId
 Invalid subject identifier.
 
static constexpr SubjectIdType FirstSubjectPlace = FSubjectInfo::FirstPlace
 A first valid subject placement index within the pool.
 
static constexpr SubjectIdType LastSubjectPlace = FSubjectInfo::LastPlace
 The maximum valid subject placement index within the pool.
 
static constexpr SubjectIdType SubjectPlacesPerMechanism = FSubjectInfo::PlacesPerMechanismMax
 The maximum number of subjects within the machine.
 
static constexpr int32 FoundIterablesInlineSize = 32
 The pre-allocated size of the iterables being searched.
 

Friends

struct FCommonChain
 
struct FSubjectNetworkState
 
class UNetworkBearerComponent
 
class UMachine
 
class IIterable
 
template<typename ChunkItT , typename BeltItT , EParadigm Paradigm>
struct TChain
 
class UBelt
 
class UChunk
 
class UApparatusFunctionLibrary
 
struct FSubjectInfo
 
struct FCommonSubjectHandle
 
template<typename SubjectHandleT >
struct TChunkIt
 
template<typename SubjectHandleT >
struct TBeltIt
 

Detailed Description

The scoped Apparatus state manager.

This consists of subjects, subjectives and the mechanicals in the current world.

An instance of mechanism is created automatically per each UWorld, when it's needed. You can also instantiate it manually or even place it on the map in the Editor.

Member Typedef Documentation

◆ IdType

The type of the mechanism identifier.

◆ SubjectIdType

The type for the unique subject identifiers.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidChainId 

Invalid chain identifier.

FirstChainId 

First valid chain identifier.

Constructor & Destructor Documentation

◆ AMechanism()

AMechanism::AMechanism ( const FObjectInitializer &  ObjectInitializer)
inline

Construct a new mechanism object.

Parameters
ObjectInitializerThe object initializer to use.

Member Function Documentation

◆ ActualizeBelt()

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

Update a subjective's belt.

Should update the belt binding according to the current subjective's details. May actually assign a belt, if it's not yet set.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectiveThe subjective to actualize a belt for.
Returns
The outcome of the operation.

◆ ApplyDeferreds() [1/3]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::ApplyDeferreds ( )
inline

Apply all of the currently pending changes.

The deferred application is only possible within the main thread.

Template Parameters
ParadigmThe paradigm to work under.
Returns
The status of the operation.
EApparatusStatus::Noop if nothing was actually changed.

◆ ApplyDeferreds() [2/3]

template<EParadigm Paradigm = EParadigm::Default, typename ContainerT = TArray<EDeferred>>
TOutcome< Paradigm > AMechanism::ApplyDeferreds ( const ContainerT &  InKinds)
inline

Apply a subset of the currently pending changes.

The deferred application is only possible within the main thread.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
InKindsThe list of deferred changes to apply.
Returns
The status of the operation.
EApparatusStatus::Noop if nothing was actually changed.

◆ ApplyDeferreds() [3/3]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::ApplyDeferreds ( const EDeferred  InFilter)
inline

Apply a certain kind of the currently pending changes.

The deferred application is only possible within the main thread.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
InFilterThe kind of deferreds to apply.
Returns
The status of the operation.
EApparatusStatus::Noop if nothing was actually changed.

◆ BootAll()

void AMechanism::BootAll ( )
inline

Boot all of the halted subjectives currently present in the Mechanism.

◆ CollectSubjects() [1/2]

template<typename AllocatorT >
EApparatusStatus AMechanism::CollectSubjects ( TArray< FSubjectHandle, AllocatorT > &  OutSubjects,
const FFilter Filter = FFilter::Default 
)

Collect all of the subjects being part of the mechanism.

Note
The OutSubjects array is not reset. The subjects are added up to it.
Warning
The operation is relatively slow and shouldn't be used during normal frame time. Enchaining/operating should be used instead.
Parameters
OutSubjectsThe array to store the subjects.
FilterThe filter used to match the collected subjects.
Returns
The status of the operation.
EApparatusStatus::Noop If there were no items collected.

◆ CollectSubjects() [2/2]

EApparatusStatus AMechanism::CollectSubjects ( USubjectRecordCollection *const  OutSubjects,
const FFilter Filter = FFilter::Default,
const EFlagmark  FlagmarkMask = FM_AllUserLevel 
)

Collect the subjects being part of the mechanism.

Note
The OutSubjects collection is not reset. The subjects are added up to it.
Warning
The operation is relatively slow and shouldn't be used during normal frame time. Enchaining/operating should be used instead.
Parameters
OutSubjectsThe collection to store the subjects within.
FilterThe filter used to match the collected subjects.
FlagmarkMaskThe mask for flags to capture. Only user-level flags are captured by default.
Returns
The status of the operation.
EApparatusStatus::Noop If there were no items collected.

◆ CreateDeferredsApplicator()

template<EParadigm Paradigm = EParadigm::Default>
TDeferredsApplicator< Paradigm > AMechanism::CreateDeferredsApplicator ( const EDeferred  InFilter = EDeferred::All)
inline

Create a new deferreds applicator.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
InFilterA filter to request an applicator under.
Returns
The resulting applicator.

◆ DespawnAllSubjects()

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::DespawnAllSubjects ( )

Despawn all of the subjects currently available within the mechanism.

Template Parameters
ParadigmThe paradigm to work under.
Returns
The outcome of the operation.

◆ Enchain() [1/3]

template<typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
TSharedRef< ChainT > AMechanism::Enchain ( FilterT &&  Filter)
inline

Enchain multiple iterable sequences based on a filter.

Template Parameters
ChainTThe type of the chain to enchain within.
FilterTThe type of the filter to enchain under.
Parameters
FilterThe filter to enchain under.
Returns
The resulting chain.

◆ Enchain() [2/3]

template<typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
auto AMechanism::Enchain ( FilterT &&  Filter,
ChainT &  OutChain 
)
inline

Enchain multiple iterable sequences based on a filter.

Template Parameters
ChainTThe type of the chain to enchain within.
FilterTThe type of the filter to enchain under.
Parameters
[in]FilterThe filter to enchain under.
[out]OutChainThe chain to enchain within.
Returns
The outcome of the operation.

◆ Enchain() [3/3]

template<typename FilterT = FFilter, typename... Ts, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
void AMechanism::Enchain ( FilterT &&  Filter,
TArray< TChunkProxy< Ts... > > &  OutChunkProxies,
const bool  bIncludeEmpty = false 
)
inline

Enchain the matching chunks into proxies.

Template Parameters
FilterTThe type of filter to enchain with.
TsThe types of traits to proxy.
Parameters
FilterThe filter to enchain under.
OutChunkProxiesThe chunk proxies array to output to. Those will be the locking ones.
bIncludeEmptyShould empty chunks be included?

◆ EnchainIterables() [1/2]

template<typename IterableT , typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
TSharedRef< ChainT > AMechanism::EnchainIterables ( FilterT &&  Filter)
inline

Enchain multiple iterables with a filter.

Template Parameters
IterableTThe type of iterable to enchain.
ChainTThe type of chain to enchain with.
FilterTThe type of the filter to enchain under.
Parameters
FilterThe filter to enchain with.
Returns
The resulting chain.

◆ EnchainIterables() [2/2]

template<typename IterableT , typename ChainT = FChain, typename FilterT = FFilter, TFilterTypeSecurity< std::decay_t< FilterT > > = true>
auto AMechanism::EnchainIterables ( FilterT &&  Filter,
ChainT &  OutChain 
)
inline

Enchain multiple iterables with a filter.

Template Parameters
IterableTThe type of iterable to enchain.
ChainTThe type of chain to enchain with.
FilterTThe type of the filter to enchain under.
Parameters
FilterThe filter to enchain with.
OutChainThe chain to enchain within.
Returns
The resulting chain.

◆ EnchainSolid()

template<typename FilterT = FFilter>
TSharedRef< FSolidChain > AMechanism::EnchainSolid ( FilterT &&  Filter)
inline

Enchain multiple iterable sequences based on a filter, returning a solid chain.

Parameters
FilterThe filter to enchain under.
Returns
The resulting chain.

◆ EnchainWithSolidity()

template<bool bInSolidity, typename FilterT = FFilter>
std::conditional< bInSolidity, TSharedRef< FSolidChain >, TSharedRef< FChain > >::type AMechanism::EnchainWithSolidity ( FilterT &&  Filter)
inline

Enchain subjects using a specific solidity.

Template Parameters
bInSolidityThe solidity to enchain in.
FilterTThe type of the filter to enchain by.
Returns
The chain matching the solidity.

◆ FindBeltsMatchingFingerprint()

void AMechanism::FindBeltsMatchingFingerprint ( const FFingerprint Fingerprint,
TArray< UBelt * > &  OutBelts 
)
inline

Get all of the belts matching a fingerprint.

◆ GetAdjective()

FAdjectiveInfo & AMechanism::GetAdjective ( const int32  Id)
inline

Get subject information by an identifier.

◆ GetSubjectives()

const TSet< ISubjective * > & AMechanism::GetSubjectives ( ) const
inline

All of the subjectives currently available and registered.

◆ HasDeferreds()

bool AMechanism::HasDeferreds ( ) const
inline

Check if there are any deferreds queued.

This operation is thread-safe and lock-free.

◆ IsAutomaticDeferredsApplicationPossible()

bool AMechanism::IsAutomaticDeferredsApplicationPossible ( ) const
inline

Check if the automatic deferreds application is possible within the current context.

Returns
Returns true if the deferreds can be automatically be applied now, false otherwise.

◆ IsInConcurrentEnvironment()

bool AMechanism::IsInConcurrentEnvironment ( ) const
inline

Check if the mechanism is currently inside a multi-threaded context.

The value returned by this method is guaranteed not to change for the caller's environment, as long as the caller is part of the normal built-in iterating/operating flow.

Certain actions are performed differently when working among several threads.

Returns
true The mechanism is currently in the concurrent-executed environment.
false The single-threaded environment is taking place.

◆ IsLiquid()

bool AMechanism::IsLiquid ( ) const
inline

Check if the mechanism is currently in the mutable mode allowing any structural changes to its subjects and subjectives.

◆ IsLocked()

bool AMechanism::IsLocked ( ) const
inline

Check if the mechanism is currently locked in any manner.

Returns
The state of examination.

◆ IsSolid()

bool AMechanism::IsSolid ( ) const
inline

Check if the mechanism is currently in the uniform mode preventing any structural changes to its subjects and subjectives.

The mechanism is solid if it has any solid-locked iterables within itself.

Returns
The state of examination.

◆ ObtainChain() [1/2]

template<typename ChainT = FChain>
TSharedRef< ChainT > AMechanism::ObtainChain ( ) const
inline

Obtain a chain of a specific type.

The chain can probably be reused among the embedded ones.

Template Parameters
ChainTThe type of the chain to obtain.
Returns
A reference to the chain.

◆ ObtainChain() [2/2]

template<typename ChainT = FChain>
TSharedRef< ChainT > AMechanism::ObtainChain ( const int32  ChainId) const
inline

Obtain an embedded chain of a specific identifier.

This method is mainly used by the Blueprint frontend to provide the chain consistently during the iterating.

Parameters
ChainIdThe identifier of the chain to obtain.
Returns
The obtained chain reference.

◆ ObtainChunk() [1/2]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, UChunk * > AMechanism::ObtainChunk ( const struct FTraitmark Traitmark,
const int32  Capacity = 32 
)
inline

Find existing or create a new chunk for a traitmark.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
TraitmarkA traitmark to ensure for.
CapacityThe desired capacity of the chunk.
Returns
The resulting chunk.

◆ ObtainChunk() [2/2]

UChunk * AMechanism::ObtainChunk ( const struct FTraitmark Traitmark,
EApparatusStatus OutStatus,
const int32  Capacity = 32 
)
inline

Find existing or create a new chunk for a traitmark.

Parameters
TraitmarkA traitmark to ensure for.
OutStatusThe status of the operation.
CapacityThe desired capacity of the chunk.
Returns
The resulting chunk.

◆ Operate() [1/6]

template<typename ChainT = void, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::Operate ( const MechanicT &  Mechanic)
inline

Process the mechanism using a functor mechanic.

Supports lambdas. Constant mechanic auto-filter version.

The filter is automatically derived from the mechanic's arguments.

Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor argument types by default.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
MechanicThe functor mechanic to operate with. Can be a lambda expression.
Returns
The status of the operation.

◆ Operate() [2/6]

template<typename ChainT = void, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::Operate ( FilterT &&  Filter,
const MechanicT &  Mechanic 
)
inline

Process the mechanism using a functor mechanic.

Supports lambdas. Constant mechanic version.

Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor argument types by default.
FilterTThe type of filter that takes place.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
FilterThe filter to query with.
MechanicThe functor mechanic to operate with. Can be a lambda expression.
Returns
The status of the operation.

◆ Operate() [3/6]

template<typename ChainT = void, typename FilterT = void, typename FunctionT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto AMechanism::Operate ( FilterT &&  Filter,
FunctionT *const  Mechanic 
)
inline

Process the chain using a free function mechanic.

Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on function's argument types by default.
FilterTThe type of filter that takes place.
FunctionTThe type of the mechanic function to operate on the slots.
Parameters
FilterThe filter to query with.
MechanicThe mechanical function to operate with.
Returns
The status of the operation.

◆ Operate() [4/6]

template<typename ChainT = void, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::Operate ( FilterT &&  Filter,
MechanicT &  Mechanic 
)
inline

Process the mechanism using a functor mechanic.

Supports lambdas. Mutable mechanic version.

Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor argument types by default.
FilterTThe type of filter that takes place.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
FilterThe filter to query with.
MechanicThe functor mechanic to operate with. Can be a lambda expression.
Returns
The status of the operation.

◆ Operate() [5/6]

template<typename ChainT = void, typename FunctionT = void, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto AMechanism::Operate ( FunctionT *const  Mechanic)
inline

Process the chain using a free function mechanic.

Auto-filter version.

The filter is automatically derived from the mechanic's arguments.

Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on function's argument types by default.
FunctionTThe type of the mechanic function to operate on the slots.
Parameters
MechanicThe mechanical function to operate with.

◆ Operate() [6/6]

template<typename ChainT = void, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::Operate ( MechanicT &  Mechanic)
inline

Process the mechanism using a functor mechanic.

Supports lambdas. Mutable mechanic auto-filter version.

The filter is automatically derived from the mechanic's arguments.

Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor argument types by default.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
MechanicThe functor mechanic to operate with. Can be a lambda expression.
Returns
The status of the operation.

◆ OperateConcurrently() [1/6]

template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::OperateConcurrently ( const MechanicT &  Mechanic,
const int32  ThreadsCountMax,
const int32  SlotsPerThreadMin = 1,
const bool  bSync = true 
)
inline

Process the mechanism using a functor mechanic in a threaded manner.

Supports lambdas. Constant mechanic auto-filter version.

The filter is derived automatically from the mechanic's arguments.

Note
Only solid chains can be safely operated concurrently.
Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor's argument types by default.
ParadigmThe security paradigm to utilize.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
MechanicThe functor mechanic to operate with. Can be a lambda expression.
ThreadsCountMaxThe maximum number of threads to process with.
SlotsPerThreadMinThe minimum number of slots per thread to process.
bSyncShould the operation be synced within the current branch.
Returns
The outcome of the operation.

◆ OperateConcurrently() [2/6]

template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::OperateConcurrently ( FilterT &&  Filter,
const MechanicT &  Mechanic,
const int32  ThreadsCountMax,
const int32  SlotsPerThreadMin = 1,
const bool  bSync = true 
)
inline

Process the mechanism using a functor mechanic in a threaded manner.

Supports lambdas. Constant mechanic version.

Note
Only solid chains can be safely operated concurrently.
Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor's argument types by default.
ParadigmThe security paradigm to utilize. Taken from ChainT by default.
FilterTThe type of filter to query with.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
FilterThe filter to query with.
MechanicThe functor mechanic to operate with. Can be a lambda expression.
ThreadsCountMaxThe maximum number of threads to process with.
SlotsPerThreadMinThe minimum number of slots per thread to process.
bSyncShould the operation be synced within the current branch.
Returns
The status of the operation.

◆ OperateConcurrently() [3/6]

template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FilterT = void, typename FunctionT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto AMechanism::OperateConcurrently ( FilterT &&  Filter,
FunctionT *const  Mechanic,
const int32  ThreadsCountMax,
const int32  SlotsPerThreadMin = 1,
const bool  bSync = true 
)
inline

Process the chain using a free function mechanic in a parallel manner.

Note
Only solid chains can be safely operated concurrently.
Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on function's argument types by default.
ParadigmThe security paradigm to utilize.
FilterTThe type of filter to query with.
FunctionTThe type of the mechanic function to operate on the slots.
Parameters
FilterThe filter to query with.
MechanicThe mechanical function to operate with.
ThreadsCountMaxThe maximum number of threads to process with.
SlotsPerThreadMinThe minimum number of slots per thread to process.
bSyncShould the operation be synced within the current branch.
Returns
The status of the operation.

◆ OperateConcurrently() [4/6]

template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FilterT = void, typename MechanicT = void, TFilterTypeSecurity< std::decay_t< FilterT > > = true, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::OperateConcurrently ( FilterT &&  Filter,
MechanicT &  Mechanic,
const int32  ThreadsCountMax,
const int32  SlotsPerThreadMin = 1,
const bool  bSync = true 
)
inline

Process the mechanism using a functor mechanic in a threaded manner.

Supports lambdas. Mutable mechanic version.

Note
Only solid chains can be safely operated concurrently.
Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor's argument types by default.
ParadigmThe security paradigm to utilize.
FilterTThe type of filter to query with.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
FilterThe filter to query with.
MechanicThe functor mechanic to operate with. Can be a lambda expression.
ThreadsCountMaxThe maximum number of threads to process with.
SlotsPerThreadMinThe minimum number of slots per thread to process.
bSyncShould the operation be synced within the current branch.
Returns
The status of the operation.

◆ OperateConcurrently() [5/6]

template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename FunctionT = void, typename std::enable_if< std::is_function< FunctionT >::value, bool >::type = true>
auto AMechanism::OperateConcurrently ( FunctionT *const  Mechanic,
const int32  ThreadsCountMax,
const int32  SlotsPerThreadMin = 1,
const bool  bSync = true 
)
inline

Process the chain using a free function mechanic in a parallel manner.

Auto-filter version.

The filter is derived automatically from the mechanic's arguments.

Note
Only solid chains can be safely operated concurrently.
Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on function's argument types by default.
ParadigmThe security paradigm to utilize.
FunctionTThe type of the mechanic function to operate on the slots.
Parameters
MechanicThe mechanical function to operate with.
ThreadsCountMaxThe maximum number of threads to process with.
SlotsPerThreadMinThe minimum number of slots per thread to process.
bSyncShould the operation be synced within the current branch.
Returns
The outcome of the operation.

◆ OperateConcurrently() [6/6]

template<typename ChainT = void, EParadigm Paradigm = EParadigm::Auto, typename MechanicT = void, typename std::enable_if<!std::is_function< MechanicT >::value, bool >::type = true>
auto AMechanism::OperateConcurrently ( MechanicT &  Mechanic,
const int32  ThreadsCountMax,
const int32  SlotsPerThreadMin = 1,
const bool  bSync = true 
)
inline

Process the mechanism using a functor mechanic in a threaded manner.

Supports lambdas. Mutable mechanic auto-filter version.

The filter is derived automatically from the mechanic's arguments.

Note
Only solid chains can be safely operated concurrently.
Template Parameters
ChainTThe type of chain to utilize. Detected automatically based on functor's argument types by default.
ParadigmThe security paradigm to utilize.
MechanicTThe type of the functor to operate on the enchained slots. Can be a lambda expression.
Parameters
MechanicThe functor mechanic to operate with. Can be a lambda expression.
ThreadsCountMaxThe maximum number of threads to process with.
SlotsPerThreadMinThe minimum number of slots per thread to process.
bSyncShould the operation be synced within the current branch.
Returns
The outcome of the operation.

◆ OperatingsNum()

auto AMechanism::OperatingsNum ( ) const
inline

Get the number of current operatings happening within the mechanism.

Note
This value can actually misrepresent the actual number if queried after the WaitForOperatingsCompletion(), cause the newly queued operations may already be altering it.

Each chain also has its own local FCommonChain::OperatingsNum().

Returns
The current number of operatings within the chain.

◆ RegisterMechanical()

EApparatusStatus AMechanism::RegisterMechanical ( TScriptInterface< IMechanical Mechanical)
inline

Register a mechanical within the mechanism.

Parameters
MechanicalA mechanical to register.
Returns
The status of the operation.

◆ RegisterSubjective()

template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > AMechanism::RegisterSubjective ( ISubjective *const  Subjective)

Register a subjective within the mechanism.

The method can be used to re-register a subjective within a different mechanism.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectiveThe subjective to register within the mechanism.
Returns
The outcome of the operation.
EApparatusStatus::Noop If the subjective is already registered.

◆ Reset()

void AMechanism::Reset ( )
override

Reset the mechanism completely, unregistering all of the entities and despawning all of the subjects.

◆ SpawnSubject() [1/15]

template<EParadigm Paradigm = EParadigm::Default>
auto AMechanism::SpawnSubject ( const EFlagmark  Flagmark)
inline

Spawn a new subject with a flagmark within the mechanism, returning the handle to the caller.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
FlagmarkThe initial flagmark of the subject to spawn with.
Returns
A subject handle to initialize with the new entity.

◆ SpawnSubject() [2/15]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandle > AMechanism::SpawnSubject ( const FSubjectRecord SubjectRecord)

Spawn a new subject based on a packed subject data record.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectRecordThe subject record to initialize a new subject with.
Returns
The handle for the newly created subject.

◆ SpawnSubject() [3/15]

FSubjectHandle AMechanism::SpawnSubject ( const FSubjectRecord SubjectRecord,
EApparatusStatus OutStatus 
)
inline

Spawn a new subject within the mechanism based on a record.

Status version.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectRecordThe subject record to initialize a new subject with.
OutStatusThe status of the operation.
Returns
The newly spawned subject handle.
Deprecated:
since 1.23. Use SpawnSubject() within a polite paradigm, please.

◆ SpawnSubject() [4/15]

EApparatusStatus AMechanism::SpawnSubject ( FSubjectHandle OutSubjectHandle,
const EFlagmark  Flagmark = FM_None 
)
inline

Spawn a new subject within the mechanism.

Parameters
[out]OutSubjectHandleA subject handle to initialize with the new entity.
[in]FlagmarkThe initial flagmark of the subject to spawn with.
Returns
The status of the operation.
Deprecated:
since 1.23. Use SpawnSubject() within a polite paradigm, please.

◆ SpawnSubject() [5/15]

EApparatusStatus AMechanism::SpawnSubject ( FSubjectHandle OutSubjectHandle,
const FTraitmark Traitmark,
const EFlagmark  Flagmark = FM_None 
)
inline

Spawn a new subject within the mechanism and a chunk of a specific traitmark.

The chunk's slot will be initialized to a default trait state.

Parameters
[out]OutSubjectHandleA subject handle to initialize with the new entity.
[in]TraitmarkThe traitmark for the chunk to spawn within.
[in]FlagmarkThe initial flagmark of the subject to spawn with. May not contain any of the system-level flags.
Returns
The status of the operation.
Deprecated:
since 1.23. Use SpawnSubject() within a polite paradigm, please.

◆ SpawnSubject() [6/15]

EApparatusStatus AMechanism::SpawnSubject ( FSubjectHandle OutSubjectHandle,
FTraitmark &&  Traitmark,
const EFlagmark  Flagmark = FM_None 
)
inline

Spawn a new subject within the mechanism and a chunk of a specific traitmark.

R-value version.

Parameters
[out]OutSubjectHandleA subject handle to initialize with the new entity.
[in]TraitmarkThe traitmark for the chunk to spawn within.
[in]FlagmarkThe initial flagmark of the subject to spawn with.
Returns
The status of the operation.
Deprecated:
since 1.23. Use SpawnSubject() within a polite paradigm, please.

◆ SpawnSubject() [7/15]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandle > AMechanism::SpawnSubject ( FSubjectRecord &&  SubjectRecord)
inline

Spawn a new subject based on a packed subject data record.

RValue reference compatibility version.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectRecordThe subject record to initialize a new subject with.
Returns
The handle for the newly created subject.

◆ SpawnSubject() [8/15]

FSubjectHandle AMechanism::SpawnSubject ( FSubjectRecord &&  SubjectRecord,
EApparatusStatus OutStatus 
)
inline

Spawn a new subject based on a packed subject data record.

RValue reference compatibility version with a status.

Parameters
SubjectRecordThe subject record to initialize a new subject with.
OutStatusThe status of the operation.
Returns
The handle for the newly created subject.
Deprecated:
since 1.23. Use SpawnSubject() within a polite paradigm, please.

◆ SpawnSubject() [9/15]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandle > AMechanism::SpawnSubject ( FSubjectRecord SubjectRecord)
inline

Spawn a new subject based on a packed subject data record.

Non-constant refernce compatibility version.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectRecordThe subject record to initialize a new subject with.
Returns
The handle for the newly created subject.

◆ SpawnSubject() [10/15]

FSubjectHandle AMechanism::SpawnSubject ( FSubjectRecord SubjectRecord,
EApparatusStatus OutStatus 
)
inline

Spawn a new subject based on a packed subject data record.

Non-constant compatibility version with a status.

Parameters
SubjectRecordThe subject record to initialize a new subject with.
OutStatusThe status of the operation.
Returns
The handle for the newly created subject.
Deprecated:
since 1.23. Use SpawnSubject() within a polite paradigm, please.

◆ SpawnSubject() [11/15]

template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm, FSubjectHandle > AMechanism::SpawnSubject ( Ts &&...  Traits)
inline

Spawn a new subject with traits, returning the handle.

Template Parameters
ParadigmThe paradigm to work under.
TsThe types of traits to spawn with.
Parameters
TraitsThe traits to spawn with.
Returns
A handle for the newly spawned subject.

◆ SpawnSubject() [12/15]

template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto AMechanism::SpawnSubject ( Ts &&...  Traits)
inline

Spawn a new subject with traits, returning the handle.

Default paradigm version.

Template Parameters
ParadigmThe paradigm to work under.
TsThe types of traits to spawn with.
Parameters
TraitsThe traits to spawn with.
Returns
A handle for the newly spawned subject.

◆ SpawnSubject() [13/15]

template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm, FSubjectHandle > AMechanism::SpawnSubject ( Ts &&...  Traits,
const EFlagmark  Flagmark 
)
inline

Spawn a new subject with traits, returning the handle.

Template Parameters
TsThe types of traits to spawn with.
Parameters
TraitsThe traits to spawn with.
FlagmarkThe initial flagmark of the subject to spawn with.
Returns
A handle for the newly spawned subject.

◆ SpawnSubject() [14/15]

template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto AMechanism::SpawnSubject ( Ts &&...  Traits,
const EFlagmark  Flagmark 
)
inline

Spawn a new subject with traits, returning the handle.

Default paradigm version.

Template Parameters
TsThe types of traits to spawn with.
Parameters
TraitsThe traits to spawn with.
FlagmarkThe initial flagmark of the subject to spawn with.
Returns
A handle for the newly spawned subject.

◆ SpawnSubject() [15/15]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, FSubjectHandle > AMechanism::SpawnSubject ( UScriptStruct *const  TraitType,
void *const  TraitData,
const EFlagmark  Flagmark = FM_None 
)
inline

Spawn a new subject with a typed trait data, returning the handle.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
TraitTypeThe type of the trait to spawn with. Must not be a nullptr.
TraitDataThe data fo the trait to spawn with. Must not be a nullptr.
FlagmarkThe initial flagmark of the subject to spawn with.
Returns
A subject handle to initialize with the new entity.

◆ SpawnSubjectDeferred() [1/7]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::SpawnSubjectDeferred ( const FSubjectRecord SubjectRecord)
inline

Spawn a new subject based on a packed subject data record.

Deferred version.

The actual entity creation is deferred until the deferreds are applied either automatically or manually.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectRecordThe subject record to initialize a new subject with.
Returns
The outcome of the operation.

◆ SpawnSubjectDeferred() [2/7]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::SpawnSubjectDeferred ( FSubjectRecord &&  SubjectRecord)
inline

Spawn a new subject based on a packed subject data record.

Deferred version for RValue compatibility.

The actual entity creation is deferred until the deferreds are applied either automatically or manually.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectRecordThe subject record to initialize a new subject with.
Returns
The outcome of the operation.

◆ SpawnSubjectDeferred() [3/7]

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::SpawnSubjectDeferred ( FSubjectRecord SubjectRecord)
inline

Spawn a new subject based on a packed subject data record.

Deferred version for non-constant compatibility.

The actual entity creation is deferred until the deferreds are applied either automatically or manually.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectRecordThe subject record to initialize a new subject with.
Returns
The outcome of the operation.

◆ SpawnSubjectDeferred() [4/7]

template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm > AMechanism::SpawnSubjectDeferred ( Ts &&...  Traits)
inline

Spawn a new subject with traits.

Deferred version.

Template Parameters
ParadigmThe paradigm to work under.
TsThe types of traits to spawn with.
Parameters
TraitsThe traits to spawn with.
Returns
The outcome of the operation.

◆ SpawnSubjectDeferred() [5/7]

template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto AMechanism::SpawnSubjectDeferred ( Ts &&...  Traits)
inline

Spawn a new subject with traits.

Deferred default paradigm version.

Template Parameters
TsThe types of traits to spawn with.
ParadigmThe paradigm to work under.
Parameters
TraitsThe traits to spawn with.
Returns
The outcome of the operation.

◆ SpawnSubjectDeferred() [6/7]

template<EParadigm Paradigm, typename... Ts>
TOutcome< Paradigm > AMechanism::SpawnSubjectDeferred ( Ts &&...  Traits,
const EFlagmark  Flagmark 
)
inline

Spawn a new subject with traits and a flagmark.

Deferred version.

Template Parameters
ParadigmThe paradigm to work under.
TsThe types of traits to spawn with.
Parameters
TraitsThe traits to spawn with.
FlagmarkThe initial flagmark of the subject to spawn with.
Returns
The outcome of the operation.

◆ SpawnSubjectDeferred() [7/7]

template<typename... Ts, EParadigm Paradigm = EParadigm::Default>
auto AMechanism::SpawnSubjectDeferred ( Ts &&...  Traits,
const EFlagmark  Flagmark 
)
inline

Spawn a new subject with traits and a flagmark.

Deferred default paradigm version.

Template Parameters
TsThe types of traits to spawn with.
ParadigmThe paradigm to work under.
Parameters
TraitsThe traits to spawn with.
FlagmarkThe initial flagmark of the subject to spawn with.
Returns
The outcome of the operation.

◆ SubjectivesNum()

int32 AMechanism::SubjectivesNum ( ) const
inline

Get the current number of effective subjectives in the mechanism.

Returns
The number of subjectives in the mechanism.

◆ SubjectsNum()

SubjectIdType AMechanism::SubjectsNum ( ) const

Get the current number of subjects residing within the mechanism.

Returns
The current number of subjects in the mechanism.

◆ UnregisterAllMechanicals()

EApparatusStatus AMechanism::UnregisterAllMechanicals ( )
inline

Unregister all of the currently registered mechanicals.

◆ UnregisterAllSubjectives()

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::UnregisterAllSubjectives ( )

Unregister all of the currently registered subjectives.

◆ UnregisterMechanical()

EApparatusStatus AMechanism::UnregisterMechanical ( TScriptInterface< IMechanical Mechanical)
inline

Unregister a mechanical from the mechanism.

Parameters
MechanicalA mechanical to unregister.
Returns
The status of the operation.

◆ UnregisterSubjective()

template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > AMechanism::UnregisterSubjective ( ISubjective *const  Subjective)

Remove a subjective from the mechanism completely.

Template Parameters
ParadigmThe paradigm to work under.
Parameters
SubjectiveThe subjective to unregister.
Returns
The outcome of the operation.
EApparatusStatus::Noop If the subjective is already unregistered.

◆ WaitForOperatingsCompletion() [1/3]

void AMechanism::WaitForOperatingsCompletion ( ) const
inline

Wait for all the current operatings to be completed within all chains.

You can use this method after you queued up the asynchronous operatings in order to sync them all.

Each chain also has its own local FCommonChain::WaitForOperatingsCompletion().

◆ WaitForOperatingsCompletion() [2/3]

bool AMechanism::WaitForOperatingsCompletion ( const FTimespan &  WaitTime,
const bool  bIgnoreThreadIdleStats = false 
) const
inline

Wait for all the current operatings to be completed within all chains.

You can use this method after you queued up the asynchronous operatings in order to sync them all.

Each chain also has its own local FCommonChain::WaitForOperatingsCompletion().

Parameters
WaitTimeThe time to wait.
bIgnoreThreadIdleStatsIf true, ignores ThreadIdleStats
Returns
true if the event was triggered, false if the wait timed out.

◆ WaitForOperatingsCompletion() [3/3]

bool AMechanism::WaitForOperatingsCompletion ( const uint32  WaitTimeMsec,
const bool  bIgnoreThreadIdleStats = false 
) const
inline

Wait for all the current operatings to be completed within all chains.

You can use this method after you queued up the asynchronous operatings in order to sync them all.

Each chain also has its own local FCommonChain::WaitForOperatingsCompletion().

Parameters
WaitTimeMsecThe time to wait. Measured in milliseconds.
bIgnoreThreadIdleStatsIf true, ignores ThreadIdleStats.
Returns
true if the event was triggered, false if the wait timed out.

Friends And Related Function Documentation

◆ FCommonChain

friend struct FCommonChain
friend

◆ FCommonSubjectHandle

friend struct FCommonSubjectHandle
friend

◆ FSubjectInfo

friend struct FSubjectInfo
friend

◆ FSubjectNetworkState

friend struct FSubjectNetworkState
friend

◆ IIterable

IIterable
friend

◆ TBeltIt

template<typename SubjectHandleT >
friend struct TBeltIt
friend

◆ TChain

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

◆ TChunkIt

template<typename SubjectHandleT >
friend struct TChunkIt
friend

◆ UApparatusFunctionLibrary

friend class UApparatusFunctionLibrary
friend

◆ UBelt

friend class UBelt
friend

◆ UChunk

friend class UChunk
friend

◆ UMachine

friend class UMachine
friend

◆ UNetworkBearerComponent

friend class UNetworkBearerComponent
friend

Member Data Documentation

◆ FirstId

constexpr IdType AMechanism::FirstId = 0x01
staticconstexpr

The first valid mechanism identifier.

◆ FirstSubjectPlace

constexpr SubjectIdType AMechanism::FirstSubjectPlace = FSubjectInfo::FirstPlace
staticconstexpr

A first valid subject placement index within the pool.

◆ FoundIterablesInlineSize

constexpr int32 AMechanism::FoundIterablesInlineSize = 32
staticconstexpr

The pre-allocated size of the iterables being searched.

◆ InstancesMax

constexpr int32 AMechanism::InstancesMax = LastId - FirstId + 1
staticconstexpr

The maximum possible number of mechanisms within the machine.

◆ InvalidId

constexpr IdType AMechanism::InvalidId = 0x00
staticconstexpr

Invalid mechanism identifier.

◆ InvalidSubjectId

constexpr SubjectIdType AMechanism::InvalidSubjectId = FSubjectInfo::InvalidId
staticconstexpr

Invalid subject identifier.

◆ LastId

constexpr IdType AMechanism::LastId = TNumericLimits<IdType>::Max() - 1
staticconstexpr

The last valid mechanism identifier.

◆ LastSubjectPlace

constexpr SubjectIdType AMechanism::LastSubjectPlace = FSubjectInfo::LastPlace
staticconstexpr

The maximum valid subject placement index within the pool.

◆ SubjectPlacesPerMechanism

constexpr SubjectIdType AMechanism::SubjectPlacesPerMechanism = FSubjectInfo::PlacesPerMechanismMax
staticconstexpr

The maximum number of subjects within the machine.


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