contur2
Loading...
Searching...
No Matches
contur::Dispatcher Class Referencefinal

Uniprocessor dispatcher implementation. More...

#include <dispatcher.h>

Inheritance diagram for contur::Dispatcher:
Collaboration diagram for contur::Dispatcher:

Public Member Functions

 Dispatcher (IScheduler &scheduler, IExecutionEngine &engine, IVirtualMemory &virtualMemory, IClock &clock)
 Constructs dispatcher from subsystem references.
 ~Dispatcher () override
 Dispatcher (const Dispatcher &)=delete
Dispatcheroperator= (const Dispatcher &)=delete
 Dispatcher (Dispatcher &&) noexcept
Dispatcheroperator= (Dispatcher &&) noexcept
Result< void > createProcess (std::unique_ptr< ProcessImage > process, Tick currentTick) override
 Admits process and initializes memory/scheduler state.
Result< void > dispatch (std::size_t tickBudget) override
 Executes one dispatch cycle for selected process.
Result< void > terminateProcess (ProcessId pid, Tick currentTick) override
 Terminates a process and reclaims associated resources.
void tick () override
 Advances dispatcher clock by one tick.
std::size_t processCount () const noexcept override
 Number of managed processes.
bool hasProcess (ProcessId pid) const noexcept override
 Checks whether process id is currently managed.
Public Member Functions inherited from contur::IDispatcher
virtual ~IDispatcher ()=default

Private Attributes

std::unique_ptr< Impl > impl_

Detailed Description

Uniprocessor dispatcher implementation.

Coordinates scheduler selection, execution engine runs, and virtual-memory lifecycle for active processes.

Definition at line 21 of file dispatcher.h.

Constructor & Destructor Documentation

◆ Dispatcher() [1/3]

contur::Dispatcher::Dispatcher ( IScheduler & scheduler,
IExecutionEngine & engine,
IVirtualMemory & virtualMemory,
IClock & clock )

Constructs dispatcher from subsystem references.

◆ ~Dispatcher()

contur::Dispatcher::~Dispatcher ( )
override

◆ Dispatcher() [2/3]

contur::Dispatcher::Dispatcher ( const Dispatcher & )
delete

◆ Dispatcher() [3/3]

contur::Dispatcher::Dispatcher ( Dispatcher && )
noexcept

Member Function Documentation

◆ createProcess()

Result< void > contur::Dispatcher::createProcess ( std::unique_ptr< ProcessImage > process,
Tick currentTick )
nodiscardoverridevirtual

Admits process and initializes memory/scheduler state.

Implements contur::IDispatcher.

◆ dispatch()

Result< void > contur::Dispatcher::dispatch ( std::size_t tickBudget)
nodiscardoverridevirtual

Executes one dispatch cycle for selected process.

Implements contur::IDispatcher.

◆ hasProcess()

bool contur::Dispatcher::hasProcess ( ProcessId pid) const
nodiscardoverridevirtualnoexcept

Checks whether process id is currently managed.

Implements contur::IDispatcher.

◆ operator=() [1/2]

Dispatcher & contur::Dispatcher::operator= ( const Dispatcher & )
delete

◆ operator=() [2/2]

Dispatcher & contur::Dispatcher::operator= ( Dispatcher && )
noexcept

◆ processCount()

std::size_t contur::Dispatcher::processCount ( ) const
nodiscardoverridevirtualnoexcept

Number of managed processes.

Implements contur::IDispatcher.

◆ terminateProcess()

Result< void > contur::Dispatcher::terminateProcess ( ProcessId pid,
Tick currentTick )
nodiscardoverridevirtual

Terminates a process and reclaims associated resources.

Implements contur::IDispatcher.

◆ tick()

void contur::Dispatcher::tick ( )
overridevirtual

Advances dispatcher clock by one tick.

Implements contur::IDispatcher.

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> contur::Dispatcher::impl_
private

Definition at line 53 of file dispatcher.h.


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