00001 /* simpleHashTable.h 00002 */ 00003 #ifndef _SIMPLE_HASHTABLE_H 00004 #define _SIMPLE_HASHTABLE_H 00005 00006 #include "osl/container/generalSimpleHashTable.h" 00007 #include "osl/container/moveVector.h" 00008 namespace osl 00009 { 00010 namespace search 00011 { 00012 struct SimpleHashRecord; 00013 00032 class SimpleHashTable : private container::GeneralSimpleHashTable<SimpleHashRecord> 00033 { 00034 private: 00035 int minimum_limit; 00036 int verbose; 00037 public: 00044 explicit SimpleHashTable(unsigned int capacity=100000, 00045 int minimum_record_limit=0, 00046 int verbose=0); 00047 ~SimpleHashTable(); 00048 00049 using GeneralSimpleHashTable<SimpleHashRecord>::clear; 00054 void setMinimumRecordLimit(int new_limit); 00055 00063 SimpleHashRecord *allocate(const HashKey& key, int limit); 00064 00071 using GeneralSimpleHashTable<SimpleHashRecord>::find; 00072 00073 int minimumRecordLimit() const; 00074 using GeneralSimpleHashTable<SimpleHashRecord>::size; 00075 using GeneralSimpleHashTable<SimpleHashRecord>::capacity; 00076 00077 void setVerbose(int verbose=1); 00078 int verboseLevel() const; 00079 bool isVerbose() const { return verboseLevel(); } 00080 00087 SimpleHashRecord* migrate(const HashKey& root, 00088 int max_depth, int min_limit, 00089 SimpleHashTable& out) const; 00090 bool isConsistent() const; 00091 int divSize() const; 00092 00093 void getPV(const HashKey&, MoveVector&, size_t *quiesce_start=0) const; 00094 }; 00095 00096 } // namespace search 00097 00098 using search::SimpleHashTable; 00099 } // namespace osl 00100 00101 #endif /* _SIMPLE_HASHTABLE_H_ */ 00102 // ;;; Local Variables: 00103 // ;;; mode:c++ 00104 // ;;; c-basic-offset:2 00105 // ;;; End: