Public Types | Public Member Functions | List of all members
can::CommInterface Class Referenceabstract

#include <interface.h>

Inheritance diagram for can::CommInterface:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

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

Detailed Description

Definition at line 135 of file interface.h.

Member Typedef Documentation

◆ FrameDelegate

Definition at line 138 of file interface.h.

◆ FrameFunc

using can::CommInterface::FrameFunc = std::function<void(const Frame&)>

Definition at line 137 of file interface.h.

◆ FrameListener

Definition at line 139 of file interface.h.

◆ FrameListenerConstSharedPtr

Definition at line 140 of file interface.h.

Constructor & Destructor Documentation

◆ ~CommInterface()

virtual can::CommInterface::~CommInterface ( )
inlinevirtual

Definition at line 173 of file interface.h.

Member Function Documentation

◆ createMsgListener() [1/2]

virtual FrameListenerConstSharedPtr can::CommInterface::createMsgListener ( const Frame::Header ,
const FrameFunc delegate 
)
pure virtual

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

Parameters
[in]headerCAN header to restrict listener on
[in]delegatedelegate to be bound listener
Returns
managed pointer to listener

Implemented in can::AsioDriver< Socket >, can::AsioDriver< boost::asio::posix::stream_descriptor >, and can::DummyInterface.

◆ createMsgListener() [2/2]

virtual FrameListenerConstSharedPtr can::CommInterface::createMsgListener ( const FrameFunc delegate)
pure virtual

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

Parameters
[in]delegatedelegate to be bound by the listener
Returns
managed pointer to listener

Implemented in can::AsioDriver< Socket >, can::AsioDriver< boost::asio::posix::stream_descriptor >, and can::DummyInterface.

◆ createMsgListenerM() [1/2]

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

Definition at line 169 of file interface.h.

◆ createMsgListenerM() [2/2]

template<typename Instance , typename Callable >
FrameListenerConstSharedPtr can::CommInterface::createMsgListenerM ( Instance  inst,
Callable  callable 
)
inline

Definition at line 157 of file interface.h.

◆ send()

virtual bool can::CommInterface::send ( const Frame msg)
pure virtual

enqueue frame for sending

Parameters
[in]msgmessage to be enqueued
Returns
true if frame was enqueued succesfully, otherwise false

Implemented in can::AsioDriver< Socket >, can::AsioDriver< boost::asio::posix::stream_descriptor >, and can::DummyInterface.


The documentation for this class was generated from the following file:


socketcan_interface
Author(s): Mathias Lüdtke
autogenerated on Wed Mar 2 2022 00:52:25