contur2
Loading...
Searching...
No Matches
clock_replacement.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <memory>
7
9
10namespace contur {
11
18 {
19 public:
22
26 ClockReplacement &operator=(ClockReplacement &&) noexcept;
27
28 [[nodiscard]] std::string_view name() const noexcept override;
29 [[nodiscard]] FrameId selectVictim(const PageTable &pageTable) override;
30 void onAccess(FrameId frame) override;
31 void onLoad(FrameId frame) override;
32 void reset() override;
33
34 private:
35 struct Impl;
36 std::unique_ptr<Impl> impl_;
37 };
38
39} // namespace contur
std::string_view name() const noexcept override
Returns the name of the algorithm (e.g., "FIFO", "LRU").
ClockReplacement(ClockReplacement &&) noexcept
FrameId selectVictim(const PageTable &pageTable) override
Selects a victim frame to evict.
ClockReplacement & operator=(const ClockReplacement &)=delete
void onAccess(FrameId frame) override
Notifies the policy that a frame was accessed (read or write).
void reset() override
Resets the policy's internal state.
std::unique_ptr< Impl > impl_
void onLoad(FrameId frame) override
Notifies the policy that a new page was loaded into a frame.
ClockReplacement(const ClockReplacement &)=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