sub_con_map.hpp 785 B

123456789101112131415161718192021222324252627282930
  1. // Copyright Takatoshi Kondo 2020
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #if !defined(MQTT_BROKER_SUB_CON_MAP_HPP)
  7. #define MQTT_BROKER_SUB_CON_MAP_HPP
  8. #include <mqtt/config.hpp>
  9. #include <mqtt/broker/broker_namespace.hpp>
  10. #include <mqtt/broker/subscription_map.hpp>
  11. #include <mqtt/broker/subscription.hpp>
  12. MQTT_BROKER_NS_BEGIN
  13. struct buffer_hasher {
  14. std::size_t operator()(buffer const& b) const noexcept {
  15. std::size_t result = 0;
  16. boost::hash_combine(result, b);
  17. return result;
  18. }
  19. };
  20. using sub_con_map = multiple_subscription_map<buffer, subscription, buffer_hasher>;
  21. MQTT_BROKER_NS_END
  22. #endif // MQTT_BROKER_SUB_CON_MAP_HPP