Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
interpreter_engine.h
Go to the documentation of this file.
1
8
9#pragma once
10
11#include <memory>
12
14
15namespace contur {
16
17 class ICPU;
18 class IMemory;
19
36 {
37 public:
41 explicit InterpreterEngine(ICPU &cpu, IMemory &memory);
42
45
46 // Non-copyable, movable
51
53 InterpreterEngine &operator=(InterpreterEngine &&) noexcept;
54
56 [[nodiscard]] ExecutionResult execute(ProcessImage &process, std::size_t tickBudget) override;
57
59 void halt(ProcessId pid) override;
60
62 [[nodiscard]] std::string_view name() const noexcept override;
63
64 private:
65 struct Impl;
66 std::unique_ptr<Impl> impl_;
67 };
68
69} // namespace contur
Abstract CPU interface.
Definition i_cpu.h:21
Abstract interface for linear addressable memory.
Definition i_memory.h:19
std::string_view name() const noexcept override
Returns the human-readable name of this engine.
std::unique_ptr< Impl > impl_
void halt(ProcessId pid) override
Forcibly halts execution of the given process.
InterpreterEngine & operator=(const InterpreterEngine &)=delete
ExecutionResult execute(ProcessImage &process, std::size_t tickBudget) override
Executes the given process for up to tickBudget ticks.
InterpreterEngine(ICPU &cpu, IMemory &memory)
Constructs an InterpreterEngine.
InterpreterEngine(InterpreterEngine &&) noexcept
Move-constructs interpreter engine state.
InterpreterEngine(const InterpreterEngine &)=delete
~InterpreterEngine() override
Destroys interpreter engine.
Full in-memory representation of a process.
IExecutionEngine — abstract interface for process execution engines.
Definition block.h:15
std::uint32_t ProcessId
Unique identifier for a process.
Definition types.h:12
Result of an execution burst returned by IExecutionEngine::execute().