SwatDB
Loading...
Searching...
No Matches
blockheapfilescanner.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 Swarthmore College Computer Science Department
7 * Swarthmore PA, Professors Tia Newhall, Ameet Soni
8 */
9
10#ifndef _SWATDB_BLOCKHEAPFILESCANNER_H_
11#define _SWATDB_BLOCKHEAPFILESCANNER_H_
12
17#include <string>
18#include <vector>
19#include <mutex>
20#include "swatdb_types.h"
21#include "file.h" //for inheritance
22
23class HeapPage;
24class HeapFile;
25class Record;
26class HeapPageScanner;
27
36
37 public:
38
50
58
82
96 bool nextBlock();
97
107 private:
108
120
126
131
136
141
149
153 std::uint32_t block_size;
154
160 std::uint32_t block_count;
161
167
172
178
184};
185
186#endif
Definition blockheapfilescanner.h:35
BlockHeapFileScanner(HeapFile *file, std::uint32_t block_size)
Constructor.
bool _advancePage()
advances to the next page in the heapfile, accounting for cases of end of full and end of free.
HeapPageScanner * scanner
Definition blockheapfilescanner.h:166
HeapFile * file
Definition blockheapfilescanner.h:171
BufferManager * buf_mgr
Definition blockheapfilescanner.h:125
bool beg_full
Definition blockheapfilescanner.h:148
RecordId getNext(Record *record)
Returns RecordId of the next Record in the HeapFile and initializes the given Record object to the da...
HeapPage * cur_page
Definition blockheapfilescanner.h:135
std::uint32_t block_count
Definition blockheapfilescanner.h:160
PageId cur_pid
Definition blockheapfilescanner.h:130
PageId beg_pid
Definition blockheapfilescanner.h:140
bool end_of_full
Definition blockheapfilescanner.h:177
bool end_of_free
Definition blockheapfilescanner.h:183
std::uint32_t block_size
Definition blockheapfilescanner.h:153
~BlockHeapFileScanner()
Destructor.
bool nextBlock()
Increments to the next block of pages. Pins the first page of the block and sets beg_page to that pag...
void resetBlock()
Resets cur_page to the beginning of the current block. Uses beg_page.
Definition bufmgr.h:121
Definition heapfile.h:76
Definition heappagescanner.h:33
Definition heappage.h:94
Definition record.h:34
Definition swatdb_types.h:54
Definition swatdb_types.h:70