6 #include <boost/asio.hpp> 7 #include <boost/thread/mutex.hpp> 8 #include <boost/thread/thread.hpp> 9 #include <boost/bind.hpp> 26 #if BOOST_ASIO_VERSION >= 101200 // Boost 1.66+ 27 boost::asio::io_context::strand
strand_;
41 boost::mutex::scoped_lock lock(state_mutex_);
48 boost::mutex::scoped_lock lock(state_mutex_);
56 boost::mutex::scoped_lock lock(state_mutex_);
77 : strand_(io_service_), socket_(io_service_)
84 boost::mutex::scoped_lock lock(state_mutex_);
92 boost::asio::io_service::work work(io_service_);
95 boost::thread post_thread(boost::bind(&boost::asio::io_service::run, &io_service_));
99 boost::system::error_code ec;
112 if(socket_.is_open()){
boost::mutex socket_mutex_
StateDispatcher state_dispatcher_
void dispatch(const typename BaseClass::Type &obj)
virtual StateListenerConstSharedPtr createStateListener(const StateDelegate &delegate)
void setInternalError(unsigned int internal_error)
virtual FrameListenerConstSharedPtr createMsgListener(const FrameDelegate &delegate)
FilteredDispatcher< const unsigned int, CommInterface::FrameListener > FrameDispatcher
boost::asio::strand strand_
SimpleDispatcher< StateInterface::StateListener > StateDispatcher
virtual bool send(const Frame &msg)
virtual void triggerReadSome()=0
boost::mutex state_mutex_
virtual bool enqueue(const Frame &msg)=0
FrameDispatcher frame_dispatcher_
void setErrorCode(const boost::system::error_code &error)
StateListener::ListenerConstSharedPtr StateListenerConstSharedPtr
void dispatch(const Type &obj)
boost::asio::io_service io_service_
enum can::State::DriverState driver_state
void setDriverState(State::DriverState state)
void dispatchFrame(const Frame &msg)
void frameReceived(const boost::system::error_code &error)
BaseClass::ListenerConstSharedPtr createListener(const K &key, const typename BaseClass::Callable &callable)
ListenerConstSharedPtr createListener(const Callable &callable)
unsigned int internal_error
driver specific error
FrameListener::ListenerConstSharedPtr FrameListenerConstSharedPtr
virtual FrameListenerConstSharedPtr createMsgListener(const Frame::Header &h, const FrameDelegate &delegate)
boost::system::error_code error_code
device access error