#include <asio_base.h>
Public Member Functions | |
virtual FrameListener::Ptr | createMsgListener (const FrameDelegate &delegate) |
virtual FrameListener::Ptr | createMsgListener (const Frame::Header &h, const FrameDelegate &delegate) |
virtual StateListener::Ptr | createStateListener (const StateDelegate &delegate) |
State | getState () |
virtual void | run () |
virtual bool | send (const Frame &msg) |
virtual void | shutdown () |
virtual | ~AsioDriver () |
Protected Member Functions | |
AsioDriver () | |
void | dispatchFrame (const Frame &msg) |
virtual bool | enqueue (const Frame &msg)=0 |
void | frameReceived (const boost::system::error_code &error) |
void | setDriverState (State::DriverState state) |
void | setErrorCode (const boost::system::error_code &error) |
void | setInternalError (unsigned int internal_error) |
void | setNotReady () |
virtual void | triggerReadSome ()=0 |
Protected Attributes | |
Frame | input_ |
boost::asio::io_service | io_service_ |
Socket | socket_ |
boost::asio::strand | strand_ |
Private Types | |
typedef FilteredDispatcher < const unsigned int, CommInterface::FrameListener > | FrameDispatcher |
typedef SimpleDispatcher < StateInterface::StateListener > | StateDispatcher |
Private Attributes | |
FrameDispatcher | frame_dispatcher_ |
boost::mutex | socket_mutex_ |
State | state_ |
StateDispatcher | state_dispatcher_ |
boost::mutex | state_mutex_ |
Definition at line 14 of file asio_base.h.
typedef FilteredDispatcher<const unsigned int, CommInterface::FrameListener> can::AsioDriver< Socket >::FrameDispatcher [private] |
Definition at line 15 of file asio_base.h.
typedef SimpleDispatcher<StateInterface::StateListener> can::AsioDriver< Socket >::StateDispatcher [private] |
Definition at line 16 of file asio_base.h.
can::AsioDriver< Socket >::AsioDriver | ( | ) | [inline, protected] |
Definition at line 72 of file asio_base.h.
virtual can::AsioDriver< Socket >::~AsioDriver | ( | ) | [inline, virtual] |
Definition at line 77 of file asio_base.h.
virtual FrameListener::Ptr can::AsioDriver< Socket >::createMsgListener | ( | const FrameDelegate & | delegate | ) | [inline, virtual] |
acquire a listener for the specified delegate, that will get called for all messages
[in] | delegate,: | delegate to be bound by the listener |
Implements can::CommInterface.
Definition at line 115 of file asio_base.h.
virtual FrameListener::Ptr can::AsioDriver< Socket >::createMsgListener | ( | const Frame::Header & | , |
const FrameDelegate & | delegate | ||
) | [inline, virtual] |
acquire a listener for the specified delegate, that will get called for messages with demanded ID
[in] | header,: | CAN header to restrict listener on |
[in] | delegate,: | delegate to be bound listener |
Implements can::CommInterface.
Definition at line 118 of file asio_base.h.
virtual StateListener::Ptr can::AsioDriver< Socket >::createStateListener | ( | const StateDelegate & | delegate | ) | [inline, virtual] |
acquire a listener for the specified delegate, that will get called for all state changes
[in] | delegate,: | delegate to be bound by the listener |
Implements can::StateInterface.
Definition at line 121 of file asio_base.h.
void can::AsioDriver< Socket >::dispatchFrame | ( | const Frame & | msg | ) | [inline, protected] |
Definition at line 33 of file asio_base.h.
virtual bool can::AsioDriver< Socket >::enqueue | ( | const Frame & | msg | ) | [protected, pure virtual] |
Implemented in can::SocketCANInterface.
void can::AsioDriver< Socket >::frameReceived | ( | const boost::system::error_code & | error | ) | [inline, protected] |
Definition at line 62 of file asio_base.h.
State can::AsioDriver< Socket >::getState | ( | ) | [inline, virtual] |
Implements can::DriverInterface.
Definition at line 79 of file asio_base.h.
virtual void can::AsioDriver< Socket >::run | ( | ) | [inline, virtual] |
Implements can::DriverInterface.
Definition at line 83 of file asio_base.h.
virtual bool can::AsioDriver< Socket >::send | ( | const Frame & | msg | ) | [inline, virtual] |
enqueue frame for sending
[in] | msg,: | message to be enqueued |
Implements can::CommInterface.
Definition at line 103 of file asio_base.h.
void can::AsioDriver< Socket >::setDriverState | ( | State::DriverState | state | ) | [inline, protected] |
Definition at line 51 of file asio_base.h.
void can::AsioDriver< Socket >::setErrorCode | ( | const boost::system::error_code & | error | ) | [inline, protected] |
Definition at line 36 of file asio_base.h.
void can::AsioDriver< Socket >::setInternalError | ( | unsigned int | internal_error | ) | [inline, protected] |
Definition at line 43 of file asio_base.h.
void can::AsioDriver< Socket >::setNotReady | ( | ) | [inline, protected] |
Definition at line 58 of file asio_base.h.
virtual void can::AsioDriver< Socket >::shutdown | ( | ) | [inline, virtual] |
shutdown interface
Implements can::DriverInterface.
Definition at line 107 of file asio_base.h.
virtual void can::AsioDriver< Socket >::triggerReadSome | ( | ) | [protected, pure virtual] |
Implemented in can::SocketCANInterface.
FrameDispatcher can::AsioDriver< Socket >::frame_dispatcher_ [private] |
Definition at line 17 of file asio_base.h.
Frame can::AsioDriver< Socket >::input_ [protected] |
Definition at line 28 of file asio_base.h.
boost::asio::io_service can::AsioDriver< Socket >::io_service_ [protected] |
Definition at line 25 of file asio_base.h.
Socket can::AsioDriver< Socket >::socket_ [protected] |
Definition at line 27 of file asio_base.h.
boost::mutex can::AsioDriver< Socket >::socket_mutex_ [private] |
Definition at line 22 of file asio_base.h.
State can::AsioDriver< Socket >::state_ [private] |
Definition at line 20 of file asio_base.h.
StateDispatcher can::AsioDriver< Socket >::state_dispatcher_ [private] |
Definition at line 18 of file asio_base.h.
boost::mutex can::AsioDriver< Socket >::state_mutex_ [private] |
Definition at line 21 of file asio_base.h.
boost::asio::strand can::AsioDriver< Socket >::strand_ [protected] |
Definition at line 26 of file asio_base.h.