BadgerDB
/afs/cs.wisc.edu/u/m/o/mohan/private/cs564/btree/btree/src/filescan.h
00001 
00009 #pragma once
00010 
00011 #include <string>
00012 #include "types.h"
00013 #include "page.h"
00014 #include "buffer.h"
00015 #include "file_iterator.h"
00016 #include "page_iterator.h"
00017 
00018 namespace badgerdb {
00019 
00023 class FileScan
00024 {
00025  public:
00026 
00027   FileScan(const std::string &name, BufMgr *bufMgr);
00028 
00029   ~FileScan();
00030 
00031   //return RecordId of next record that satisfies the scan 
00032   void scanNext(RecordId& outRid);
00033 
00034   //read current record, returning pointer and length
00035   std::string getRecord();
00036 
00037   //marks current page of scan dirty
00038   void markDirty();
00039 
00040  private:
00044   PageFile      *file;
00045 
00049   BufMgr        *bufMgr;
00050 
00054   Page*         curPage;
00055 
00056   FileIterator  filePageIter;
00057   PageIterator  pageRecordIter;
00058 
00062   bool          curDirtyFlag;
00063 };
00064 
00065 }
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends