BadgerDB
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
filescan.h
1 
9 #pragma once
10 
11 #include <string>
12 #include "types.h"
13 #include "page.h"
14 #include "buffer.h"
15 #include "file_iterator.h"
16 #include "page_iterator.h"
17 
18 namespace badgerdb {
19 
23 class FileScan
24 {
25  public:
26 
27  FileScan(const std::string &name, BufMgr *bufMgr);
28 
29  ~FileScan();
30 
31  //return RecordId of next record that satisfies the scan
32  void scanNext(RecordId& outRid);
33 
34  //read current record, returning pointer and length
35  std::string getRecord();
36 
37  //marks current page of scan dirty
38  void markDirty();
39 
40  private:
44  PageFile *file;
45 
49  BufMgr *bufMgr;
50 
54  Page* curPage;
55 
56  FileIterator filePageIter;
57  PageIterator pageRecordIter;
58 
62  bool curDirtyFlag;
63 };
64 
65 }
The central class which manages the buffer pool including frame allocation and deallocation to pages ...
Definition: buffer.h:161
Iterator for iterating over the records in a page.
Definition: page_iterator.h:23
Class which represents a fixed-size database page containing records.
Definition: page.h:108
Iterator for iterating over the pages in a file.
Definition: file_iterator.h:23
Identifier for a record in a page.
Definition: types.h:30
This class is used to sequentially scan records in a relation.
Definition: filescan.h:23