mqtt_cpp
callable_overlay.hpp
Go to the documentation of this file.
1 // Copyright Takatoshi Kondo 2015
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 
7 #if !defined(MQTT_CALLABLE_OVERLAY_HPP)
8 #define MQTT_CALLABLE_OVERLAY_HPP
9 
10 #include <mqtt/variant.hpp> // should be top to configure variant limit
11 
12 #include <mqtt/namespace.hpp>
13 #include <mqtt/attributes.hpp>
14 #include <mqtt/endpoint.hpp>
15 #include <mqtt/move.hpp>
16 
17 namespace MQTT_NS {
18 template<typename Impl>
19 struct callable_overlay final : public Impl
20 {
21  using base = Impl;
22  using packet_id_t = typename base::packet_id_t;
23 
24  template<typename ... Args>
25  callable_overlay(Args && ... args)
26  : base(std::forward<Args>(args)...)
27  { }
28  ~callable_overlay() = default;
33 
34  // MQTT Common handlers
35 
42  MQTT_ALWAYS_INLINE bool on_pingreq() noexcept override final {
43  return ! h_pingreq_ || h_pingreq_();
44  }
45 
52  MQTT_ALWAYS_INLINE bool on_pingresp() noexcept override final {
53  return ! h_pingresp_ || h_pingresp_();
54  }
55 
56  // MQTT v3_1_1 handlers
57 
96  optional<buffer> user_name,
97  optional<buffer> password,
98  optional<will> will,
99  bool clean_session,
100  std::uint16_t keep_alive) noexcept override final {
101  return ! h_connect_
102  || h_connect_(force_move(client_id),
103  force_move(user_name),
104  force_move(password),
105  force_move(will),
107  keep_alive);
108  }
109 
122  MQTT_ALWAYS_INLINE bool on_connack(bool session_present, connect_return_code return_code) noexcept override final {
123  return ! h_connack_
124  || h_connack_(session_present, return_code);
125  }
126 
144  MQTT_ALWAYS_INLINE bool on_publish(optional<packet_id_t> packet_id,
145  publish_options pubopts,
146  buffer topic_name,
147  buffer contents) noexcept override final {
148  return ! h_publish_
149  || h_publish_(packet_id,
150  pubopts,
151  force_move(topic_name),
152  force_move(contents));
153  }
154 
163  MQTT_ALWAYS_INLINE bool on_puback(packet_id_t packet_id) noexcept override final {
164  return ! h_puback_
165  || h_puback_(packet_id);
166  }
167 
176  MQTT_ALWAYS_INLINE bool on_pubrec(packet_id_t packet_id) noexcept override final {
177  return ! h_pubrec_
178  || h_pubrec_(packet_id);
179  }
180 
189  MQTT_ALWAYS_INLINE bool on_pubrel(packet_id_t packet_id) noexcept override final {
190  return ! h_pubrel_
191  || h_pubrel_(packet_id);
192  }
193 
202  MQTT_ALWAYS_INLINE bool on_pubcomp(packet_id_t packet_id) noexcept override final {
203  return ! h_pubcomp_
204  || h_pubcomp_(packet_id);
205  }
206 
218  std::vector<subscribe_entry> entries) noexcept override final {
219  return ! h_subscribe_
220  || h_subscribe_(packet_id, force_move(entries));
221  }
222 
235  std::vector<suback_return_code> reasons) noexcept override final {
236  return ! h_suback_
237  || h_suback_(packet_id, force_move(reasons));
238  }
239 
251  std::vector<unsubscribe_entry> entries) noexcept override final {
252  return ! h_unsubscribe_
253  || h_unsubscribe_(packet_id, force_move(entries));
254  }
255 
263  MQTT_ALWAYS_INLINE bool on_unsuback(packet_id_t packet_id) noexcept override final {
264  return ! h_unsuback_
265  || h_unsuback_(packet_id);
266  }
267 
273  MQTT_ALWAYS_INLINE void on_disconnect() noexcept override final {
274  if(h_disconnect_) h_disconnect_();
275  }
276 
277  // MQTT v5 handlers
278 
323  optional<buffer> user_name,
324  optional<buffer> password,
325  optional<will> will,
326  bool clean_start,
327  std::uint16_t keep_alive,
328  v5::properties props) noexcept override final {
329  return ! h_v5_connect_
330  || h_v5_connect_(force_move(client_id),
331  force_move(user_name),
332  force_move(password),
333  force_move(will),
334  clean_start,
335  keep_alive,
336  force_move(props));
337  }
338 
355  MQTT_ALWAYS_INLINE bool on_v5_connack(bool session_present,
356  v5::connect_reason_code reason_code,
357  v5::properties props) noexcept override final {
358  return ! h_v5_connack_
359  || h_v5_connack_(session_present, reason_code, force_move(props));
360  }
361 
387  MQTT_ALWAYS_INLINE bool on_v5_publish(optional<packet_id_t> packet_id,
388  publish_options pubopts,
389  buffer topic_name,
390  buffer contents,
391  v5::properties props) noexcept override final {
392  return ! h_v5_publish_
393  || h_v5_publish_(packet_id,
394  pubopts,
395  force_move(topic_name),
396  force_move(contents),
397  force_move(props));
398  }
399 
417  v5::puback_reason_code reason_code,
418  v5::properties props) noexcept override final {
419  return ! h_v5_puback_
420  || h_v5_puback_(packet_id, reason_code, force_move(props));
421  }
422 
440  v5::pubrec_reason_code reason_code,
441  v5::properties props) noexcept override final {
442  return ! h_v5_pubrec_
443  || h_v5_pubrec_(packet_id, reason_code, force_move(props));
444  }
445 
463  v5::pubrel_reason_code reason_code,
464  v5::properties props) noexcept override final {
465  return ! h_v5_pubrel_
466  || h_v5_pubrel_(packet_id, reason_code, force_move(props));
467  }
468 
486  v5::pubcomp_reason_code reason_code,
487  v5::properties props) noexcept override final {
488  return ! h_v5_pubcomp_
489  || h_v5_pubcomp_(packet_id, reason_code, force_move(props));
490  }
491 
507  std::vector<subscribe_entry> entries,
508  v5::properties props) noexcept override final {
509  return ! h_v5_subscribe_
510  || h_v5_subscribe_(packet_id, force_move(entries), force_move(props));
511  }
512 
529  std::vector<v5::suback_reason_code> reasons,
530  v5::properties props) noexcept override final {
531  return ! h_v5_suback_
532  || h_v5_suback_(packet_id, force_move(reasons), force_move(props));
533  }
534 
551  std::vector<unsubscribe_entry> entries,
552  v5::properties props) noexcept override final {
553  return ! h_v5_unsubscribe_
554  || h_v5_unsubscribe_(packet_id, force_move(entries), force_move(props));
555  }
556 
573  std::vector<v5::unsuback_reason_code> reasons,
574  v5::properties props) noexcept override final {
575  return ! h_v5_unsuback_
576  || h_v5_unsuback_(packet_id, force_move(reasons), force_move(props));
577  }
578 
593  v5::properties props) noexcept override final {
594  if (h_v5_disconnect_) h_v5_disconnect_(reason_code, force_move(props));
595  }
596 
612  v5::properties props) noexcept override final {
613  return ! h_v5_auth_
614  || h_v5_auth_(reason_code, force_move(props));
615 
616  }
617 
618  // Original handlers
619 
627  MQTT_ALWAYS_INLINE void on_close() noexcept override final {
628  base::on_close();
629  if (h_close_) h_close_();
630  }
631 
640  MQTT_ALWAYS_INLINE void on_error(error_code ec) noexcept override final {
641  base::on_error(ec);
642  if (h_error_) h_error_(ec);
643  }
644 
653  MQTT_ALWAYS_INLINE void on_pub_res_sent(packet_id_t packet_id) noexcept override final {
654  if (h_pub_res_sent_) h_pub_res_sent_(packet_id);
655  }
656 
664  if (h_serialize_publish_) h_serialize_publish_(msg);
665  }
666 
674  if (h_serialize_v5_publish_) h_serialize_v5_publish_(msg);
675  }
676 
686  if (h_serialize_pubrel_) h_serialize_pubrel_(msg);
687  }
688 
698  if (h_serialize_v5_pubrel_) h_serialize_v5_pubrel_(msg);
699  }
700 
705  MQTT_ALWAYS_INLINE void on_serialize_remove(packet_id_t packet_id) noexcept override final {
706  if (h_serialize_remove_) h_serialize_remove_(packet_id);
707  }
708 
713  MQTT_ALWAYS_INLINE void on_pre_send() noexcept override final {
714  base::on_pre_send();
715  if (h_pre_send_) h_pre_send_();
716  }
717 
725  MQTT_ALWAYS_INLINE bool check_is_valid_length(control_packet_type packet_type, std::size_t remaining_length) noexcept override final {
726  return ! h_is_valid_length_
727  || h_is_valid_length_(packet_type, remaining_length);
728  }
729 
746  MQTT_ALWAYS_INLINE void on_mqtt_message_processed(any session_life_keeper) noexcept override final {
747  if(h_mqtt_message_processed_) {
748  h_mqtt_message_processed_(force_move(session_life_keeper));
749  }
750  else {
751  base::on_mqtt_message_processed(force_move(session_life_keeper));
752  }
753  }
754 
761  using pingreq_handler = std::function<bool()>;
762 
769  using pingresp_handler = std::function<bool()>;
770 
771 
772  // MQTT v3_1_1 handlers
773 
811  using connect_handler = std::function<
812  bool(buffer client_id,
813  optional<buffer> user_name,
814  optional<buffer> password,
815  optional<will> will,
816  bool clean_session,
817  std::uint16_t keep_alive)>;
818 
831  using connack_handler = std::function<bool(bool session_present, connect_return_code return_code)>;
832 
850  using publish_handler = std::function<bool(optional<packet_id_t> packet_id,
851  publish_options pubopts,
852  buffer topic_name,
853  buffer contents)>;
854 
863  using puback_handler = std::function<bool(packet_id_t packet_id)>;
864 
873  using pubrec_handler = std::function<bool(packet_id_t packet_id)>;
874 
883  using pubrel_handler = std::function<bool(packet_id_t packet_id)>;
884 
893  using pubcomp_handler = std::function<bool(packet_id_t packet_id)>;
894 
905  using subscribe_handler = std::function<bool(packet_id_t packet_id,
906  std::vector<subscribe_entry> entries)>;
907 
919  using suback_handler = std::function<bool(packet_id_t packet_id,
920  std::vector<suback_return_code> qoss)>;
921 
932  using unsubscribe_handler = std::function<bool(packet_id_t packet_id,
933  std::vector<unsubscribe_entry> entries)>;
934 
942  using unsuback_handler = std::function<bool(packet_id_t)>;
943 
949  using disconnect_handler = std::function<void()>;
950 
951  // MQTT v5 handlers
952 
996  using v5_connect_handler = std::function<
997  bool(buffer client_id,
998  optional<buffer> user_name,
999  optional<buffer> password,
1000  optional<will> will,
1001  bool clean_start,
1002  std::uint16_t keep_alive,
1003  v5::properties props)
1004  >;
1005 
1022  using v5_connack_handler = std::function<
1023  bool(bool session_present,
1024  v5::connect_reason_code reason_code,
1025  v5::properties props)
1026  >;
1027 
1053  using v5_publish_handler = std::function<
1054  bool(optional<packet_id_t> packet_id,
1055  publish_options pubopts,
1056  buffer topic_name,
1057  buffer contents,
1058  v5::properties props)
1059  >;
1060 
1077  using v5_puback_handler = std::function<
1078  bool(packet_id_t packet_id,
1079  v5::puback_reason_code reason_code,
1080  v5::properties props)
1081  >;
1082 
1099  using v5_pubrec_handler = std::function<
1100  bool(packet_id_t packet_id,
1101  v5::pubrec_reason_code reason_code,
1102  v5::properties props)
1103  >;
1104 
1121  using v5_pubrel_handler = std::function<
1122  bool(packet_id_t packet_id,
1123  v5::pubrel_reason_code reason_code,
1124  v5::properties props)
1125  >;
1126 
1143  using v5_pubcomp_handler = std::function<
1144  bool(packet_id_t packet_id,
1145  v5::pubcomp_reason_code reason_code,
1146  v5::properties props)
1147  >;
1148 
1163  using v5_subscribe_handler = std::function<
1164  bool(packet_id_t packet_id,
1165  std::vector<subscribe_entry> entries,
1166  v5::properties props)
1167  >;
1168 
1184  using v5_suback_handler = std::function<
1185  bool(packet_id_t packet_id,
1186  std::vector<v5::suback_reason_code> reasons,
1187  v5::properties props)
1188  >;
1189 
1205  using v5_unsubscribe_handler = std::function<
1206  bool(packet_id_t packet_id,
1207  std::vector<unsubscribe_entry> entries,
1208  v5::properties props)
1209  >;
1210 
1226  using v5_unsuback_handler = std::function<
1227  bool(packet_id_t,
1228  std::vector<v5::unsuback_reason_code> reasons,
1229  v5::properties props)
1230  >;
1231 
1245  using v5_disconnect_handler = std::function<
1246  void(v5::disconnect_reason_code reason_code,
1247  v5::properties props)
1248  >;
1249 
1264  using v5_auth_handler = std::function<
1265  bool(v5::auth_reason_code reason_code,
1266  v5::properties props)
1267  >;
1268 
1269 
1270  // Original handlers
1271 
1278  using close_handler = std::function<void()>;
1279 
1287  using error_handler = std::function<void(error_code ec)>;
1288 
1297  using pub_res_sent_handler = std::function<void(packet_id_t packet_id)>;
1298 
1305  using serialize_publish_message_handler = std::function<void(basic_publish_message<sizeof(packet_id_t)> msg)>;
1306 
1314 
1323  using serialize_publish_handler = std::function<void(packet_id_t packet_id, char const* data, std::size_t size)>;
1324 
1333  using serialize_pubrel_message_handler = std::function<void(basic_pubrel_message<sizeof(packet_id_t)> msg)>;
1334 
1344 
1355  using serialize_pubrel_handler = std::function<void(packet_id_t packet_id, char const* data, std::size_t size)>;
1356 
1361  using serialize_remove_handler = std::function<void(packet_id_t packet_id)>;
1362 
1367  using pre_send_handler = std::function<void()>;
1368 
1377  std::function<bool(control_packet_type packet_type, std::size_t remaining_length)>;
1378 
1385  std::function<void(any session_life_keeper)>;
1386 
1387 
1388 
1389  // MQTT Common handlers
1390 
1396  h_pingreq_ = force_move(h);
1397  }
1398 
1404  h_pingresp_ = force_move(h);
1405  }
1406 
1407 
1413  return h_pingreq_;
1414  }
1415 
1421  return h_pingresp_;
1422  }
1423 
1424 
1425  // MQTT v3_1_1 handlers
1426 
1432  h_connect_ = force_move(h);
1433  }
1434 
1440  h_connack_ = force_move(h);
1441  }
1442 
1448  h_publish_ = force_move(h);
1449  }
1450 
1456  h_puback_ = force_move(h);
1457  }
1458 
1464  h_pubrec_ = force_move(h);
1465  }
1466 
1472  h_pubrel_ = force_move(h);
1473  }
1474 
1480  h_pubcomp_ = force_move(h);
1481  }
1482 
1488  h_subscribe_ = force_move(h);
1489  }
1490 
1496  h_suback_ = force_move(h);
1497  }
1498 
1504  h_unsubscribe_ = force_move(h);
1505  }
1506 
1512  h_unsuback_ = force_move(h);
1513  }
1514 
1520  h_disconnect_ = force_move(h);
1521  }
1522 
1528  return h_connect_;
1529  }
1530 
1536  return h_connack_;
1537  }
1538 
1544  return h_publish_;
1545  }
1546 
1552  return h_puback_;
1553  }
1554 
1560  return h_pubrec_;
1561  }
1562 
1568  return h_pubrel_;
1569  }
1570 
1576  return h_pubcomp_;
1577  }
1578 
1584  return h_subscribe_;
1585  }
1586 
1592  return h_suback_;
1593  }
1594 
1600  return h_unsubscribe_;
1601  }
1602 
1608  return h_unsuback_;
1609  }
1610 
1616  return h_disconnect_;
1617  }
1618 
1619  // MQTT v5 handlers
1620 
1626  h_v5_connect_ = force_move(h);
1627  }
1628 
1634  h_v5_connack_ = force_move(h);
1635  }
1636 
1642  h_v5_publish_ = force_move(h);
1643  }
1644 
1650  h_v5_puback_ = force_move(h);
1651  }
1652 
1658  h_v5_pubrec_ = force_move(h);
1659  }
1660 
1666  h_v5_pubrel_ = force_move(h);
1667  }
1668 
1674  h_v5_pubcomp_ = force_move(h);
1675  }
1676 
1682  h_v5_subscribe_ = force_move(h);
1683  }
1684 
1690  h_v5_suback_ = force_move(h);
1691  }
1692 
1698  h_v5_unsubscribe_ = force_move(h);
1699  }
1700 
1706  h_v5_unsuback_ = force_move(h);
1707  }
1708 
1714  h_v5_disconnect_ = force_move(h);
1715  }
1716 
1722  h_v5_auth_ = force_move(h);
1723  }
1724 
1730  return h_v5_connect_;
1731  }
1732 
1738  return h_v5_connack_;
1739  }
1740 
1746  return h_v5_publish_;
1747  }
1748 
1754  return h_v5_puback_;
1755  }
1756 
1762  return h_v5_pubrec_;
1763  }
1764 
1770  return h_v5_pubrel_;
1771  }
1772 
1778  return h_v5_pubcomp_;
1779  }
1780 
1786  return h_v5_subscribe_;
1787  }
1788 
1794  return h_v5_suback_;
1795  }
1796 
1802  return h_v5_unsubscribe_;
1803  }
1804 
1810  return h_v5_unsuback_;
1811  }
1812 
1818  return h_v5_disconnect_;
1819  }
1820 
1826  return h_v5_auth_;
1827  }
1828 
1829 
1830  // Original handlers
1831 
1837  h_pub_res_sent_ = force_move(h);
1838  }
1839 
1849  serialize_remove_handler h_remove) {
1850  h_serialize_publish_ = force_move(h_publish);
1851  h_serialize_pubrel_ = force_move(h_pubrel);
1852  h_serialize_remove_ = force_move(h_remove);
1853  }
1854 
1864  serialize_remove_handler h_remove) {
1865  h_serialize_v5_publish_ = force_move(h_publish);
1866  h_serialize_v5_pubrel_ = force_move(h_pubrel);
1867  h_serialize_remove_ = force_move(h_remove);
1868  }
1869 
1877  serialize_publish_handler h_publish,
1878  serialize_pubrel_handler h_pubrel,
1879  serialize_remove_handler h_remove) {
1880  h_serialize_publish_ =
1881  [h_publish = force_move(h_publish)]
1882  (basic_publish_message<sizeof(packet_id_t)> msg) {
1883  if (h_publish) {
1884  auto buf = msg.continuous_buffer();
1885  h_publish(msg.packet_id(), buf.data(), buf.size());
1886  }
1887  };
1888  h_serialize_pubrel_ =
1889  [h_pubrel = force_move(h_pubrel)]
1890  (basic_pubrel_message<sizeof(packet_id_t)> msg) {
1891  if (h_pubrel) {
1892  auto buf = msg.continuous_buffer();
1893  h_pubrel(msg.packet_id(), buf.data(), buf.size());
1894  }
1895  };
1896  h_serialize_remove_ = force_move(h_remove);
1897  }
1898 
1906  serialize_publish_handler h_publish,
1907  serialize_pubrel_handler h_pubrel,
1908  serialize_remove_handler h_remove) {
1909  h_serialize_v5_publish_ =
1910  [h_publish = force_move(h_publish)]
1911  (v5::basic_publish_message<sizeof(packet_id_t)> msg) {
1912  if (h_publish) {
1913  auto buf = msg.continuous_buffer();
1914  h_publish(msg.packet_id(), buf.data(), buf.size());
1915  }
1916  };
1917  h_serialize_v5_pubrel_ =
1918  [h_pubrel = force_move(h_pubrel)]
1919  (v5::basic_pubrel_message<sizeof(packet_id_t)> msg) {
1920  if (h_pubrel) {
1921  auto buf = msg.continuous_buffer();
1922  h_pubrel(msg.packet_id(), buf.data(), buf.size());
1923  }
1924  };
1925  h_serialize_remove_ = force_move(h_remove);
1926  }
1927 
1932  h_serialize_publish_ = serialize_publish_message_handler();
1933  h_serialize_pubrel_ = serialize_pubrel_message_handler();
1934  h_serialize_v5_publish_ = serialize_v5_publish_message_handler();
1935  h_serialize_v5_pubrel_ = serialize_v5_pubrel_message_handler();
1936  h_serialize_remove_ = serialize_remove_handler();
1937  }
1938 
1944  h_pre_send_ = force_move(h);
1945  }
1946 
1952  h_is_valid_length_ = force_move(h);
1953  }
1954 
1960  return h_pub_res_sent_;
1961  }
1962 
1968  return h_serialize_publish_;
1969  }
1970 
1976  return h_serialize_pubrel_;
1977  }
1978 
1984  return h_serialize_v5_publish_;
1985  }
1986 
1992  return h_serialize_v5_pubrel_;
1993  }
1994 
2000  return h_serialize_remove_;
2001  }
2002 
2008  return h_pre_send_;
2009  }
2010 
2016  return h_is_valid_length_;
2017  }
2018 
2033  if (h) {
2034  h_mqtt_message_processed_ = force_move(h);
2035  }
2036  else {
2037  h_mqtt_message_processed_ = {};
2038  }
2039  }
2040 
2046  return h_mqtt_message_processed_;
2047  }
2048 
2054  h_close_ = force_move(h);
2055  }
2056 
2062  h_error_ = force_move(h);
2063  }
2064 
2070  return h_close_;
2071  }
2072 
2078  return h_error_;
2079  }
2080 
2081 private:
2082  // MQTT common handlers
2083  pingreq_handler h_pingreq_;
2084  pingresp_handler h_pingresp_;
2085 
2086  // MQTT v3_1_1 handlers
2087  connect_handler h_connect_;
2088  connack_handler h_connack_;
2089  publish_handler h_publish_;
2090  puback_handler h_puback_;
2091  pubrec_handler h_pubrec_;
2092  pubrel_handler h_pubrel_;
2093  pubcomp_handler h_pubcomp_;
2094  subscribe_handler h_subscribe_;
2095  suback_handler h_suback_;
2096  unsubscribe_handler h_unsubscribe_;
2097  unsuback_handler h_unsuback_;
2098  disconnect_handler h_disconnect_;
2099 
2100  // MQTT v5 handlers
2101  v5_connect_handler h_v5_connect_;
2102  v5_connack_handler h_v5_connack_;
2103  v5_publish_handler h_v5_publish_;
2104  v5_puback_handler h_v5_puback_;
2105  v5_pubrec_handler h_v5_pubrec_;
2106  v5_pubrel_handler h_v5_pubrel_;
2107  v5_pubcomp_handler h_v5_pubcomp_;
2108  v5_subscribe_handler h_v5_subscribe_;
2109  v5_suback_handler h_v5_suback_;
2110  v5_unsubscribe_handler h_v5_unsubscribe_;
2111  v5_unsuback_handler h_v5_unsuback_;
2112  v5_disconnect_handler h_v5_disconnect_;
2113  v5_auth_handler h_v5_auth_;
2114 
2115  // original handlers
2116  close_handler h_close_;
2117  error_handler h_error_;
2118  pub_res_sent_handler h_pub_res_sent_;
2119  serialize_publish_message_handler h_serialize_publish_;
2120  serialize_v5_publish_message_handler h_serialize_v5_publish_;
2121  serialize_pubrel_message_handler h_serialize_pubrel_;
2122  serialize_v5_pubrel_message_handler h_serialize_v5_pubrel_;
2123  serialize_remove_handler h_serialize_remove_;
2124  pre_send_handler h_pre_send_;
2125  is_valid_length_handler h_is_valid_length_;
2126  mqtt_message_processed_handler h_mqtt_message_processed_;
2127 }; // callable_overlay
2128 
2129 } // namespace MQTT_NS
2130 
2131 #endif // MQTT_CALLABLE_OVERLAY_HPP
#define MQTT_ALWAYS_INLINE
Definition: attributes.hpp:18
buffer that has string_view interface This class provides string_view interface. This class hold stri...
Definition: buffer.hpp:30
Definition: message.hpp:505
Definition: v5_message.hpp:544
Definition: will.hpp:21
endpoint_t::packet_id_t packet_id_t
Definition: common_type.hpp:20
constexpr char const clean_start
Definition: connect_flags.hpp:19
constexpr char const clean_session
Definition: connect_flags.hpp:18
connect_reason_code
Definition: reason_code.hpp:50
auth_reason_code
Definition: reason_code.hpp:385
pubrel_reason_code
Definition: reason_code.hpp:341
puback_reason_code
Definition: reason_code.hpp:269
pubrec_reason_code
Definition: reason_code.hpp:305
pubcomp_reason_code
Definition: reason_code.hpp:363
std::vector< property_variant > properties
Definition: property_variant.hpp:51
disconnect_reason_code
Definition: reason_code.hpp:114
Definition: any.hpp:27
constexpr std::tuple< std::size_t, std::size_t > remaining_length(string_view bytes)
Definition: remaining_length.hpp:24
control_packet_type
Definition: control_packet_type.hpp:18
boost::system::error_code error_code
Definition: error_code.hpp:16
constexpr std::remove_reference_t< T > && force_move(T &&t)
Definition: move.hpp:20
connect_return_code
Definition: connect_return_code.hpp:17
std::size_t size(basic_message_variant< PacketIdBytes > const &mv)
Definition: message_variant.hpp:93
Definition: callable_overlay.hpp:20
MQTT_ALWAYS_INLINE void on_close() noexcept override final
Close handler.
Definition: callable_overlay.hpp:627
callable_overlay & operator=(callable_overlay const &)=default
callable_overlay(callable_overlay const &)=default
disconnect_handler const & get_disconnect_handler() const
Get disconnect handler.
Definition: callable_overlay.hpp:1615
typename base::packet_id_t packet_id_t
Definition: callable_overlay.hpp:22
serialize_pubrel_message_handler const & get_serialize_pubrel_message_handler() const
Get serialize pubrel handler.
Definition: callable_overlay.hpp:1975
MQTT_ALWAYS_INLINE bool on_unsubscribe(packet_id_t packet_id, std::vector< unsubscribe_entry > entries) noexcept override final
Unsubscribe handler.
Definition: callable_overlay.hpp:250
v5_connect_handler const & get_v5_connect_handler() const
Get connect handler.
Definition: callable_overlay.hpp:1729
void set_v5_suback_handler(v5_suback_handler h=v5_suback_handler())
Set suback handler.
Definition: callable_overlay.hpp:1689
void set_v5_publish_handler(v5_publish_handler h=v5_publish_handler())
Set publish handler.
Definition: callable_overlay.hpp:1641
void set_v5_puback_handler(v5_puback_handler h=v5_puback_handler())
Set puback handler.
Definition: callable_overlay.hpp:1649
MQTT_ALWAYS_INLINE void on_serialize_v5_publish_message(v5::basic_publish_message< sizeof(packet_id_t)> msg) noexcept override final
Serialize publish handler You can serialize the publish message. To restore the message,...
Definition: callable_overlay.hpp:673
void set_pre_send_handler(pre_send_handler h=pre_send_handler())
Set pre-send handler.
Definition: callable_overlay.hpp:1943
MQTT_ALWAYS_INLINE bool on_pubrec(packet_id_t packet_id) noexcept override final
Pubrec handler.
Definition: callable_overlay.hpp:176
Impl base
Definition: callable_overlay.hpp:21
MQTT_ALWAYS_INLINE void on_serialize_remove(packet_id_t packet_id) noexcept override final
Remove serialized message.
Definition: callable_overlay.hpp:705
std::function< void()> pre_send_handler
Pre-send handler This handler is called when any mqtt control packet is decided to send.
Definition: callable_overlay.hpp:1367
void set_v5_serialize_handlers(serialize_publish_handler h_publish, serialize_pubrel_handler h_pubrel, serialize_remove_handler h_remove)
Set serialize handlers.
Definition: callable_overlay.hpp:1905
MQTT_ALWAYS_INLINE bool on_unsuback(packet_id_t packet_id) noexcept override final
Unsuback handler.
Definition: callable_overlay.hpp:263
MQTT_ALWAYS_INLINE void on_pre_send() noexcept override final
Pre-send handler This handler is called when any mqtt control packet is decided to send.
Definition: callable_overlay.hpp:713
MQTT_ALWAYS_INLINE void on_error(error_code ec) noexcept override final
Error handler.
Definition: callable_overlay.hpp:640
void set_pingreq_handler(pingreq_handler h=pingreq_handler())
Set pingreq handler.
Definition: callable_overlay.hpp:1395
v5_unsuback_handler const & get_v5_unsuback_handler() const
Get unsuback handler.
Definition: callable_overlay.hpp:1809
MQTT_ALWAYS_INLINE bool on_v5_subscribe(packet_id_t packet_id, std::vector< subscribe_entry > entries, v5::properties props) noexcept override final
Subscribe handler.
Definition: callable_overlay.hpp:506
void set_v5_serialize_handlers(serialize_v5_publish_message_handler h_publish, serialize_v5_pubrel_message_handler h_pubrel, serialize_remove_handler h_remove)
Set serialize handlers.
Definition: callable_overlay.hpp:1861
MQTT_ALWAYS_INLINE void on_serialize_publish_message(basic_publish_message< sizeof(packet_id_t)> msg) noexcept override final
Serialize publish handler You can serialize the publish message. To restore the message,...
Definition: callable_overlay.hpp:663
std::function< void()> close_handler
Close handler.
Definition: callable_overlay.hpp:1278
MQTT_ALWAYS_INLINE bool on_pubrel(packet_id_t packet_id) noexcept override final
Pubrel handler.
Definition: callable_overlay.hpp:189
std::function< void()> disconnect_handler
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os....
Definition: callable_overlay.hpp:949
void set_v5_disconnect_handler(v5_disconnect_handler h=v5_disconnect_handler())
Set disconnect handler.
Definition: callable_overlay.hpp:1713
void set_unsuback_handler(unsuback_handler h=unsuback_handler())
Set unsuback handler.
Definition: callable_overlay.hpp:1511
void set_serialize_handlers()
Clear serialize handlers.
Definition: callable_overlay.hpp:1931
MQTT_ALWAYS_INLINE bool on_puback(packet_id_t packet_id) noexcept override final
Puback handler.
Definition: callable_overlay.hpp:163
void set_suback_handler(suback_handler h=suback_handler())
Set suback handler.
Definition: callable_overlay.hpp:1495
pub_res_sent_handler const & get_pub_res_sent_handler() const
Get publish response sent handler.
Definition: callable_overlay.hpp:1959
std::function< void(error_code ec)> error_handler
Error handler.
Definition: callable_overlay.hpp:1287
MQTT_ALWAYS_INLINE bool on_connect(buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_session, std::uint16_t keep_alive) noexcept override final
Connect handler.
Definition: callable_overlay.hpp:95
MQTT_ALWAYS_INLINE bool check_is_valid_length(control_packet_type packet_type, std::size_t remaining_length) noexcept override final
is valid length handler This handler is called when remaining length is received.
Definition: callable_overlay.hpp:725
callable_overlay(Args &&... args)
Definition: callable_overlay.hpp:25
MQTT_ALWAYS_INLINE bool on_v5_auth(v5::auth_reason_code reason_code, v5::properties props) noexcept override final
Auth handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901217 3....
Definition: callable_overlay.hpp:611
close_handler get_close_handler() const
Get close handler.
Definition: callable_overlay.hpp:2069
std::function< void(v5::disconnect_reason_code reason_code, v5::properties props) > v5_disconnect_handler
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os....
Definition: callable_overlay.hpp:1248
pingreq_handler const & get_pingreq_handler() const
Get pingreq handler.
Definition: callable_overlay.hpp:1412
void set_puback_handler(puback_handler h=puback_handler())
Set puback handler.
Definition: callable_overlay.hpp:1455
std::function< bool(bool session_present, v5::connect_reason_code reason_code, v5::properties props) > v5_connack_handler
Connack handler.
Definition: callable_overlay.hpp:1026
std::function< void(packet_id_t packet_id, char const *data, std::size_t size)> serialize_publish_handler
Serialize publish handler You can serialize the publish message. To restore the message,...
Definition: callable_overlay.hpp:1323
void set_v5_unsubscribe_handler(v5_unsubscribe_handler h=v5_unsubscribe_handler())
Set unsubscribe handler.
Definition: callable_overlay.hpp:1697
MQTT_ALWAYS_INLINE void on_serialize_pubrel_message(basic_pubrel_message< sizeof(packet_id_t)> msg) noexcept override final
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the pu...
Definition: callable_overlay.hpp:685
std::function< bool(buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_start, std::uint16_t keep_alive, v5::properties props) > v5_connect_handler
Connect handler.
Definition: callable_overlay.hpp:1004
MQTT_ALWAYS_INLINE bool on_v5_publish(optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents, v5::properties props) noexcept override final
Publish handler.
Definition: callable_overlay.hpp:387
std::function< void(basic_pubrel_message< sizeof(packet_id_t)> msg)> serialize_pubrel_message_handler
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the pu...
Definition: callable_overlay.hpp:1333
std::function< void(packet_id_t packet_id)> pub_res_sent_handler
Publish response sent handler This function is called just after puback sent on QoS1,...
Definition: callable_overlay.hpp:1297
void set_close_handler(close_handler h=close_handler())
Set close handler.
Definition: callable_overlay.hpp:2053
unsubscribe_handler const & get_unsubscribe_handler() const
Get unsubscribe handler.
Definition: callable_overlay.hpp:1599
std::function< bool(packet_id_t packet_id)> pubrec_handler
Pubrec handler.
Definition: callable_overlay.hpp:873
void set_pubcomp_handler(pubcomp_handler h=pubcomp_handler())
Set pubcomp handler.
Definition: callable_overlay.hpp:1479
void set_pubrec_handler(pubrec_handler h=pubrec_handler())
Set pubrec handler.
Definition: callable_overlay.hpp:1463
void set_publish_handler(publish_handler h=publish_handler())
Set publish handler.
Definition: callable_overlay.hpp:1447
MQTT_ALWAYS_INLINE bool on_v5_pubrel(packet_id_t packet_id, v5::pubrel_reason_code reason_code, v5::properties props) noexcept override final
Pubrel handler.
Definition: callable_overlay.hpp:462
v5_disconnect_handler const & get_v5_disconnect_handler() const
Get disconnect handler.
Definition: callable_overlay.hpp:1817
MQTT_ALWAYS_INLINE bool on_v5_pubcomp(packet_id_t packet_id, v5::pubcomp_reason_code reason_code, v5::properties props) noexcept override final
Pubcomp handler.
Definition: callable_overlay.hpp:485
std::function< bool(packet_id_t packet_id, std::vector< unsubscribe_entry > entries)> unsubscribe_handler
Unsubscribe handler.
Definition: callable_overlay.hpp:933
void set_v5_connect_handler(v5_connect_handler h=v5_connect_handler())
Set connect handler.
Definition: callable_overlay.hpp:1625
void set_serialize_handlers(serialize_publish_message_handler h_publish, serialize_pubrel_message_handler h_pubrel, serialize_remove_handler h_remove)
Set serialize handlers.
Definition: callable_overlay.hpp:1846
publish_handler const & get_publish_handler() const
Set publish handler.
Definition: callable_overlay.hpp:1543
suback_handler const & get_suback_handler() const
Get suback handler.
Definition: callable_overlay.hpp:1591
MQTT_ALWAYS_INLINE bool on_v5_unsuback(packet_id_t packet_id, std::vector< v5::unsuback_reason_code > reasons, v5::properties props) noexcept override final
Unsuback handler.
Definition: callable_overlay.hpp:572
mqtt_message_processed_handler get_mqtt_message_processed_handler() const
Get mqtt_message_processed_handler.
Definition: callable_overlay.hpp:2045
error_handler get_error_handler() const
Get error handler.
Definition: callable_overlay.hpp:2077
callable_overlay & operator=(callable_overlay &&)=default
connack_handler const & get_connack_handler() const
Get connack handler.
Definition: callable_overlay.hpp:1535
MQTT_ALWAYS_INLINE bool on_v5_pubrec(packet_id_t packet_id, v5::pubrec_reason_code reason_code, v5::properties props) noexcept override final
Pubrec handler.
Definition: callable_overlay.hpp:439
void set_v5_auth_handler(v5_auth_handler h=v5_auth_handler())
Set auth handler.
Definition: callable_overlay.hpp:1721
MQTT_ALWAYS_INLINE bool on_publish(optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents) noexcept override final
Publish handler.
Definition: callable_overlay.hpp:144
unsuback_handler const & get_unsuback_handler() const
Get unsuback handler.
Definition: callable_overlay.hpp:1607
std::function< bool(control_packet_type packet_type, std::size_t remaining_length)> is_valid_length_handler
is valid length handler This handler is called when remaining length is received.
Definition: callable_overlay.hpp:1377
std::function< bool(packet_id_t packet_id, v5::pubrec_reason_code reason_code, v5::properties props) > v5_pubrec_handler
Pubrec handler.
Definition: callable_overlay.hpp:1103
std::function< bool(optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents)> publish_handler
Publish handler.
Definition: callable_overlay.hpp:853
MQTT_ALWAYS_INLINE void on_disconnect() noexcept override final
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os....
Definition: callable_overlay.hpp:273
std::function< bool()> pingreq_handler
Pingreq handler See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os....
Definition: callable_overlay.hpp:761
std::function< void(packet_id_t packet_id, char const *data, std::size_t size)> serialize_pubrel_handler
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the pu...
Definition: callable_overlay.hpp:1355
std::function< bool(packet_id_t packet_id)> pubrel_handler
Pubrel handler.
Definition: callable_overlay.hpp:883
void set_serialize_handlers(serialize_publish_handler h_publish, serialize_pubrel_handler h_pubrel, serialize_remove_handler h_remove)
Set serialize handlers.
Definition: callable_overlay.hpp:1876
std::function< bool(packet_id_t packet_id, std::vector< subscribe_entry > entries)> subscribe_handler
Subscribe handler.
Definition: callable_overlay.hpp:906
void set_v5_connack_handler(v5_connack_handler h=v5_connack_handler())
Set connack handler.
Definition: callable_overlay.hpp:1633
std::function< bool(packet_id_t packet_id, std::vector< suback_return_code > qoss)> suback_handler
Suback handler.
Definition: callable_overlay.hpp:920
MQTT_ALWAYS_INLINE bool on_subscribe(packet_id_t packet_id, std::vector< subscribe_entry > entries) noexcept override final
Subscribe handler.
Definition: callable_overlay.hpp:217
MQTT_ALWAYS_INLINE bool on_suback(packet_id_t packet_id, std::vector< suback_return_code > reasons) noexcept override final
Suback handler.
Definition: callable_overlay.hpp:234
pre_send_handler const & get_pre_send_handler() const
Get pre-send handler.
Definition: callable_overlay.hpp:2007
MQTT_ALWAYS_INLINE bool on_v5_suback(packet_id_t packet_id, std::vector< v5::suback_reason_code > reasons, v5::properties props) noexcept override final
Suback handler.
Definition: callable_overlay.hpp:528
callable_overlay(callable_overlay &&)=default
void set_subscribe_handler(subscribe_handler h=subscribe_handler())
Set subscribe handler.
Definition: callable_overlay.hpp:1487
MQTT_ALWAYS_INLINE bool on_pingreq() noexcept override final
Pingreq handler See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os....
Definition: callable_overlay.hpp:42
void set_v5_subscribe_handler(v5_subscribe_handler h=v5_subscribe_handler())
Set subscribe handler.
Definition: callable_overlay.hpp:1681
void set_connect_handler(connect_handler h=connect_handler())
Set connect handler.
Definition: callable_overlay.hpp:1431
MQTT_ALWAYS_INLINE bool on_pubcomp(packet_id_t packet_id) noexcept override final
Pubcomp handler.
Definition: callable_overlay.hpp:202
MQTT_ALWAYS_INLINE bool on_v5_unsubscribe(packet_id_t packet_id, std::vector< unsubscribe_entry > entries, v5::properties props) noexcept override final
Unsubscribe handler.
Definition: callable_overlay.hpp:550
pubrel_handler const & get_pubrel_handler() const
Get pubrel handler.
Definition: callable_overlay.hpp:1567
std::function< void(packet_id_t packet_id)> serialize_remove_handler
Remove serialized message.
Definition: callable_overlay.hpp:1361
std::function< void(basic_publish_message< sizeof(packet_id_t)> msg)> serialize_publish_message_handler
Serialize publish handler You can serialize the publish message. To restore the message,...
Definition: callable_overlay.hpp:1305
std::function< bool(packet_id_t packet_id)> puback_handler
Puback handler.
Definition: callable_overlay.hpp:863
MQTT_ALWAYS_INLINE bool on_v5_connect(buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_start, std::uint16_t keep_alive, v5::properties props) noexcept override final
Connect handler.
Definition: callable_overlay.hpp:322
std::function< bool(packet_id_t, std::vector< v5::unsuback_reason_code > reasons, v5::properties props) > v5_unsuback_handler
Unsuback handler.
Definition: callable_overlay.hpp:1230
std::function< void(any session_life_keeper)> mqtt_message_processed_handler
next read handler This handler is called when the current mqtt message has been processed.
Definition: callable_overlay.hpp:1385
void set_pingresp_handler(pingresp_handler h=pingresp_handler())
Set pingresp handler.
Definition: callable_overlay.hpp:1403
std::function< bool(optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents, v5::properties props) > v5_publish_handler
Publish handler.
Definition: callable_overlay.hpp:1059
connect_handler const & get_connect_handler() const
Get connect handler.
Definition: callable_overlay.hpp:1527
v5_auth_handler const & get_v5_auth_handler() const
Get auth handler.
Definition: callable_overlay.hpp:1825
serialize_publish_message_handler const & get_serialize_publish_message_handler() const
Get serialize publish handler.
Definition: callable_overlay.hpp:1967
std::function< bool(packet_id_t packet_id)> pubcomp_handler
Pubcomp handler.
Definition: callable_overlay.hpp:893
std::function< bool(buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_session, std::uint16_t keep_alive)> connect_handler
Connect handler.
Definition: callable_overlay.hpp:817
void set_v5_pubrec_handler(v5_pubrec_handler h=v5_pubrec_handler())
Set pubrec handler.
Definition: callable_overlay.hpp:1657
void set_v5_pubcomp_handler(v5_pubcomp_handler h=v5_pubcomp_handler())
Set pubcomp handler.
Definition: callable_overlay.hpp:1673
std::function< bool(packet_id_t packet_id, v5::pubcomp_reason_code reason_code, v5::properties props) > v5_pubcomp_handler
Pubcomp handler.
Definition: callable_overlay.hpp:1147
void set_v5_pubrel_handler(v5_pubrel_handler h=v5_pubrel_handler())
Set pubrel handler.
Definition: callable_overlay.hpp:1665
std::function< bool(packet_id_t packet_id, std::vector< v5::suback_reason_code > reasons, v5::properties props) > v5_suback_handler
Suback handler.
Definition: callable_overlay.hpp:1188
serialize_v5_pubrel_message_handler const & get_serialize_v5_pubrel_message_handler() const
Get serialize pubrel handler.
Definition: callable_overlay.hpp:1991
MQTT_ALWAYS_INLINE bool on_v5_connack(bool session_present, v5::connect_reason_code reason_code, v5::properties props) noexcept override final
Connack handler.
Definition: callable_overlay.hpp:355
v5_suback_handler const & get_v5_suback_handler() const
Get suback handler.
Definition: callable_overlay.hpp:1793
pingresp_handler const & get_pingresp_handler() const
Get pingresp handler.
Definition: callable_overlay.hpp:1420
MQTT_ALWAYS_INLINE void on_mqtt_message_processed(any session_life_keeper) noexcept override final
next read handler This handler is called when the current mqtt message has been processed....
Definition: callable_overlay.hpp:746
serialize_remove_handler const & get_serialize_remove_handler() const
Get serialize remove handler.
Definition: callable_overlay.hpp:1999
std::function< bool(packet_id_t packet_id, std::vector< unsubscribe_entry > entries, v5::properties props) > v5_unsubscribe_handler
Unsubscribe handler.
Definition: callable_overlay.hpp:1209
MQTT_ALWAYS_INLINE void on_serialize_v5_pubrel_message(v5::basic_pubrel_message< sizeof(packet_id_t)> msg) noexcept override final
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the pu...
Definition: callable_overlay.hpp:697
void set_error_handler(error_handler h=error_handler())
Set error handler.
Definition: callable_overlay.hpp:2061
pubrec_handler const & get_pubrec_handler() const
Get pubrec handler.
Definition: callable_overlay.hpp:1559
std::function< void(v5::basic_publish_message< sizeof(packet_id_t)> msg)> serialize_v5_publish_message_handler
Serialize publish handler You can serialize the publish message. To restore the message,...
Definition: callable_overlay.hpp:1313
std::function< bool(packet_id_t packet_id, std::vector< subscribe_entry > entries, v5::properties props) > v5_subscribe_handler
Subscribe handler.
Definition: callable_overlay.hpp:1167
void set_connack_handler(connack_handler h=connack_handler())
Set connack handler.
Definition: callable_overlay.hpp:1439
void set_v5_unsuback_handler(v5_unsuback_handler h=v5_unsuback_handler())
Set unsuback handler.
Definition: callable_overlay.hpp:1705
std::function< bool()> pingresp_handler
Pingresp handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200 3....
Definition: callable_overlay.hpp:769
void set_is_valid_length_handler(is_valid_length_handler h=is_valid_length_handler())
Set check length handler.
Definition: callable_overlay.hpp:1951
void set_mqtt_message_processed_handler(mqtt_message_processed_handler h=mqtt_message_processed_handler())
Set custom mqtt_message_processed_handler. The default setting is calling async_read_control_packet_t...
Definition: callable_overlay.hpp:2031
v5_pubcomp_handler const & get_v5_pubcomp_handler() const
Get pubcomp handler.
Definition: callable_overlay.hpp:1777
v5_pubrec_handler const & get_v5__handler() const
Get pubrec handler.
Definition: callable_overlay.hpp:1761
v5_subscribe_handler const & get_v5_subscribe_handler() const
Get subscribe handler.
Definition: callable_overlay.hpp:1785
puback_handler const & get_puback_handler() const
Get puback handler.
Definition: callable_overlay.hpp:1551
serialize_v5_publish_message_handler const & get_serialize_v5_publish_message_handler() const
Get serialize publish handler.
Definition: callable_overlay.hpp:1983
subscribe_handler const & get_subscribe_handler() const
Get subscribe handler.
Definition: callable_overlay.hpp:1583
std::function< bool(v5::auth_reason_code reason_code, v5::properties props) > v5_auth_handler
Auth handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901217 3....
Definition: callable_overlay.hpp:1267
v5_connack_handler const & get_v5_connack_handler() const
Get connack handler.
Definition: callable_overlay.hpp:1737
void set_pub_res_sent_handler(pub_res_sent_handler h=pub_res_sent_handler())
Set pubcomp handler.
Definition: callable_overlay.hpp:1836
std::function< bool(packet_id_t)> unsuback_handler
Unsuback handler.
Definition: callable_overlay.hpp:942
MQTT_ALWAYS_INLINE bool on_v5_puback(packet_id_t packet_id, v5::puback_reason_code reason_code, v5::properties props) noexcept override final
Puback handler.
Definition: callable_overlay.hpp:416
v5_unsubscribe_handler const & get_v5_unsubscribe_handler() const
Get unsubscribe handler.
Definition: callable_overlay.hpp:1801
void set_unsubscribe_handler(unsubscribe_handler h=unsubscribe_handler())
Set unsubscribe handler.
Definition: callable_overlay.hpp:1503
std::function< bool(packet_id_t packet_id, v5::puback_reason_code reason_code, v5::properties props) > v5_puback_handler
Puback handler.
Definition: callable_overlay.hpp:1081
MQTT_ALWAYS_INLINE void on_pub_res_sent(packet_id_t packet_id) noexcept override final
Publish response sent handler This function is called just after puback sent on QoS1,...
Definition: callable_overlay.hpp:653
v5_pubrel_handler const & get_v5_pubrel_handler() const
Get pubrel handler.
Definition: callable_overlay.hpp:1769
void set_pubrel_handler(pubrel_handler h=pubrel_handler())
Set pubrel handler.
Definition: callable_overlay.hpp:1471
std::function< void(v5::basic_pubrel_message< sizeof(packet_id_t)> msg)> serialize_v5_pubrel_message_handler
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the pu...
Definition: callable_overlay.hpp:1343
std::function< bool(bool session_present, connect_return_code return_code)> connack_handler
Connack handler.
Definition: callable_overlay.hpp:831
void set_disconnect_handler(disconnect_handler h=disconnect_handler())
Set disconnect handler.
Definition: callable_overlay.hpp:1519
MQTT_ALWAYS_INLINE bool on_connack(bool session_present, connect_return_code return_code) noexcept override final
Connack handler.
Definition: callable_overlay.hpp:122
v5_publish_handler const & get_v5_publish_handler() const
Set publish handler.
Definition: callable_overlay.hpp:1745
MQTT_ALWAYS_INLINE void on_v5_disconnect(v5::disconnect_reason_code reason_code, v5::properties props) noexcept override final
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os....
Definition: callable_overlay.hpp:592
std::function< bool(packet_id_t packet_id, v5::pubrel_reason_code reason_code, v5::properties props) > v5_pubrel_handler
Pubrel handler.
Definition: callable_overlay.hpp:1125
is_valid_length_handler const & get_is_valid_length_handler() const
Get check length handler.
Definition: callable_overlay.hpp:2015
pubcomp_handler const & get_pubcomp_handler() const
Get pubcomp handler.
Definition: callable_overlay.hpp:1575
v5_puback_handler const & get_v5_puback_handler() const
Get puback handler.
Definition: callable_overlay.hpp:1753
MQTT_ALWAYS_INLINE bool on_pingresp() noexcept override final
Pingresp handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200 3....
Definition: callable_overlay.hpp:52
Definition: publish.hpp:53
Definition: message.hpp:189
Definition: v5_message.hpp:1422