1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /*
- * Copyright (c) 2017-2023 zhllxt
- *
- * author : zhllxt
- * email : 37792738@qq.com
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
- #ifndef __ASIO2_MQTT_AOP_DISCONNECT_HPP__
- #define __ASIO2_MQTT_AOP_DISCONNECT_HPP__
- #if defined(_MSC_VER) && (_MSC_VER >= 1200)
- #pragma once
- #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
- #include <asio2/base/iopool.hpp>
- #include <asio2/base/detail/function_traits.hpp>
- #include <asio2/base/detail/util.hpp>
- #include <asio2/mqtt/message.hpp>
- namespace asio2::detail
- {
- template<class caller_t, class args_t>
- class mqtt_aop_disconnect
- {
- friend caller_t;
- protected:
- // server or client
- inline void _before_user_callback_impl(
- error_code& ec, std::shared_ptr<caller_t>& caller_ptr, caller_t* caller, mqtt::message& om,
- mqtt::v3::disconnect& msg)
- {
- detail::ignore_unused(ec, caller_ptr, caller, om, msg);
- }
- // server or client
- inline void _before_user_callback_impl(
- error_code& ec, std::shared_ptr<caller_t>& caller_ptr, caller_t* caller, mqtt::message& om,
- mqtt::v4::disconnect& msg)
- {
- detail::ignore_unused(ec, caller_ptr, caller, om, msg);
- }
- // server or client
- inline void _before_user_callback_impl(
- error_code& ec, std::shared_ptr<caller_t>& caller_ptr, caller_t* caller, mqtt::message& om,
- mqtt::v5::disconnect& msg)
- {
- detail::ignore_unused(ec, caller_ptr, caller, om, msg);
- }
- inline void _after_user_callback_impl(
- error_code& ec, std::shared_ptr<caller_t>& caller_ptr, caller_t* caller, mqtt::message& om,
- mqtt::v3::disconnect& msg)
- {
- detail::ignore_unused(ec, caller_ptr, caller, om, msg);
- }
- inline void _after_user_callback_impl(
- error_code& ec, std::shared_ptr<caller_t>& caller_ptr, caller_t* caller, mqtt::message& om,
- mqtt::v4::disconnect& msg)
- {
- detail::ignore_unused(ec, caller_ptr, caller, om, msg);
- }
- inline void _after_user_callback_impl(
- error_code& ec, std::shared_ptr<caller_t>& caller_ptr, caller_t* caller, mqtt::message& om,
- mqtt::v5::disconnect& msg)
- {
- detail::ignore_unused(ec, caller_ptr, caller, om, msg);
- }
- };
- }
- #endif // !__ASIO2_MQTT_AOP_DISCONNECT_HPP__
|