00001 /* 00002 * IndexManager.h 00003 * 00004 * Created on: Apr 4, 2010 00005 * Author: Mingmin Chen 00006 */ 00007 00008 #ifndef INDEXMANAGER_H_ 00009 #define INDEXMANAGER_H_ 00010 00011 #include "Common.h" 00012 #include "IndexHandle.h" 00013 #include "RecordFileScan.h" 00014 00015 class PageFileManager; 00016 00027 class IndexManager { 00028 public: 00032 static IndexManager* getInstance(); 00033 00052 ReturnCode createIndex(const char *fileName, int attrNo, 00053 AttributeType attrType, int attrLength); 00054 00069 ReturnCode removeIndex(const char *fileName, int attrNo); 00070 00095 ReturnCode openIndex(const char *fileName, int attrNo, 00096 IndexHandle **indexHandle); 00097 00108 ReturnCode closeIndex(IndexHandle *indexHandle); 00109 00124 static bool getIndexFileName(const char *fileName, int attrNo, 00125 char *indexFileName, uint length); 00126 00127 private: 00128 IndexManager(); 00129 ~IndexManager(); 00130 }; 00131 00132 #endif /* INDEXMANAGER_H_ */