Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkGoodHash Struct Reference

#include <SkChecksum.h>

Public Member Functions

template<typename K >
std::enable_if_t< std::has_unique_object_representations< K >::value &&sizeof(K)==4, uint32_t > operator() (const K &k) const
 
template<typename K >
std::enable_if_t< std::has_unique_object_representations< K >::value &&sizeof(K) !=4, uint32_t > operator() (const K &k) const
 
uint32_t operator() (const SkString &k) const
 
uint32_t operator() (const std::string &k) const
 
uint32_t operator() (std::string_view k) const
 

Detailed Description

Definition at line 74 of file SkChecksum.h.

Member Function Documentation

◆ operator()() [1/5]

template<typename K >
std::enable_if_t< std::has_unique_object_representations< K >::value &&sizeof(K)==4, uint32_t > SkGoodHash::operator() ( const K k) const
inline

Definition at line 77 of file SkChecksum.h.

77 {
78 return SkChecksum::Mix(*(const uint32_t*)&k);
79 }
static uint32_t Mix(uint32_t hash)
Definition: SkChecksum.h:30

◆ operator()() [2/5]

template<typename K >
std::enable_if_t< std::has_unique_object_representations< K >::value &&sizeof(K) !=4, uint32_t > SkGoodHash::operator() ( const K k) const
inline

Definition at line 83 of file SkChecksum.h.

83 {
84 return SkChecksum::Hash32(&k, sizeof(K));
85 }
static const int K
Definition: daa.cpp:21
uint32_t Hash32(const void *data, size_t bytes, uint32_t seed)
Definition: SkChecksum.cpp:113

◆ operator()() [3/5]

uint32_t SkGoodHash::operator() ( const SkString k) const
inline

Definition at line 87 of file SkChecksum.h.

87 {
88 return SkChecksum::Hash32(k.c_str(), k.size());
89 }
size_t size() const
Definition: SkString.h:131
const char * c_str() const
Definition: SkString.h:133

◆ operator()() [4/5]

uint32_t SkGoodHash::operator() ( const std::string &  k) const
inline

Definition at line 91 of file SkChecksum.h.

91 {
92 return SkChecksum::Hash32(k.c_str(), k.size());
93 }

◆ operator()() [5/5]

uint32_t SkGoodHash::operator() ( std::string_view  k) const
inline

Definition at line 95 of file SkChecksum.h.

95 {
96 return SkChecksum::Hash32(k.data(), k.size());
97 }

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