Drake
Drake C++ Documentation
hash.h File Reference
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <map>
#include <optional>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "drake/common/drake_assert.h"
#include "drake/common/drake_throw.h"
Include dependency graph for hash.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  uhash< HashAlgorithm >
 A hashing functor, somewhat like std::hash. More...
 
struct  DelegatingHasher
 An adapter that forwards the HashAlgorithm::operator(data, length) function concept into a runtime-provided std::function of the same signature. More...
 

Namespaces

 drake
 

Typedefs

using DefaultHasher = internal::FNV1aHasher
 The default HashAlgorithm concept implementation across Drake. More...
 
using DefaultHash = drake::uhash< DefaultHasher >
 The default hashing functor, akin to std::hash. More...
 

Functions

template<class HashAlgorithm , class T >
std::enable_if_t< std::is_integral_v< T > > hash_append (HashAlgorithm &hasher, const T &item) noexcept
 Provides hash_append generic hashing for integral constants. More...
 
template<class HashAlgorithm , class T >
void hash_append (HashAlgorithm &hasher, const T *item) noexcept
 Provides hash_append generic hashing for bare pointers. More...
 
template<class HashAlgorithm , class T >
std::enable_if_t< std::is_enum_v< T > > hash_append (HashAlgorithm &hasher, const T &item) noexcept
 Provides hash_append generic hashing for enumerations. More...
 
template<class HashAlgorithm , class T >
std::enable_if_t< std::is_floating_point_v< T > > hash_append (HashAlgorithm &hasher, const T &item) noexcept
 Provides hash_append generic hashing for floating point values. More...
 
template<class HashAlgorithm , class Traits , class Allocator >
void hash_append (HashAlgorithm &hasher, const std::basic_string< char, Traits, Allocator > &item) noexcept
 Provides hash_append generic hashing for std::string. More...
 
template<class HashAlgorithm , class T1 , class T2 >
void hash_append (HashAlgorithm &hasher, const std::pair< T1, T2 > &item) noexcept
 Provides hash_append generic hashing for std::pair. More...
 
template<class HashAlgorithm , class T >
void hash_append (HashAlgorithm &hasher, const std::optional< T > &item) noexcept
 Provides hash_append generic hashing for std::optional. More...
 
template<class HashAlgorithm , class T1 , class T2 , class Compare , class Allocator >
void hash_append (HashAlgorithm &hasher, const std::map< T1, T2, Compare, Allocator > &item) noexcept
 Provides hash_append generic hashing for std::map. More...
 
template<class HashAlgorithm , class Key , class Compare , class Allocator >
void hash_append (HashAlgorithm &hasher, const std::set< Key, Compare, Allocator > &item) noexcept
 Provides hash_append generic hashing for std::set. More...
 
template<class HashAlgorithm , class Iter >
void hash_append_range (HashAlgorithm &hasher, Iter begin, Iter end) noexcept
 Provides hash_append generic hashing for a range, as given by two iterators. More...