1 #ifndef GIM_HASH_TABLE_H_INCLUDED
2 #define GIM_HASH_TABLE_H_INCLUDED
38 #define GIM_INVALID_HASH 0xffffffff
39 #define GIM_DEFAULT_HASH_TABLE_SIZE 380
40 #define GIM_DEFAULT_HASH_TABLE_NODE_SIZE 4
41 #define GIM_HASH_TABLE_GROW_FACTOR 2
43 #define GIM_MIN_RADIX_SORT_SIZE 860
66 bool operator <(const GIM_HASH_TABLE_NODE<T> & other)
const
69 if(
m_key < other.m_key)
return true;
108 return ((
int)(a.m_key - key));
119 return ((
int)(a.m_key - b.m_key));
151 #define GIM_NUM_PRIME 28
155 53ul, 97ul, 193ul, 389ul, 769ul,
156 1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
157 49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
158 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
159 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
160 1610612741ul, 3221225473ul, 4294967291ul
166 GUINT result_ind = 0;
217 while(start_index<end_index)
222 if(nodesptr[value].m_key == hashkey)
return start_index;
237 while(start_index<end_index)
244 avaliable_index = start_index;
247 else if(nodesptr[value].m_key == hashkey)
253 return avaliable_index;
265 if(newtablesize==0)
return;
280 for(
GUINT i=0;i<datasize;i++)
361 if(index >=
m_nodes.size())
return false;
465 if(index>=
m_nodes.size())
return false;
598 else if(reserve_size!=0)
618 if(
size()<2)
return true;
625 if(
m_nodes.size()<2)
return false;
735 if(
m_nodes[0].m_key == hashkey)
return 0;
741 GUINT result_ind = 0;
748 if(found)
return result_ind;
769 if(index >
m_nodes.size())
return false;
793 if(index >
m_nodes.size())
return false;
813 if(
size()==0)
return false;
839 for(i=0;i<datasize;i++)
902 #endif // GIM_CONTAINERS_H_INCLUDED