7 #if !defined(MQTT_CALLABLE_OVERLAY_HPP)
8 #define MQTT_CALLABLE_OVERLAY_HPP
18 template<
typename Impl>
24 template<
typename ... Args>
26 :
base(std::forward<Args>(args)...)
43 return ! h_pingreq_ || h_pingreq_();
53 return ! h_pingresp_ || h_pingresp_();
96 optional<buffer> user_name,
97 optional<buffer> password,
100 std::uint16_t keep_alive) noexcept
override final {
124 || h_connack_(session_present, return_code);
147 buffer contents) noexcept
override final {
149 || h_publish_(packet_id,
165 || h_puback_(packet_id);
178 || h_pubrec_(packet_id);
191 || h_pubrel_(packet_id);
204 || h_pubcomp_(packet_id);
218 std::vector<subscribe_entry> entries) noexcept
override final {
219 return ! h_subscribe_
220 || h_subscribe_(packet_id,
force_move(entries));
235 std::vector<suback_return_code> reasons) noexcept
override final {
251 std::vector<unsubscribe_entry> entries) noexcept
override final {
252 return ! h_unsubscribe_
253 || h_unsubscribe_(packet_id,
force_move(entries));
265 || h_unsuback_(packet_id);
274 if(h_disconnect_) h_disconnect_();
323 optional<buffer> user_name,
324 optional<buffer> password,
327 std::uint16_t keep_alive,
329 return ! h_v5_connect_
358 return ! h_v5_connack_
359 || h_v5_connack_(session_present, reason_code,
force_move(props));
392 return ! h_v5_publish_
393 || h_v5_publish_(packet_id,
419 return ! h_v5_puback_
420 || h_v5_puback_(packet_id, reason_code,
force_move(props));
442 return ! h_v5_pubrec_
443 || h_v5_pubrec_(packet_id, reason_code,
force_move(props));
465 return ! h_v5_pubrel_
466 || h_v5_pubrel_(packet_id, reason_code,
force_move(props));
488 return ! h_v5_pubcomp_
489 || h_v5_pubcomp_(packet_id, reason_code,
force_move(props));
507 std::vector<subscribe_entry> entries,
509 return ! h_v5_subscribe_
529 std::vector<v5::suback_reason_code> reasons,
531 return ! h_v5_suback_
551 std::vector<unsubscribe_entry> entries,
553 return ! h_v5_unsubscribe_
573 std::vector<v5::unsuback_reason_code> reasons,
575 return ! h_v5_unsuback_
594 if (h_v5_disconnect_) h_v5_disconnect_(reason_code,
force_move(props));
614 || h_v5_auth_(reason_code,
force_move(props));
629 if (h_close_) h_close_();
642 if (h_error_) h_error_(ec);
654 if (h_pub_res_sent_) h_pub_res_sent_(packet_id);
664 if (h_serialize_publish_) h_serialize_publish_(msg);
674 if (h_serialize_v5_publish_) h_serialize_v5_publish_(msg);
686 if (h_serialize_pubrel_) h_serialize_pubrel_(msg);
698 if (h_serialize_v5_pubrel_) h_serialize_v5_pubrel_(msg);
706 if (h_serialize_remove_) h_serialize_remove_(packet_id);
715 if (h_pre_send_) h_pre_send_();
726 return ! h_is_valid_length_
747 if(h_mqtt_message_processed_) {
748 h_mqtt_message_processed_(
force_move(session_life_keeper));
751 base::on_mqtt_message_processed(
force_move(session_life_keeper));
813 optional<buffer> user_name,
814 optional<buffer> password,
817 std::uint16_t keep_alive)>;
906 std::vector<subscribe_entry> entries)>;
920 std::vector<suback_return_code> qoss)>;
933 std::vector<unsubscribe_entry> entries)>;
998 optional<buffer> user_name,
999 optional<buffer> password,
1000 optional<will>
will,
1002 std::uint16_t keep_alive,
1023 bool(
bool session_present,
1054 bool(optional<packet_id_t> packet_id,
1165 std::vector<subscribe_entry> entries,
1186 std::vector<v5::suback_reason_code> reasons,
1207 std::vector<unsubscribe_entry> entries,
1228 std::vector<v5::unsuback_reason_code> reasons,
1385 std::function<void(any session_life_keeper)>;
1584 return h_subscribe_;
1600 return h_unsubscribe_;
1616 return h_disconnect_;
1730 return h_v5_connect_;
1738 return h_v5_connack_;
1746 return h_v5_publish_;
1754 return h_v5_puback_;
1762 return h_v5_pubrec_;
1770 return h_v5_pubrel_;
1778 return h_v5_pubcomp_;
1786 return h_v5_subscribe_;
1794 return h_v5_suback_;
1802 return h_v5_unsubscribe_;
1810 return h_v5_unsuback_;
1818 return h_v5_disconnect_;
1850 h_serialize_publish_ =
force_move(h_publish);
1865 h_serialize_v5_publish_ =
force_move(h_publish);
1866 h_serialize_v5_pubrel_ =
force_move(h_pubrel);
1880 h_serialize_publish_ =
1884 auto buf = msg.continuous_buffer();
1885 h_publish(msg.packet_id(), buf.data(), buf.size());
1888 h_serialize_pubrel_ =
1892 auto buf = msg.continuous_buffer();
1893 h_pubrel(msg.packet_id(), buf.data(), buf.size());
1909 h_serialize_v5_publish_ =
1913 auto buf = msg.continuous_buffer();
1914 h_publish(msg.packet_id(), buf.data(), buf.size());
1917 h_serialize_v5_pubrel_ =
1921 auto buf = msg.continuous_buffer();
1922 h_pubrel(msg.packet_id(), buf.data(), buf.size());
1960 return h_pub_res_sent_;
1968 return h_serialize_publish_;
1976 return h_serialize_pubrel_;
1984 return h_serialize_v5_publish_;
1992 return h_serialize_v5_pubrel_;
2000 return h_serialize_remove_;
2016 return h_is_valid_length_;
2037 h_mqtt_message_processed_ = {};
2046 return h_mqtt_message_processed_;
#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
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
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
~callable_overlay()=default
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