aboutsummaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-11-21 19:00:49 +0000
committerMike Buland <eichlan@xagasoft.com>2006-11-21 19:00:49 +0000
commit1ef4ff2655e62fad53c4e67476c531c897b7d583 (patch)
tree0d3c8713413faed486420dc218593c0cdacf6120 /src/hash.h
parent6f6bb9f9309a6d5e471579ec565d56e4d083dafb (diff)
downloadlibbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.tar.gz
libbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.tar.bz2
libbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.tar.xz
libbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.zip
Updated a thing.
Diffstat (limited to '')
-rw-r--r--src/hash.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/hash.h b/src/hash.h
index ff3bafd..6fdf8e1 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -26,7 +26,7 @@ struct __calcNextTSize_fast
26template<typename key, typename value, typename sizecalc = __calcNextTSize_fast, typename keyalloc = std::allocator<key>, typename valuealloc = std::allocator<value>, typename challoc = std::allocator<uint32_t> > 26template<typename key, typename value, typename sizecalc = __calcNextTSize_fast, typename keyalloc = std::allocator<key>, typename valuealloc = std::allocator<value>, typename challoc = std::allocator<uint32_t> >
27class Hash; 27class Hash;
28 28
29template< typename key, typename _value, typename sizecalc, typename keyalloc, typename valuealloc, typename challoc > 29template< typename key, typename _value, typename sizecalc = __calcNextTSize_fast, typename keyalloc = std::allocator<key>, typename valuealloc = std::allocator<_value>, typename challoc = std::allocator<uint32_t> >
30struct HashProxy 30struct HashProxy
31{ 31{
32 friend class Hash<key, _value, sizecalc, keyalloc, valuealloc, challoc>; 32 friend class Hash<key, _value, sizecalc, keyalloc, valuealloc, challoc>;
@@ -139,19 +139,6 @@ public:
139 ca.deallocate( aHashCodes, nCapacity ); 139 ca.deallocate( aHashCodes, nCapacity );
140 } 140 }
141 141
142 void clearBits()
143 {
144 for( uint32_t j = 0; j < nKeysSize; j++ )
145 {
146 bFilled[j] = bDeleted[j] = 0;
147 }
148 }
149
150 int hasKey( key keyval )
151 {
152 printf("%s\n", keyval );
153 }
154
155 uint32_t getCapacity() 142 uint32_t getCapacity()
156 { 143 {
157 return nCapacity; 144 return nCapacity;
@@ -307,6 +294,14 @@ public:
307 } 294 }
308 295
309private: 296private:
297 void clearBits()
298 {
299 for( uint32_t j = 0; j < nKeysSize; j++ )
300 {
301 bFilled[j] = bDeleted[j] = 0;
302 }
303 }
304
310 void fill( uint32_t loc, key &k, value &v, uint32_t hash ) 305 void fill( uint32_t loc, key &k, value &v, uint32_t hash )
311 { 306 {
312 bFilled[loc/32] |= (1<<(loc%32)); 307 bFilled[loc/32] |= (1<<(loc%32));