contur2
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:
20 ~FifoReplacement() override;
21
25 FifoReplacement &operator=(FifoReplacement &&) noexcept;
26
27 [[nodiscard]] std::string_view name() const noexcept override;
28 [[nodiscard]] FrameId selectVictim(const PageTable &pageTable) override;
29 void onAccess(FrameId frame) override;
30 void onLoad(FrameId frame) override;
31 void reset() override;
32
33 private:
34 struct Impl;
35 std::unique_ptr<Impl> impl_;
36 };
37
38} // 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(FifoReplacement &&) noexcept
void onLoad(FrameId frame) override
Notifies the policy that a new page was loaded into a frame.
FifoReplacement & operator=(const FifoReplacement &)=delete
void reset() override
Resets the policy's internal state.
FifoReplacement(const FifoReplacement &)=delete
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