contur2
Loading...
Searching...
No Matches
contur::IDispatcher Class Referenceabstract

Interface for process lifecycle dispatch orchestration. More...

#include <i_dispatcher.h>

Inheritance diagram for contur::IDispatcher:

Public Member Functions

virtual ~IDispatcher ()=default
virtual Result< void > createProcess (std::unique_ptr< ProcessImage > process, Tick currentTick)=0
 Admits a new process into the system.
virtual Result< void > dispatch (std::size_t tickBudget)=0
 Runs one scheduling/execution dispatch cycle.
virtual Result< void > terminateProcess (ProcessId pid, Tick currentTick)=0
 Terminates a managed process immediately.
virtual void tick ()=0
 Advances dispatcher-owned simulation time by one tick.
virtual std::size_t processCount () const noexcept=0
 Returns number of processes tracked by dispatcher.
virtual bool hasProcess (ProcessId pid) const noexcept=0
 Returns whether process exists.

Detailed Description

Interface for process lifecycle dispatch orchestration.

Definition at line 17 of file i_dispatcher.h.

Constructor & Destructor Documentation

◆ ~IDispatcher()

virtual contur::IDispatcher::~IDispatcher ( )
virtualdefault

Member Function Documentation

◆ createProcess()

virtual Result< void > contur::IDispatcher::createProcess ( std::unique_ptr< ProcessImage > process,
Tick currentTick )
nodiscardpure virtual

Admits a new process into the system.

Parameters
processOwned process image.
currentTickCurrent simulation tick.
Returns
Ok on success or an error code.

Implemented in contur::Dispatcher, and contur::MPDispatcher.

◆ dispatch()

virtual Result< void > contur::IDispatcher::dispatch ( std::size_t tickBudget)
nodiscardpure virtual

Runs one scheduling/execution dispatch cycle.

Parameters
tickBudgetTime budget for selected process.
Returns
Ok on success or an error code.

Implemented in contur::Dispatcher, and contur::MPDispatcher.

◆ hasProcess()

virtual bool contur::IDispatcher::hasProcess ( ProcessId pid) const
nodiscardpure virtualnoexcept

Returns whether process exists.

Implemented in contur::Dispatcher, and contur::MPDispatcher.

◆ processCount()

virtual std::size_t contur::IDispatcher::processCount ( ) const
nodiscardpure virtualnoexcept

Returns number of processes tracked by dispatcher.

Implemented in contur::Dispatcher, and contur::MPDispatcher.

◆ terminateProcess()

virtual Result< void > contur::IDispatcher::terminateProcess ( ProcessId pid,
Tick currentTick )
nodiscardpure virtual

Terminates a managed process immediately.

Parameters
pidProcess identifier.
currentTickCurrent simulation tick.
Returns
Ok on success or NotFound when process is unknown.

Implemented in contur::Dispatcher, and contur::MPDispatcher.

◆ tick()

virtual void contur::IDispatcher::tick ( )
pure virtual

Advances dispatcher-owned simulation time by one tick.

Implemented in contur::Dispatcher, and contur::MPDispatcher.


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