27 #include <Safir/Utilities/Internal/Atomic.h>
28 #include <boost/bind.hpp>
29 #include <boost/bind/protect.hpp>
30 #include <boost/noncopyable.hpp>
31 #include <boost/function.hpp>
32 #include <boost/atomic.hpp>
33 #include <boost/make_shared.hpp>
36 #pragma warning (push)
37 #pragma warning (disable: 4267)
40 #include <boost/asio.hpp>
56 ,
private boost::noncopyable
71 boost::asio::io_service& ioService)
72 : m_connection(connection)
73 , m_strand(new boost::asio::strand(ioService))
89 boost::asio::strand& strand)
90 : m_connection(connection)
91 , m_strand(&strand,null_deleter())
100 boost::asio::strand&
Strand() {
return *m_strand;}
105 void operator()(
void const *)
const
113 void CallDobDispatch()
115 m_isNotified.clear();
125 if (!m_isNotified.test_and_set())
127 m_strand->dispatch(boost::bind(&AsioDispatcher::CallDobDispatch,
this));
132 boost::function<void()> m_notifyFunction;
133 boost::shared_ptr<boost::asio::strand> m_strand;
134 boost::atomic_flag m_isNotified;
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition: Backdoor.h:30
AsioDispatcher(const Safir::Dob::Connection &connection, boost::asio::strand &strand)
Stranded constructor.
Definition: AsioDispatcher.h:88
Interface for reception of a dispatch order.
Definition: Consumer.h:72
AsioDispatcher(const Safir::Dob::Connection &connection, boost::asio::io_service &ioService)
Strandless constructor.
Definition: AsioDispatcher.h:70
boost::asio::strand & Strand()
Get the strand that the dispatcher uses.
Definition: AsioDispatcher.h:100
void Dispatch() const
When the dispatch event or callback is signalled, the application MUST call this method.
A connection to the DOB.
Definition: Connection.h:45
The class makes a thread switch and perform a dispatch on Dob connection.
Definition: AsioDispatcher.h:54