Changeset 249 for 06/libkombilo-branches/hash_center/search.h
- Timestamp:
- 04/07/07 14:37:43 (2 years ago)
- Files:
-
- 06/libkombilo-branches/hash_center/search.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
06/libkombilo-branches/hash_center/search.h
r243 r249 43 43 44 44 const char NO_CONT = 255; 45 46 class SnapshotVector : public std::vector<unsigned char> { 47 public: 48 SnapshotVector(); 49 SnapshotVector(char* c, int size); 50 51 void pb_int(int d); 52 void pb_charp(char* c, int size); 53 void pb_char(char c); 54 void pb_string(std::string s); 55 void pb_intp(int* p, int size); 56 57 int retrieve_int(); 58 int* retrieve_intp(); 59 char retrieve_char(); 60 char* retrieve_charp(); 61 std::string retrieve_string(); 62 63 char* to_charp(); 64 65 private: 66 SnapshotVector::iterator current; 67 }; 68 45 69 46 70 class PatternError { … … 117 141 Pattern(int type, int BOARDSIZE, int sX, int sY, char* iPos, char* CONTLABELS = 0); 118 142 Pattern(const Pattern& p); 143 Pattern(SnapshotVector& snv); 119 144 ~Pattern(); 120 145 Pattern& operator=(const Pattern& p); … … 129 154 int operator==(const Pattern& p); 130 155 std::string printPattern(); 156 void to_snv(SnapshotVector& snv); 131 157 132 158 static int flipsX(int i, int x, int y, int XX, int YY); … … 148 174 int lW; // black loses (where cont. is W) 149 175 Continuation(); 176 void from_snv(SnapshotVector& snv); 177 void to_snv(SnapshotVector& snv); 150 178 }; 151 179 … … 190 218 char* label; // this does not really contain the label, but rather the position of the continuation move 191 219 Hit(ExtendedMoveNumber* POS, char* LABEL); 220 Hit(SnapshotVector& snv); // takes a SnapshotVector and reads information produced by Hit::to_snv() 192 221 ~Hit(); 193 222 static bool cmp_pts(Hit* a, Hit* b); 223 void to_snv(SnapshotVector& snv); 194 224 }; 195 225 … … 678 708 SearchOptions(); 679 709 SearchOptions(int FIXEDCOLOR, int NEXTMOVE, int MOVELIMIT=10000); 710 SearchOptions(SnapshotVector& snv); 711 void to_snv(SnapshotVector& snv); 680 712 }; 681 713 … … 690 722 GameListEntry(int ID, char WINNER, std::string GAMEINFOSTR); 691 723 ~GameListEntry(); 724 725 void hits_from_snv(SnapshotVector& snv); 692 726 }; 693 727 … … 754 788 int Bwins; 755 789 int Wwins; 756 790 Pattern* mrs_pattern; // most recent search pattern 791 SearchOptions* searchOptions; 757 792 // ---------------------------------------------------------------------------- 758 793 // the following methods provide the user interface … … 792 827 void deleteTag(int tag, int i = -1) throw(DBError); 793 828 std::vector<int> getTags(int i, int tag=0) throw(DBError); // note the order of arguments! 794 829 795 830 // ------- duplicates --------------------------------------------------------- 796 831 int find_duplicates(int bs, bool strict=false) throw(DBError); // return number of duplicate array … … 800 835 // The caller must free the pointer himself 801 836 // (before calling find_duplicates again). 837 838 // ------- snapshot, restore -------------------------------------------------- 839 840 int snapshot() throw(DBError); 841 void restore(int handle, bool del) throw(DBError); 842 void delete_snapshot(int handle) throw(DBError); 843 void delete_all_snapshots() throw(DBError); 802 844 803 845 // ------- misc --------------------------------------------------------------- … … 847 889 int posHA; 848 890 int SGFtagsSize; 849 int sizeX; // keeps track of width of search pattern during search850 891 sqlite3* algo_db1; 851 892 sqlite3* algo_db2;
