Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
fifo_replacement.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <memory>
7
9
10namespace contur {
11
17 {
18 public:
21
23 ~FifoReplacement() override;
24
27
32
34 FifoReplacement &operator=(FifoReplacement &&) noexcept;
35
37 [[nodiscard]] std::string_view name() const noexcept override;
38
40 [[nodiscard]] FrameId selectVictim(const PageTable &pageTable) override;
41
43 void onAccess(FrameId frame) override;
44
46 void onLoad(FrameId frame) override;
47
49 void reset() override;
50
51 private:
52 struct Impl;
53 std::unique_ptr<Impl> impl_;
54 };
55
56} // namespace contur
std::string_view name() const noexcept override
Returns the name of the algorithm (e.g., "FIFO", "LRU").
FrameId selectVictim(const PageTable &pageTable) override
Selects a victim frame to evict.
std::unique_ptr< Impl > impl_
void onAccess(FrameId frame) override
Notifies the policy that a frame was accessed (read or write).
FifoReplacement()
Creates a FIFO replacement policy with empty queue state.
FifoReplacement(FifoReplacement &&) noexcept
Move-constructs policy state.
void onLoad(FrameId frame) override
Notifies the policy that a new page was loaded into a frame.
FifoReplacement & operator=(const FifoReplacement &)=delete
Copy assignment is disabled.
void reset() override
Resets the policy's internal state.
~FifoReplacement() override
Destroys FIFO replacement policy.
FifoReplacement(const FifoReplacement &)=delete
Copy construction is disabled.
Abstract interface for page replacement algorithms.
Page table mapping virtual page numbers to physical frames.
Definition page_table.h:27
IPageReplacementPolicy interface — pluggable page replacement algorithms.
Definition block.h:15
std::uint32_t FrameId
Frame number in physical memory.
Definition types.h:43