SwatDB
Loading...
Searching...
No Matches
include
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
23
class
HeapPage
;
24
class
HeapFile
;
25
class
Record
;
26
class
HeapPageScanner
;
27
35
class
BlockHeapFileScanner
{
36
37
public
:
38
49
BlockHeapFileScanner
(
HeapFile
*
file
, std::uint32_t
block_size
);
50
57
~BlockHeapFileScanner
();
58
81
RecordId
getNext
(
Record
* record);
82
96
bool
nextBlock
();
97
106
void
resetBlock
();
107
private
:
108
119
bool
_advancePage
();
120
125
BufferManager
*
buf_mgr
;
126
130
PageId
cur_pid
;
131
135
HeapPage
*
cur_page
;
136
140
PageId
beg_pid
;
141
148
bool
beg_full
;
149
153
std::uint32_t
block_size
;
154
160
std::uint32_t
block_count
;
161
166
HeapPageScanner
*
scanner
;
167
171
HeapFile
*
file
;
172
177
bool
end_of_full
;
178
183
bool
end_of_free
;
184
};
185
186
#endif
BlockHeapFileScanner
Definition
blockheapfilescanner.h:35
BlockHeapFileScanner::BlockHeapFileScanner
BlockHeapFileScanner(HeapFile *file, std::uint32_t block_size)
Constructor.
BlockHeapFileScanner::_advancePage
bool _advancePage()
advances to the next page in the heapfile, accounting for cases of end of full and end of free.
BlockHeapFileScanner::scanner
HeapPageScanner * scanner
Definition
blockheapfilescanner.h:166
BlockHeapFileScanner::file
HeapFile * file
Definition
blockheapfilescanner.h:171
BlockHeapFileScanner::buf_mgr
BufferManager * buf_mgr
Definition
blockheapfilescanner.h:125
BlockHeapFileScanner::beg_full
bool beg_full
Definition
blockheapfilescanner.h:148
BlockHeapFileScanner::getNext
RecordId getNext(Record *record)
Returns RecordId of the next Record in the HeapFile and initializes the given Record object to the da...
BlockHeapFileScanner::cur_page
HeapPage * cur_page
Definition
blockheapfilescanner.h:135
BlockHeapFileScanner::block_count
std::uint32_t block_count
Definition
blockheapfilescanner.h:160
BlockHeapFileScanner::cur_pid
PageId cur_pid
Definition
blockheapfilescanner.h:130
BlockHeapFileScanner::beg_pid
PageId beg_pid
Definition
blockheapfilescanner.h:140
BlockHeapFileScanner::end_of_full
bool end_of_full
Definition
blockheapfilescanner.h:177
BlockHeapFileScanner::end_of_free
bool end_of_free
Definition
blockheapfilescanner.h:183
BlockHeapFileScanner::block_size
std::uint32_t block_size
Definition
blockheapfilescanner.h:153
BlockHeapFileScanner::~BlockHeapFileScanner
~BlockHeapFileScanner()
Destructor.
BlockHeapFileScanner::nextBlock
bool nextBlock()
Increments to the next block of pages. Pins the first page of the block and sets beg_page to that pag...
BlockHeapFileScanner::resetBlock
void resetBlock()
Resets cur_page to the beginning of the current block. Uses beg_page.
BufferManager
Definition
bufmgr.h:121
HeapFile
Definition
heapfile.h:76
HeapPageScanner
Definition
heappagescanner.h:33
HeapPage
Definition
heappage.h:94
Record
Definition
record.h:34
file.h
PageId
Definition
swatdb_types.h:54
RecordId
Definition
swatdb_types.h:70
swatdb_types.h
Generated by
1.9.8