00001 /* 00002 * FileScanOperator.h 00003 * DavisDB 00004 * 00005 * Created by Mingmin Chen on 5/6/10. 00006 * Copyright 2010 UCD. All rights reserved. 00007 * 00008 */ 00009 00010 00011 #ifndef FILESCANOPERATOR_H_ 00012 #define FILESCANOPERATOR_H_ 00013 00014 #include "IScanOperator.h" 00015 00022 class FileScanOperator : public IScanOperator { 00023 public: 00024 FileScanOperator(const char* relation, int nAttributes, 00025 const RelationAttributeInfo attributes[]); 00026 virtual ~FileScanOperator(); 00027 00028 // IQueryOperator methods 00029 ReturnCode openExecution(); 00030 ReturnCode closeExecution(); 00031 ReturnCode getNextRecord(Record* record); 00032 int getArity(); 00033 void getSchema(RelationAttributeInfo attributes[]) ; 00034 void printSubtree(int indent); 00035 00036 // IScanOperator methods 00037 ReturnCode openScan(int nAttribute, ComparisonOp op, const TypedValue* value); 00038 ReturnCode closeScan(); 00039 00040 private: 00041 RelationAttributeInfo* attributes_; 00042 char* relation_; 00043 int nAttributes_; 00044 int* offsets_; 00045 uint recordSize_; 00046 RecordFileManager* rm_; 00047 RecordFileHandle* rfh_; 00048 RecordFileScan rfs_; 00049 bool isScanOpen_; 00050 }; 00051 00052 #endif // FILESCANOPERATOR_H_