00001 #ifndef TRAPPER_SORTALGO_H 00002 #define TRAPPER_SORTALGO_H 00003 00004 #include "RW_algo.h" 00005 00006 class SortAlgo : public RWAlgo 00007 { 00008 public: 00009 SortAlgo(TrapperDoc * pDoc_, std::set< db_recno_t >& recnoList, AlgoParam* param) : 00010 RWAlgo(pDoc_, recnoList, param) {} 00011 00012 void start(); 00013 void old_start(); 00014 00015 private: 00016 struct sort_struct 00017 { 00018 size_t begin; 00019 size_t end; 00020 size_t ID; 00021 size_t row; 00022 }; 00023 struct compBeg 00024 { 00025 bool operator()(const sort_struct& s1, const sort_struct& s2 ) 00026 { 00027 return s1.begin < s2.begin; 00028 } 00029 00030 }; 00031 struct compEnd 00032 { 00033 bool operator()(const sort_struct& s1, const sort_struct& s2 ) 00034 { 00035 return s1.end < s2.end; 00036 } 00037 00038 }; 00039 00040 00041 }; 00042 00043 00044 00045 #endif //TRAPPER_SORTALGO_H 00046