Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FCommonChain::TCommonRunnableMechanic< ChainT > Struct Template Reference

The runnable mechanical wrapping. More...

#include <CommonChain.h>

Inheritance diagram for FCommonChain::TCommonRunnableMechanic< ChainT >:
Inheritance graph
[legend]
Collaboration diagram for FCommonChain::TCommonRunnableMechanic< ChainT >:
Collaboration graph
[legend]

Public Member Functions

auto GetOwner () const
 Get the owning chain of the runnable.
 
 TCommonRunnableMechanic (const ChainT *const InOwner, const bool bInConcurrent=false)
 Initialize a new runnable mechanic instance.
 
 ~TCommonRunnableMechanic () override
 Finalize the mechanic runnable.
 
- Public Member Functions inherited from FCommonChain::FCommonRunnableMechanic
bool ShouldStop () const
 
void Stop () override
 
auto HasFinished () const
 Check if the runnable has finished its execution.
 
EApparatusStatus Halt (bool bShouldWait=true)
 Halt the execution of the runnable on its thread.
 
EApparatusStatus WaitForCompletion ()
 Wait for the mechanic to complete.
 
 FCommonRunnableMechanic (const bool bInConcurrent)
 Initialize the base mechanic.
 
 ~FCommonRunnableMechanic () override
 

Protected Member Functions

void DoBeginRun ()
 This must be executed within a new thread's context, which is always within a solid mechanism.
 
void DoEndRun ()
 This must be executed within a new thread context.
 
uint32 Run () override
 
EApparatusStatus DoLaunchAsync (int32 InId)
 Launch the asynchronous execution.
 

Protected Attributes

const ChainT * Owner = nullptr
 The owner of the runnable.
 
- Protected Attributes inherited from FCommonChain::FCommonRunnableMechanic
bool bConcurrent = false
 Is the runnable asynchronous (concurrent).
 
FRunnableThread * Thread = nullptr
 The executing thread.
 
std::atomic< boolbStop {false}
 Manual stop signal.
 
std::atomic< boolbFinished {false}
 Has the runnable finished executing.
 

Detailed Description

template<typename ChainT>
struct FCommonChain::TCommonRunnableMechanic< ChainT >

The runnable mechanical wrapping.

Can be run both in the main and parallel threads.

The wrapping is also used in the context of usual single-threaded operating as a wrapper.

Constructor & Destructor Documentation

◆ TCommonRunnableMechanic()

template<typename ChainT >
FCommonChain::TCommonRunnableMechanic< ChainT >::TCommonRunnableMechanic ( const ChainT *const  InOwner,
const bool  bInConcurrent = false 
)
inline

Initialize a new runnable mechanic instance.

Parameters
InOwnerThe owning mechanic to operate. May actually be a nullptr.
bInConcurrentShould the mechanic run as part of a concurrent workflow.

◆ ~TCommonRunnableMechanic()

template<typename ChainT >
FCommonChain::TCommonRunnableMechanic< ChainT >::~TCommonRunnableMechanic ( )
inlineoverride

Finalize the mechanic runnable.

Member Function Documentation

◆ DoBeginRun()

template<typename ChainT >
void FCommonChain::TCommonRunnableMechanic< ChainT >::DoBeginRun ( )
protected

This must be executed within a new thread's context, which is always within a solid mechanism.

◆ DoEndRun()

template<typename ChainT >
void FCommonChain::TCommonRunnableMechanic< ChainT >::DoEndRun ( )
protected

This must be executed within a new thread context.

◆ DoLaunchAsync()

template<typename ChainT >
EApparatusStatus FCommonChain::TCommonRunnableMechanic< ChainT >::DoLaunchAsync ( int32  InId)
inlineprotected

Launch the asynchronous execution.

Note
This method should be launched in the context of an origin thread.

The thread is created automatically.

Parameters
InIdThe unique identifier of the thread.

◆ GetOwner()

template<typename ChainT >
auto FCommonChain::TCommonRunnableMechanic< ChainT >::GetOwner ( ) const
inline

Get the owning chain of the runnable.

◆ Run()

template<typename ChainT >
uint32 FCommonChain::TCommonRunnableMechanic< ChainT >::Run ( )
inlineoverrideprotected

Member Data Documentation

◆ Owner

template<typename ChainT >
const ChainT* FCommonChain::TCommonRunnableMechanic< ChainT >::Owner = nullptr
protected

The owner of the runnable.


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