Class CommInterface

Inheritance Relationships

Derived Type

Class Documentation

class CommInterface

Subclassed by can::DriverInterface

Public Types

using FrameFunc = std::function<void(const Frame&)>
using FrameListener = Listener<const FrameFunc, const Frame&>
using FrameListenerConstSharedPtr = FrameListener::ListenerConstSharedPtr

Public Functions

virtual bool send(const Frame &msg) = 0

enqueue frame for sending

Parameters:

msg[in] message to be enqueued

Returns:

true if frame was enqueued succesfully, otherwise false

virtual FrameListenerConstSharedPtr createMsgListener(const FrameFunc &delegate) = 0

acquire a listener for the specified delegate, that will get called for all messages

Parameters:

delegate[in] delegate to be bound by the listener

Returns:

managed pointer to listener

template<typename Instance, typename Callable>
inline FrameListenerConstSharedPtr createMsgListenerM(Instance inst, Callable callable)
virtual FrameListenerConstSharedPtr createMsgListener(const Frame::Header &header, const FrameFunc &delegate) = 0

acquire a listener for the specified delegate, that will get called for messages with demanded ID

Parameters:
  • header[in] CAN header to restrict listener on

  • delegate[in] delegate to be bound listener

Returns:

managed pointer to listener

template<typename Instance, typename Callable>
inline FrameListenerConstSharedPtr createMsgListenerM(const Frame::Header &header, Instance inst, Callable callable)
inline virtual ~CommInterface()