yapf/hashtable.hpp
changeset 5082 f5c258d60562
parent 5081 f71d1d2da6ed
child 5083 6da97b6fbbd6
equal deleted inserted replaced
5081:f71d1d2da6ed 5082:f5c258d60562
   116  *        bool operator == (const Key& other) const;
   116  *        bool operator == (const Key& other) const;
   117  */
   117  */
   118 template <class Titem_, int Thash_bits_>
   118 template <class Titem_, int Thash_bits_>
   119 class CHashTableT {
   119 class CHashTableT {
   120 public:
   120 public:
   121 	typedef Titem_ Titem;                       // make Titem_ visible from outside of class
   121 	typedef Titem_ Titem;                         // make Titem_ visible from outside of class
   122 	typedef typename Titem_::Key Tkey;          // make Titem_::Key a property of HashTable
   122 	typedef typename Titem_::Key Tkey;            // make Titem_::Key a property of HashTable
   123 	ST_CONST(int, Thash_bits = Thash_bits_)    // publish num of hash bits
   123 	static const int Thash_bits = Thash_bits_;    // publish num of hash bits
   124 	ST_CONST(int, Tcapacity = 1 << Thash_bits) // and num of slots 2^bits
   124 	static const int Tcapacity = 1 << Thash_bits; // and num of slots 2^bits
   125 
   125 
   126 protected:
   126 protected:
   127 	/** each slot contains pointer to the first item in the list,
   127 	/** each slot contains pointer to the first item in the list,
   128 	 *  Titem contains pointer to the next item - GetHashNext(), SetHashNext() */
   128 	 *  Titem contains pointer to the next item - GetHashNext(), SetHashNext() */
   129 	typedef CHashTableSlotT<Titem_> Slot;
   129 	typedef CHashTableSlotT<Titem_> Slot;