wisc_db
Main Page
Namespaces
Classes
Files
File List
home
newhall
public
cs44
wiscdb
src
bufferHashTable.h
1
9
#pragma once
10
11
#include "include/file.h"
12
13
namespace
wiscdb
{
14
18
struct
HashItem
{
22
const
File
*
file
;
23
27
PageId
pageNo
;
28
32
FrameId
frameNo
;
33
37
HashItem
*
next
;
38
};
39
40
44
class
BufferHashTable
45
{
46
private
:
50
int
SIZE;
54
HashItem
** table;
55
63
int
hash(
const
File
*
file
,
const
PageId
pageNo
);
64
65
public
:
69
BufferHashTable
(
const
int
htSize);
70
74
~
BufferHashTable
();
75
86
void
insert(
const
File
* file,
const
PageId
pageNo,
const
FrameId
frameNo
);
87
98
void
lookup(
const
File
* file,
const
PageId
pageNo,
FrameId
&frameNo);
99
109
void
remove
(
const
File
*
file
,
const
PageId
pageNo
);
110
};
111
112
}
wiscdb::HashItem::file
const File * file
Definition:
bufferHashTable.h:22
wiscdb::HashItem
Definition:
bufferHashTable.h:18
wiscdb
Definition:
buffer.h:14
wiscdb::HashItem::frameNo
FrameId frameNo
Definition:
bufferHashTable.h:32
wiscdb::HashItem::pageNo
PageId pageNo
Definition:
bufferHashTable.h:27
wiscdb::BufferHashTable
Definition:
bufferHashTable.h:44
wiscdb::PageId
std::uint32_t PageId
Identifier for a page in a file.
Definition:
types.h:15
wiscdb::HashItem::next
HashItem * next
Definition:
bufferHashTable.h:37
wiscdb::FrameId
std::uint32_t FrameId
Identifier for a frame in buffer pool.
Definition:
types.h:25
wiscdb::File
Represents a file in the filesystem containing pages.
Definition:
file.h:71
Generated by
1.8.11