WiscDB
fileScanner.h
00001 
00007 #pragma once
00008 
00009 #include <string>
00010 #include "include/types.h"
00011 #include "include/page.h"
00012 #include "include/buffer.h"
00013 #include "include/file_iterator.h"
00014 #include "include/page_iterator.h"
00015 
00016 namespace wiscdb {
00017 
00021 class FileScanner
00022 {
00023  public:
00024 
00025   FileScanner(const std::string &name, BufferManager *bufMgr);
00026 
00027   ~FileScanner();
00028 
00029   //return RecordId of next record that satisfies the scan 
00030   void scanNext(RecordId& outRid);
00031 
00032   //read current record, returning pointer and length
00033   std::string getRecord();
00034 
00035   //marks current page of scan dirty
00036   void markDirty();
00037 
00038  private:
00042   PageFile      *file;
00043 
00047   BufferManager *bufMgr;
00048 
00052   Page*         curPage;
00053 
00054   FileIterator  filePageIter;
00055   PageIterator  pageRecordIter;
00056 
00060   bool          curDirtyFlag;
00061 };
00062 
00063 }
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends