|
|
@ -78,6 +78,16 @@ ValueT *Jupiter::Hash_Table<KeyT, ValueT, InKeyT, InValueT, HashF>::Bucket::get( |
|
|
|
return nullptr; |
|
|
|
} |
|
|
|
|
|
|
|
template<typename KeyT, typename ValueT, typename InKeyT, typename InValueT, size_t(*HashF)(const InKeyT &)> |
|
|
|
const InValueT &Jupiter::Hash_Table<KeyT, ValueT, InKeyT, InValueT, HashF>::Bucket::get(const InKeyT &in_key, const InValueT &in_value) const |
|
|
|
{ |
|
|
|
for (Jupiter::SLList<Entry>::Node *node = m_entries.getHead(); node != nullptr; node = node->next) |
|
|
|
if (node->data->key == in_key) |
|
|
|
return node->data->value; |
|
|
|
|
|
|
|
return in_value; |
|
|
|
} |
|
|
|
|
|
|
|
template<typename KeyT, typename ValueT, typename InKeyT, typename InValueT, size_t(*HashF)(const InKeyT &)> |
|
|
|
bool Jupiter::Hash_Table<KeyT, ValueT, InKeyT, InValueT, HashF>::Bucket::set(const InKeyT &in_key, const InValueT &in_value) |
|
|
|
{ |
|
|
@ -199,6 +209,12 @@ ValueT *Jupiter::Hash_Table<KeyT, ValueT, InKeyT, InValueT, HashF>::get(const In |
|
|
|
return m_buckets[HashF(in_key) % m_buckets_size].get(in_key); |
|
|
|
} |
|
|
|
|
|
|
|
template<typename KeyT, typename ValueT, typename InKeyT, typename InValueT, size_t(*HashF)(const InKeyT &)> |
|
|
|
const InValueT &Jupiter::Hash_Table<KeyT, ValueT, InKeyT, InValueT, HashF>::get(const InKeyT &in_key, const InValueT &in_value) const |
|
|
|
{ |
|
|
|
return m_buckets[HashF(in_key) % m_buckets_size].get(in_key, in_value); |
|
|
|
} |
|
|
|
|
|
|
|
template<typename KeyT, typename ValueT, typename InKeyT, typename InValueT, size_t(*HashF)(const InKeyT &)> |
|
|
|
bool Jupiter::Hash_Table<KeyT, ValueT, InKeyT, InValueT, HashF>::set(const InKeyT &in_key, const InValueT &in_value) |
|
|
|
{ |
|
|
|