SwatDB
Loading...
Searching...
No Matches
bm_frame.h
Go to the documentation of this file.
1/*
2 * SwatDB
3 *
4 * @authors: See Contributors.doc for code contributors
5 *
6 * Copyright (c) 2020,2025 Swarthmore College Computer Science Department
7 * Swarthmore PA, Professors Tia Newhall, Ameet Soni
8 */
9
10
11#ifndef _SWATDB_BM_FRAME_H_
12#define _SWATDB_BM_FRAME_H_
13
20#include <utility>
21#include <mutex>
22#include "swatdb_types.h"
23
24
28class Frame {
29
36 friend class BufferManager;
37 friend class ReplacementPolicy;
38 friend class Clock;
39 friend class Random;
40
41// @@@@ SWATDB_ASSIGNMENT: CUT_START
42#ifndef BUFMGR_LAB_SOL_OMIT
43 friend class LRU;
44 friend class MRU;
45 friend class ClockRandom;
46#endif
47// @@@@ SWATDB_ASSIGNMENT: CUT_END
48
49
50 public:
51
56
61
69 void resetFrame();
70
81
82 private:
83
89
94
98 bool valid;
99
103 bool dirty;
104
105// @@@@ SWATDB_ASSIGNMENT: CUT_START
109 std::mutex frame_mtx;
110// @@@@ SWATDB_ASSIGNMENT: CUT_END
111};
112
113#endif
Definition bufmgr.h:121
Definition bm_policies.h:585
Definition bm_policies.h:37
Definition bm_frame.h:28
std::mutex frame_mtx
Definition bm_frame.h:109
bool valid
Definition bm_frame.h:98
PageId page_id
Definition bm_frame.h:88
void loadFrame(PageId page_id)
Updates the Frame data according to the loaded Page.
int pin_count
Definition bm_frame.h:93
bool dirty
Definition bm_frame.h:103
~Frame()
Destructor.
Frame()
Constructor. Calls resetFrame to reset the Frame.
void resetFrame()
Resets the metadata of the Frame.
Definition bm_policies.h:451
Definition bm_policies.h:320
Definition bm_policies.h:203
Definition bm_replacement.h:29
Definition swatdb_types.h:54