SwatDB
Loading...
Searching...
No Matches
include
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
28
class
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
55
Frame
();
56
60
~Frame
();
61
69
void
resetFrame
();
70
80
void
loadFrame
(
PageId
page_id
);
81
82
private
:
83
88
PageId
page_id
;
89
93
int
pin_count
;
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
BufferManager
Definition
bufmgr.h:121
ClockRandom
Definition
bm_policies.h:585
Clock
Definition
bm_policies.h:37
Frame
Definition
bm_frame.h:28
Frame::frame_mtx
std::mutex frame_mtx
Definition
bm_frame.h:109
Frame::valid
bool valid
Definition
bm_frame.h:98
Frame::page_id
PageId page_id
Definition
bm_frame.h:88
Frame::loadFrame
void loadFrame(PageId page_id)
Updates the Frame data according to the loaded Page.
Frame::pin_count
int pin_count
Definition
bm_frame.h:93
Frame::dirty
bool dirty
Definition
bm_frame.h:103
Frame::~Frame
~Frame()
Destructor.
Frame::Frame
Frame()
Constructor. Calls resetFrame to reset the Frame.
Frame::resetFrame
void resetFrame()
Resets the metadata of the Frame.
LRU
Definition
bm_policies.h:451
MRU
Definition
bm_policies.h:320
Random
Definition
bm_policies.h:203
ReplacementPolicy
Definition
bm_replacement.h:29
PageId
Definition
swatdb_types.h:54
swatdb_types.h
Generated by
1.9.8