contur2
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
44
45 // Non-copyable, movable
49 InterpreterEngine &operator=(InterpreterEngine &&) noexcept;
50
52 [[nodiscard]] ExecutionResult execute(ProcessImage &process, std::size_t tickBudget) override;
53
55 void halt(ProcessId pid) override;
56
58 [[nodiscard]] std::string_view name() const noexcept override;
59
60 private:
61 struct Impl;
62 std::unique_ptr<Impl> impl_;
63 };
64
65} // 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
InterpreterEngine(const InterpreterEngine &)=delete
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().