Changeset View
Changeset View
Standalone View
Standalone View
src/cuckoocache.h
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | private: | ||||
/** | /** | ||||
* compute_hashes is convenience for not having to write out this expression | * compute_hashes is convenience for not having to write out this expression | ||||
* everywhere we use the hash values of an Element. | * everywhere we use the hash values of an Element. | ||||
* | * | ||||
* @param e the element whose hashes will be returned | * @param e the element whose hashes will be returned | ||||
* @returns std::array<uint32_t, 8> of deterministic hashes derived from e | * @returns std::array<uint32_t, 8> of deterministic hashes derived from e | ||||
*/ | */ | ||||
inline std::array<uint32_t, 8> compute_hashes(const Element &e) const { | inline std::array<uint32_t, 8> compute_hashes(const Element &e) const { | ||||
return {{hash_function.template operator() < 0 > (e)&hash_mask, | return {{hash_function.template operator()<0>(e) & hash_mask, | ||||
hash_function.template operator() < 1 > (e)&hash_mask, | hash_function.template operator()<1>(e) & hash_mask, | ||||
hash_function.template operator() < 2 > (e)&hash_mask, | hash_function.template operator()<2>(e) & hash_mask, | ||||
hash_function.template operator() < 3 > (e)&hash_mask, | hash_function.template operator()<3>(e) & hash_mask, | ||||
hash_function.template operator() < 4 > (e)&hash_mask, | hash_function.template operator()<4>(e) & hash_mask, | ||||
hash_function.template operator() < 5 > (e)&hash_mask, | hash_function.template operator()<5>(e) & hash_mask, | ||||
hash_function.template operator() < 6 > (e)&hash_mask, | hash_function.template operator()<6>(e) & hash_mask, | ||||
hash_function.template operator() < 7 > (e)&hash_mask}}; | hash_function.template operator()<7>(e) & hash_mask}}; | ||||
} | } | ||||
/* end | /* end | ||||
* @returns a constexpr index that can never be inserted to */ | * @returns a constexpr index that can never be inserted to */ | ||||
constexpr uint32_t invalid() const { return ~(uint32_t)0; } | constexpr uint32_t invalid() const { return ~(uint32_t)0; } | ||||
/** | /** | ||||
* allow_erase marks the element at index n as discardable. | * allow_erase marks the element at index n as discardable. | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |