wisc_db
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 
28 
33 
38 };
39 
40 
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 }
const File * file
Definition: buffer.h:14
std::uint32_t PageId
Identifier for a page in a file.
Definition: types.h:15
std::uint32_t FrameId
Identifier for a frame in buffer pool.
Definition: types.h:25
Represents a file in the filesystem containing pages.
Definition: file.h:71