00001 /* simpleCheckHashTable.h 00002 */ 00003 #ifndef _SIMPLE_CHECK_HASHTABLE_H 00004 #define _SIMPLE_CHECK_HASHTABLE_H 00005 00006 #include "osl/checkmate/checkHashRecord.h" 00007 #include "osl/checkmate/twinTable.h" 00008 #include "osl/checkmate/visitedCounter.h" 00009 #include <boost/scoped_ptr.hpp> 00010 00011 namespace osl 00012 { 00013 namespace hash 00014 { 00015 class HashKey; 00016 } 00017 00018 namespace checkmate 00019 { 00020 using hash::HashKey; 00025 class SimpleCheckHashTable : public TwinTableHolder, public VisitedCounter 00026 { 00027 class Table; 00028 boost::scoped_ptr<Table> table; 00029 const Player attacker; 00030 CheckHashRecord rootNode; 00031 public: 00032 explicit SimpleCheckHashTable(Player attacker); 00033 ~SimpleCheckHashTable(); 00034 00035 CheckHashRecord *find(const HashKey& key); 00036 CheckHashRecord *allocate(const HashKey& key, 00037 const PieceStand& white_stand, 00038 const PathEncoding&); 00039 00040 void clear(); 00041 CheckHashRecord *root() { return &rootNode; } 00042 00043 const CheckHashRecord *find(const HashKey& key) const; 00044 size_t size() const; 00045 Player getAttacker() const { return attacker; } 00046 void confirmNoVisitedRecords() const; 00047 }; 00048 00049 } // namespace checkmate 00050 } // namespace osl 00051 00052 #endif /* _SIMPLE_CHECK_HASHTABLE_H_ */ 00053 // ;;; Local Variables: 00054 // ;;; mode:c++ 00055 // ;;; c-basic-offset:2 00056 // ;;; End: