Apparatus
Version 1.23
ECS data-oriented workflow for Unreal Engine.
|
A common interface for all mechanisms. More...
#include <Mechanical.h>
Public Member Functions | |
AMechanism * | GetMechanism () const |
Get the mechanism this mechanical is part of. | |
FSubjectHandle | SpawnSubject (const EFlagmark Flagmark=FM_None) |
Spawn a new subject, returning its handle. | |
template<typename ChainT = TChain<TChunkIt<FSubjectHandle>, TBeltIt<FSubjectHandle>>> | |
TSharedRef< ChainT > | Enchain (const FFilter &InFilter) const |
Enchain iterables using the supplied filter. | |
TSharedRef< TChain< TChunkIt< FSolidSubjectHandle >, TBeltIt< FSolidSubjectHandle > > > | EnchainSolid (const FFilter &InFilter) const |
Solid-enchain iterables using the supplied filter. | |
void | ReceiveBoot () |
Process newly created subjects. | |
void | ReceiveInputTick () |
Process a pre-steady input tick. | |
void | ReceiveSteadyTick (float DeltaSeconds) |
Process a fixed-rate steady tick. | |
void | ReceivePresentationTick (float DeltaSeconds, float FrameRatio, float FutureFactor) |
Process a past-steady presentation tick. | |
virtual void | Boot () |
Process newly created subjects. | |
virtual void | InputTick () |
Process a pre-steady input tick. | |
virtual void | SteadyTick (float DeltaTime) |
Process a fixed-rate steady tick. | |
virtual void | PresentationTick (float DeltaSeconds, float FrameRatio, float FutureFactor) |
Process a past-steady presentation tick. | |
IMechanical () | |
virtual float | GetSteadyDeltaTime () const |
Get the time interval for steady ticking. | |
virtual float | GetOwnTime () const |
Get own Mechanical's local life time. | |
float | GetProcessedSteadyTime () const |
Get the time of the last processed steady frame. | |
float | CalcSteadyFrameRatio () const |
The current ratio within the steady frame. | |
void | GetSteadyFrame (int64 &OutFrame) const |
Get the current steady frame. | |
float | GetSteadyTime () const |
Get the total steady time elapsed. | |
float | CalcSteadyFutureFactor () const |
The current steady future factor. | |
Operating | |
template<typename ChainT = void, typename FilterT = void, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type | Operate (FilterT &&Filter, const MechanicT &Mechanic) |
Process the mechanism using a functor mechanic. | |
template<typename ChainT = void, typename FilterT = void, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type | Operate (FilterT &&Filter, MechanicT &Mechanic) |
Process the mechanism using a functor mechanic. | |
template<typename ChainT = void, typename FilterT = void, typename FunctionT = void> | |
std::enable_if< std::is_function< FunctionT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type | Operate (FilterT &&Filter, FunctionT *const Mechanic) |
Process the chain using a free function mechanic. | |
template<typename ChainT = void, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type | Operate (const MechanicT &Mechanic) |
Process the mechanism using a functor mechanic. | |
template<typename ChainT = void, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type | Operate (MechanicT &Mechanic) |
Process the mechanism using a functor mechanic. | |
template<typename ChainT = void, typename FunctionT = void> | |
std::enable_if< std::is_function< FunctionT >::value, EApparatusStatus >::type | Operate (FunctionT *const Mechanic) |
Process the chain using a free function mechanic. | |
template<typename ChainT = void, EParadigm Paradigm = EParadigm::None, typename FilterT = void, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type | 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::None, typename FilterT = void, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type | 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::None, typename FilterT = void, typename FunctionT = void> | |
std::enable_if< std::is_function< FunctionT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type | 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::None, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type | 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::None, typename MechanicT = void> | |
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type | 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::None, typename FunctionT = void> | |
std::enable_if< std::is_function< FunctionT >::value, EApparatusStatus >::type | 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. | |
Protected Member Functions | |
virtual void | DoTick (float NewTime, float DeltaTime, float SteadyDeltaTime) |
Perform a standard ticking routine. | |
void | DoRegister () |
void | DoUnregister () |
void | DoPostLogin (APlayerController *NewPlayer) |
float | DoGetProcessedSteadyTime (float SteadyDeltaTime) const |
float | DoCalcSteadyFrameRatio (const float Time, const float SteadyDeltaTime) const |
float | DoCalcSteadyFutureFactor (const float Time, const float SteadyDeltaTime) const |
float | GetProcessedSteadyTime_Implementation () const |
float | CalcSteadyFrameRatio_Implementation () const |
void | GetSteadyFrame_Implementation (int64 &OutFrame) const |
float | CalcSteadyFutureFactor_Implementation () const |
float | GetSteadyTime_Implementation () const |
Protected Attributes | |
int64 | SteadyFrame = 0 |
The steady frame we are currently part of. | |
int64 | ProcessedSteadyFrame = -1 |
The last, actually processed steady frame. | |
float | PrevTime = NAN |
The game time of the previous tick. | |
uint32 | bInsideTick: 1 |
Is this mechanism currently updating? | |
uint32 | bInsideSteadyTick: 1 |
Is this mechanism currently in the process of steady ticking? | |
uint32 | bInsidePresentationTick: 1 |
Is this mechanism currently in the process of presentation ticking? | |
Friends | |
class | UMachine |
A common interface for all mechanisms.
|
inline |
|
inlinevirtual |
Process newly created subjects.
|
inline |
The current ratio within the steady frame.
This is in relation between the previous steady frame and the current next one. Should be used for interframe interpolation.
|
inlineprotected |
|
inline |
The current steady future factor.
This is in relation between the previous change time delta to the next steady frame change delta time.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
protected |
|
protected |
|
inlineprotectedvirtual |
Perform a standard ticking routine.
The function can be used in the descendants to perform a standard ticking routine.
|
protected |
TSharedRef< ChainT > IMechanical::Enchain | ( | const FFilter & | InFilter | ) | const |
Enchain iterables using the supplied filter.
InFilter | A filter to enchain with. |
TSharedRef< TChain< TChunkIt< FSolidSubjectHandle >, TBeltIt< FSolidSubjectHandle > > > IMechanical::EnchainSolid | ( | const FFilter & | InFilter | ) | const |
Solid-enchain iterables using the supplied filter.
InFilter | A filter to enchain with. |
AMechanism * IMechanical::GetMechanism | ( | ) | const |
Get the mechanism this mechanical is part of.
|
inlinevirtual |
Get own Mechanical's local life time.
Should be overriden in the descendants.
Reimplemented in AMechanicalActor, UMechanicalActorComponent, AMechanicalGameMode, AMechanicalGameModeBase, and AMechanicalPlayerController.
|
inline |
Get the time of the last processed steady frame.
|
inlineprotected |
|
inlinevirtual |
Get the time interval for steady ticking.
Should be overriden in the descendants to provide a propertie's value.
Reimplemented in AMechanicalActor, UMechanicalActorComponent, AMechanicalGameMode, AMechanicalGameModeBase, and AMechanicalPlayerController.
void IMechanical::GetSteadyFrame | ( | int64 & | OutFrame | ) | const |
Get the current steady frame.
|
inlineprotected |
|
inline |
Get the total steady time elapsed.
|
inlineprotected |
|
inlinevirtual |
Process a pre-steady input tick.
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type IMechanical::Operate | ( | const MechanicT & | Mechanic | ) |
Process the mechanism using a functor mechanic.
Supports lambdas. Constant mechanic auto-filter version.
ChainT | The type of chain to utilize. Detected automatically based on functor argument types by default. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type IMechanical::Operate | ( | FilterT && | Filter, |
const MechanicT & | Mechanic | ||
) |
Process the mechanism using a functor mechanic.
Supports lambdas. Constant mechanic version.
ChainT | The type of chain to utilize. Detected automatically based on functor argument types by default. |
FilterT | The type of filter that takes place. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Filter | The filter to query with. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
std::enable_if< std::is_function< FunctionT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type IMechanical::Operate | ( | FilterT && | Filter, |
FunctionT *const | Mechanic | ||
) |
Process the chain using a free function mechanic.
ChainT | The type of chain to utilize. Detected automatically based on function's argument types by default. |
FilterT | The type of filter that takes place. |
FunctionT | The type of the mechanic function to operate on the slots. |
Filter | The filter to query with. |
Mechanic | The mechanical function to operate with. |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type IMechanical::Operate | ( | FilterT && | Filter, |
MechanicT & | Mechanic | ||
) |
Process the mechanism using a functor mechanic.
Supports lambdas. Mutable mechanic version.
ChainT | The type of chain to utilize. Detected automatically based on functor argument types by default. |
FilterT | The type of filter that takes place. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Filter | The filter to query with. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
std::enable_if< std::is_function< FunctionT >::value, EApparatusStatus >::type IMechanical::Operate | ( | FunctionT *const | Mechanic | ) |
Process the chain using a free function mechanic.
Auto-filter version.
ChainT | The type of chain to utilize. Detected automatically based on function's argument types by default. |
FunctionT | The type of the mechanic function to operate on the slots. |
Mechanic | The mechanical function to operate with. |
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type IMechanical::Operate | ( | MechanicT & | Mechanic | ) |
Process the mechanism using a functor mechanic.
Supports lambdas. Mutable mechanic auto-filter version.
ChainT | The type of chain to utilize. Detected automatically based on functor argument types by default. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type IMechanical::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.
Supports lambdas. Constant mechanic auto-filter version.
ChainT | The type of chain to utilize. Detected automatically based on functor's argument types by default. |
Paradigm | The security paradigm to utilize. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
ThreadsCountMax | The maximum number of threads to process with. |
SlotsPerThreadMin | The minimum number of slots per thread to process. |
bSync | Should the operation be synced within the current branch. |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type IMechanical::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.
Supports lambdas. Constant mechanic version.
ChainT | The type of chain to utilize. Detected automatically based on functor's argument types by default. |
Paradigm | The security paradigm to utilize. |
FilterT | The type of filter to query with. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Filter | The filter to query with. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
ThreadsCountMax | The maximum number of threads to process with. |
SlotsPerThreadMin | The minimum number of slots per thread to process. |
bSync | Should the operation be synced within the current branch. |
std::enable_if< std::is_function< FunctionT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type IMechanical::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.
ChainT | The type of chain to utilize. Detected automatically based on function's argument types by default. |
Paradigm | The security paradigm to utilize. |
FilterT | The type of filter to query with. |
FunctionT | The type of the mechanic function to operate on the slots. |
Filter | The filter to query with. |
Mechanic | The mechanical function to operate with. |
ThreadsCountMax | The maximum number of threads to process with. |
SlotsPerThreadMin | The minimum number of slots per thread to process. |
bSync | Should the operation be synced within the current branch. |
std::enable_if<!std::is_function< MechanicT >::value &&std::is_base_of< FFilterIndicator, FilterT >::value, EApparatusStatus >::type IMechanical::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.
Supports lambdas. Mutable mechanic version.
ChainT | The type of chain to utilize. Detected automatically based on functor's argument types by default. |
Paradigm | The security paradigm to utilize. |
FilterT | The type of filter to query with. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Filter | The filter to query with. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
ThreadsCountMax | The maximum number of threads to process with. |
SlotsPerThreadMin | The minimum number of slots per thread to process. |
bSync | Should the operation be synced within the current branch. |
std::enable_if< std::is_function< FunctionT >::value, EApparatusStatus >::type IMechanical::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.
Auto-filter version.
ChainT | The type of chain to utilize. Detected automatically based on function's argument types by default. |
Paradigm | The security paradigm to utilize. |
FunctionT | The type of the mechanic function to operate on the slots. |
Mechanic | The mechanical function to operate with. |
ThreadsCountMax | The maximum number of threads to process with. |
SlotsPerThreadMin | The minimum number of slots per thread to process. |
bSync | Should the operation be synced within the current branch. |
std::enable_if<!std::is_function< MechanicT >::value, EApparatusStatus >::type IMechanical::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.
Supports lambdas. Mutable mechanic auto-filter version.
ChainT | The type of chain to utilize. Detected automatically based on functor's argument types by default. |
Paradigm | The security paradigm to utilize. |
MechanicT | The type of the functor to operate on the enchained slots. Can be a lambda expression. |
Mechanic | The functor mechanic to operate with. Can be a lambda expression. |
ThreadsCountMax | The maximum number of threads to process with. |
SlotsPerThreadMin | The minimum number of slots per thread to process. |
bSync | Should the operation be synced within the current branch. |
|
inlinevirtual |
Process a past-steady presentation tick.
DeltaSeconds | The fixed delta time in seconds. |
FrameRatio | The steady frame ratio. |
FutureFactor | The steady future factor. |
void IMechanical::ReceiveBoot | ( | ) |
Process newly created subjects.
void IMechanical::ReceiveInputTick | ( | ) |
Process a pre-steady input tick.
void IMechanical::ReceivePresentationTick | ( | float | DeltaSeconds, |
float | FrameRatio, | ||
float | FutureFactor | ||
) |
Process a past-steady presentation tick.
DeltaSeconds | The fixed delta time in seconds. |
FrameRatio | The steady frame ratio. |
FutureFactor | The steady future factor. |
void IMechanical::ReceiveSteadyTick | ( | float | DeltaSeconds | ) |
Process a fixed-rate steady tick.
FSubjectHandle IMechanical::SpawnSubject | ( | const EFlagmark | Flagmark = FM_None | ) |
Spawn a new subject, returning its handle.
Flagmark | The initial flagmark of the subject to spawn with. |
|
inlinevirtual |
Process a fixed-rate steady tick.
|
friend |
|
protected |
Is this mechanism currently in the process of presentation ticking?
|
protected |
Is this mechanism currently in the process of steady ticking?
|
protected |
Is this mechanism currently updating?
|
protected |
The game time of the previous tick.
|
protected |
The last, actually processed steady frame.
-1 if the steady tick was not run yet.
|
protected |
The steady frame we are currently part of.