12#ifndef _SWATDB_BM_POLICIES_H_
13#define _SWATDB_BM_POLICIES_H_
575#ifndef BUFMGR_LAB_SOL_OMIT
Definition bm_policies.h:585
void pin(FrameId frame_id)
Frame is being pinned with pin count going from 0 to 1. Clock Random policy has nothing to do here,...
RepType _getType()
Derived class from pure virtual function that returns replacement policy type specific to this derive...
int times_chosen[BUF_SIZE]
Definition bm_policies.h:685
void printStats()
Prints average frames checked, replacement calls, summary stats on randomness.
FrameId replace()
Method that implements the Clock Random replacement policy functionality.
void unpin(FrameId frame_id)
Frame is being unpinned with pin count going from 1 to 0. Clock Random policy has nothing to do here,...
ClockRandom(Frame *frame_table)
Clock Random constructor. Initializes pointer to buffer manager's frame_table, creates the free list,...
Definition bm_policies.h:37
void getRepStats(struct BufferState::ReplacementStats *rep_stats)
Updates the struct of replacement policy statistics within the buffer state struct....
bool ref_table[BUF_SIZE]
Definition bm_policies.h:170
void freeFrame(FrameId frame_id)
The frame is invalidated in the buffer manager, and is added to the free list of frames in the replac...
void unpin(FrameId frame_id)
Frame is being unpinned with pin count going from 1 to 0. Set the ref_bit associated with this frame_...
FrameId replace()
Method that implements core replacement policy functionality of the clock replacement policy.
RepType _getType()
Derived class from pure virtual function that returns replacement policy type specific to this derive...
void _advanceClock()
Increments the clock hand according to the clock replacement policy.
void pin(FrameId frame_id)
Frame is being pinned with pin count going from 0 to 1. Clock policy has nothing to do here,...
Clock(Frame *frame_table)
Clock constructor. Initializes pointer to buffer manager's frame_table, creates the free list,...
void printStats()
Prints clock_hand, average frames checked, replacement calls, how many frames have ref_bit set.
void printFrame(FrameId frame_id)
THIS METHOD IS FOR DEBUGGING ONLY. Prints Frame state, including pin count and ref_bit.
std::uint32_t clock_hand
Definition bm_policies.h:163
Definition bm_policies.h:451
void printStats()
Prints replacement calls, average frames checked when pinning, and max and average size of queue.
LRU(Frame *frame_table)
LRU constructor. Initializes pointer to buffer manager's frame_table, creates the free list,...
void pin(FrameId frame_id)
Frame is being pinned with pin count going from 0 to 1. Frame id is removed from queue.
void unpin(FrameId frame_id)
Frame is being unpinned with pin count going from 1 to 0. Frame id is added to the bottom of the queu...
FrameId replace()
Method that implements the Least Recently Used (LRU) replacement policy functionality.
std::list< FrameId > queue
Definition bm_policies.h:553
int remove_calls
Definition bm_policies.h:569
void freeFrame(FrameId frame_id)
The frame is invalidated in the buffer manager, and is added to the free list of frames in the replac...
RepType _getType()
Derived class from pure virtual function that returns replacement policy type specific to this derive...
Definition bm_policies.h:320
RepType _getType()
Derived class from pure virtual function that returns replacement policy type specific to this derive...
void printStats()
Prints replacement calls, average frames checked when pinning, and max and average size of stack.
MRU(Frame *frame_table)
MRU constructor. Initializes pointer to buffer manager's frame_table, creates the free list,...
std::list< FrameId > stack
Definition bm_policies.h:420
void freeFrame(FrameId frame_id)
The frame is invalidated in the buffer manager, and is added to the free list of frames in the replac...
void pin(FrameId frame_id)
Frame is being pinned with pin count going from 0 to 1. Frame id is removed from stack.
void unpin(FrameId frame_id)
Frame is being unpinned with pin count going from 1 to 0. Frame id is added to the top of the stack.
int remove_calls
Definition bm_policies.h:437
FrameId replace()
Method that implements the Most Recently Used (MRU) replacement policy functionality.
Definition bm_policies.h:203
void unpin(FrameId frame_id)
Frame is being unpinned with pin count going from 1 to 0. Random policy has nothing to do here,...
int times_chosen[BUF_SIZE]
Definition bm_policies.h:306
void pin(FrameId frame_id)
Frame is being pinned with pin count going from 0 to 1. Random policy has nothing to do here,...
Random(Frame *frame_table)
Random constructor. Initializes pointer to buffer manager's frame_table, creates the free list,...
FrameId replace()
Method that implements the Random replacement policy functionality.
void printStats()
Prints average frames checked, replacement calls, summary stats on randomness.
RepType _getType()
Derived class from pure virtual function that returns replacement policy type specific to this derive...
Definition bm_replacement.h:29
Frame * frame_table
Definition bm_replacement.h:156
std::uint32_t FrameId
Index of each frame in the bufferpool of BufferManager.
Definition swatdb_types.h:44
const std::uint32_t BUF_SIZE
Definition swatdb_types.h:292
RepType
Definition swatdb_types.h:167