7 #if !defined(MQTT_NULL_STRAND_HPP)
8 #define MQTT_NULL_STRAND_HPP
12 #include <boost/asio.hpp>
22 template <
typename Func,
typename Allocator>
23 void post(Func&& f, Allocator)
const {
26 [f = std::forward<Func>(f)] ()
mutable {
31 template <
typename Func,
typename Allocator>
32 void defer(Func&& f, Allocator)
const {
35 [f = std::forward<Func>(f)] ()
mutable {
40 template <
typename Func,
typename Allocator>
42 std::forward<Func>(f)();
46 as::io_context&
context() noexcept{
return ioc_; }
47 as::io_context
const&
context() const noexcept {
return ioc_; }
53 return std::addressof(lhs) == std::addressof(rhs);
66 struct is_executor<
MQTT_NS::null_strand> : std::true_type {
bool operator==(null_strand const &lhs, null_strand const &rhs)
Definition: null_strand.hpp:52
bool operator!=(null_strand const &lhs, null_strand const &rhs)
Definition: null_strand.hpp:56
Definition: buffer.hpp:242
Definition: buffer.hpp:241
Definition: null_strand.hpp:20
void defer(Func &&f, Allocator) const
Definition: null_strand.hpp:32
void dispatch(Func &&f, Allocator) const
Definition: null_strand.hpp:41
void on_work_started() const noexcept
Definition: null_strand.hpp:44
void post(Func &&f, Allocator) const
Definition: null_strand.hpp:23
void on_work_finished() const noexcept
Definition: null_strand.hpp:45
as::io_context & context() noexcept
Definition: null_strand.hpp:46
as::io_context const & context() const noexcept
Definition: null_strand.hpp:47
null_strand(as::io_context &ioc) noexcept
Definition: null_strand.hpp:21