hmbdc
simplify-high-performance-messaging-programming
Hash.hpp
1 #include "hmbdc/Copyright.hpp"
2 #pragma once
3 
4 #include <functional>
5 
6 namespace hmbdc { namespace comm { namespace inet {
7 
8 template <typename asio_endpoint>
9 struct HashEndpoint {
10  typedef asio_endpoint argument_type;
11  typedef std::size_t result_type;
12  result_type operator()(argument_type const& e) const noexcept {
13  uint64_t v = e.port();
14  v += ((e.address().to_v4().to_ulong()) << 32u);
15  return std::hash<uint64_t>{}(v);
16  }
17 };
18 }}}
19 
Definition: Hash.hpp:9
Definition: Base.hpp:12