31#pragma warning (disable: 4267)
34#include <boost/asio.hpp>
64 boost::asio::io_context& ioContext)
65 : m_connection(connection)
66 , m_strand(new boost::asio::io_context::strand(ioContext))
82 boost::asio::io_context::strand& strand)
83 : m_connection(connection)
84 , m_strand(&strand,null_deleter())
96 boost::asio::io_context::strand&
Strand() {
return *m_strand;}
101 void operator()(
void const *)
const
109 void CallDobDispatch()
111 m_isNotified.clear();
119 void OnDoDispatch()
override
121 if (!m_isNotified.test_and_set())
123 boost::asio::dispatch(*m_strand, [
this]{CallDobDispatch();});
128 std::shared_ptr<boost::asio::io_context::strand> m_strand;
129 std::atomic_flag m_isNotified;
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
A connection to the DOB.
Definition Connection.h:46
void Dispatch() const
When the dispatch event or callback is signalled, the application MUST call this method.
Interface for reception of a dispatch order.
Definition Consumer.h:74
The class makes a thread switch and perform a dispatch on Dob connection.
Definition AsioDispatcher.h:50
AsioDispatcher(const Safir::Dob::Connection &connection, boost::asio::io_context &ioContext)
Strandless constructor.
Definition AsioDispatcher.h:63
AsioDispatcher & operator=(const AsioDispatcher &)=delete
boost::asio::io_context::strand & Strand()
Get the strand that the dispatcher uses.
Definition AsioDispatcher.h:96
AsioDispatcher(const AsioDispatcher &)=delete
AsioDispatcher(const Safir::Dob::Connection &connection, boost::asio::io_context::strand &strand)
Stranded constructor.
Definition AsioDispatcher.h:81