Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
i_kernel_read_model.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <memory>
7
8#include "contur/core/error.h"
9
12
13namespace contur {
14
17 {
18 public:
20 virtual ~IKernelReadModel() = default;
21
24 [[nodiscard]] virtual Result<TuiSnapshot> captureSnapshot() const = 0;
25 };
26
28 class KernelReadModel final : public IKernelReadModel
29 {
30 public:
33 explicit KernelReadModel(const IKernelDiagnostics &diagnostics);
34
36 ~KernelReadModel() override;
37
40
43
46
48 KernelReadModel &operator=(KernelReadModel &&) noexcept;
49
51 [[nodiscard]] Result<TuiSnapshot> captureSnapshot() const override;
52
53 private:
54 struct Impl;
55 std::unique_ptr<Impl> impl_;
56 };
57
58} // namespace contur
Read-only diagnostics interface for querying kernel state.
Read-only adapter contract for capturing UI-facing kernel snapshots.
virtual Result< TuiSnapshot > captureSnapshot() const =0
Captures current kernel state into an immutable TUI snapshot.
virtual ~IKernelReadModel()=default
Virtual destructor for interface-safe polymorphic cleanup.
KernelReadModel(KernelReadModel &&) noexcept
Move-constructs read-model state.
KernelReadModel(const IKernelDiagnostics &diagnostics)
Constructs read-model bound to diagnostics source.
Result< TuiSnapshot > captureSnapshot() const override
Captures current kernel state into an immutable TUI snapshot.
std::unique_ptr< Impl > impl_
KernelReadModel(const KernelReadModel &)=delete
Copy construction is disabled.
~KernelReadModel() override
Destroys read-model.
KernelReadModel & operator=(const KernelReadModel &)=delete
Copy assignment is disabled.
A result type that holds either a success value of type T or an ErrorCode.
Definition error.h:104
Error codes and Result<T> type for fallible operations.
Read-only diagnostics contracts exposed by kernel-adjacent adapters.
Definition block.h:15
Top-level immutable model snapshot consumed by TUI controller/views.
Definition tui_models.h:93
Immutable DTO contracts for the external TUI MVC model layer.