momo  3.9
momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket > Class Template Reference

#include <HashTraits.h>

Public Types

typedef TKey Key
 
typedef THashFunc HashFunc
 
typedef TEqualFunc EqualFunc
 
typedef THashBucket HashBucket
 
template<typename ItemTraits >
using Bucket = typename HashBucket::template Bucket< ItemTraits, !isFastNothrowHashable >
 
template<typename KeyArg >
using IsValidKeyArg = internal::HashTraitsStdIsValidKeyArg< HashFunc, EqualFunc >
 

Public Member Functions

 HashTraitsStd (size_t startBucketCount=size_t{1}<< HashBucket::logStartBucketCount, const HashFunc &hashFunc=HashFunc(), const EqualFunc &equalFunc=EqualFunc())
 
 HashTraitsStd (const HashTraitsStd &hashTraits, float maxLoadFactor)
 
size_t CalcCapacity (size_t bucketCount, size_t bucketMaxItemCount) const noexcept
 
size_t GetBucketCountShift (size_t bucketCount, size_t bucketMaxItemCount) const noexcept
 
size_t GetLogStartBucketCount () const noexcept
 
template<typename KeyArg >
size_t GetHashCode (const KeyArg &key) const
 
template<typename KeyArg1 , typename KeyArg2 >
bool IsEqual (const KeyArg1 &key1, const KeyArg2 &key2) const
 
const HashFuncGetHashFunc () const noexcept
 
const EqualFuncGetEqualFunc () const noexcept
 
float GetMaxLoadFactor (size_t bucketMaxItemCount) const noexcept
 

Static Public Attributes

static const bool isFastNothrowHashable
 

Member Typedef Documentation

◆ Bucket

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
template<typename ItemTraits >
using momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::Bucket = typename HashBucket::template Bucket<ItemTraits, !isFastNothrowHashable>

◆ EqualFunc

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
typedef TEqualFunc momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::EqualFunc

◆ HashBucket

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
typedef THashBucket momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::HashBucket

◆ HashFunc

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
typedef THashFunc momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::HashFunc

◆ IsValidKeyArg

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
template<typename KeyArg >
using momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::IsValidKeyArg = internal::HashTraitsStdIsValidKeyArg<HashFunc, EqualFunc>

◆ Key

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
typedef TKey momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::Key

Constructor & Destructor Documentation

◆ HashTraitsStd() [1/2]

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::HashTraitsStd ( size_t  startBucketCount = size_t{1} << HashBucket::logStartBucketCount,
const HashFunc hashFunc = HashFunc(),
const EqualFunc equalFunc = EqualFunc() 
)
inlineexplicit

◆ HashTraitsStd() [2/2]

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::HashTraitsStd ( const HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket > &  hashTraits,
float  maxLoadFactor 
)
inline

Member Function Documentation

◆ CalcCapacity()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
size_t momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::CalcCapacity ( size_t  bucketCount,
size_t  bucketMaxItemCount 
) const
inlinenoexcept

◆ GetBucketCountShift()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
size_t momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::GetBucketCountShift ( size_t  bucketCount,
size_t  bucketMaxItemCount 
) const
inlinenoexcept

◆ GetEqualFunc()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
const EqualFunc& momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::GetEqualFunc ( ) const
inlinenoexcept

◆ GetHashCode()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
template<typename KeyArg >
size_t momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::GetHashCode ( const KeyArg &  key) const
inline

◆ GetHashFunc()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
const HashFunc& momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::GetHashFunc ( ) const
inlinenoexcept

◆ GetLogStartBucketCount()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
size_t momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::GetLogStartBucketCount ( ) const
inlinenoexcept

◆ GetMaxLoadFactor()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
float momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::GetMaxLoadFactor ( size_t  bucketMaxItemCount) const
inlinenoexcept

◆ IsEqual()

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
template<typename KeyArg1 , typename KeyArg2 >
bool momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::IsEqual ( const KeyArg1 &  key1,
const KeyArg2 &  key2 
) const
inline

Member Data Documentation

◆ isFastNothrowHashable

template<typename TKey , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename THashBucket = HashBucketDefault>
const bool momo::HashTraitsStd< TKey, THashFunc, TEqualFunc, THashBucket >::isFastNothrowHashable
static
Initial value:
= IsFastNothrowHashable<Key>::value
&& (std::is_same<HashFunc, HashCoder<Key>>::value
|| std::is_same<HashFunc, std::hash<Key>>::value)

The documentation for this class was generated from the following file: