Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
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 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

namespace  drake

Typedefs

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

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.
template<class HashAlgorithm, class T>
void hash_append (HashAlgorithm &hasher, const T *item) noexcept
 Provides hash_append generic hashing for bare pointers.
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.
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.
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.
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.
template<class HashAlgorithm, class T>
void hash_append (HashAlgorithm &hasher, const std::optional< T > &item) noexcept
 Provides hash_append generic hashing for std::optional.
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.
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.
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.