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

Multiprocessor dispatcher delegating to child dispatchers. More...

#include <mp_dispatcher.h>

Inheritance diagram for contur::MPDispatcher:
Collaboration diagram for contur::MPDispatcher:

Public Member Functions

 MPDispatcher (std::vector< std::reference_wrapper< IDispatcher > > dispatchers)
 Constructs MP dispatcher with worker dispatchers.
 ~MPDispatcher () override
 MPDispatcher (const MPDispatcher &)=delete
MPDispatcheroperator= (const MPDispatcher &)=delete
 MPDispatcher (MPDispatcher &&) noexcept
MPDispatcheroperator= (MPDispatcher &&) noexcept
Result< void > createProcess (std::unique_ptr< ProcessImage > process, Tick currentTick) override
 Routes a process to one child dispatcher.
Result< void > dispatch (std::size_t tickBudget) override
 Runs dispatch cycle across all child dispatchers.
Result< void > terminateProcess (ProcessId pid, Tick currentTick) override
 Terminates process in the child dispatcher that owns it.
void tick () override
 Ticks all child dispatchers.
std::size_t processCount () const noexcept override
 Aggregated number of processes across children.
bool hasProcess (ProcessId pid) const noexcept override
 Returns true if any child contains process pid.
Public Member Functions inherited from contur::IDispatcher
virtual ~IDispatcher ()=default

Private Attributes

std::unique_ptr< Impl > impl_

Detailed Description

Multiprocessor dispatcher delegating to child dispatchers.

Definition at line 15 of file mp_dispatcher.h.

Constructor & Destructor Documentation

◆ MPDispatcher() [1/3]

contur::MPDispatcher::MPDispatcher ( std::vector< std::reference_wrapper< IDispatcher > > dispatchers)
explicit

Constructs MP dispatcher with worker dispatchers.

Parameters
dispatchersNon-empty list of child dispatchers.

◆ ~MPDispatcher()

contur::MPDispatcher::~MPDispatcher ( )
override

◆ MPDispatcher() [2/3]

contur::MPDispatcher::MPDispatcher ( const MPDispatcher & )
delete

◆ MPDispatcher() [3/3]

contur::MPDispatcher::MPDispatcher ( MPDispatcher && )
noexcept

Member Function Documentation

◆ createProcess()

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

Routes a process to one child dispatcher.

Implements contur::IDispatcher.

◆ dispatch()

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

Runs dispatch cycle across all child dispatchers.

Implements contur::IDispatcher.

◆ hasProcess()

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

Returns true if any child contains process pid.

Implements contur::IDispatcher.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ processCount()

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

Aggregated number of processes across children.

Implements contur::IDispatcher.

◆ terminateProcess()

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

Terminates process in the child dispatcher that owns it.

Implements contur::IDispatcher.

◆ tick()

void contur::MPDispatcher::tick ( )
overridevirtual

Ticks all child dispatchers.

Implements contur::IDispatcher.

Member Data Documentation

◆ impl_

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

Definition at line 48 of file mp_dispatcher.h.


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