Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
can::DummyInterface Class Reference

#include <dummy.h>

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

Public Member Functions

bool add (const Frame &k, const Frame &v, bool multi)
 
bool add (const Frame &k, const std::string &v, bool multi)
 
bool add (const std::string &k, const Frame &v, bool multi)
 
bool add (const std::string &k, const std::string &v, bool multi)
 
virtual FrameListenerConstSharedPtr createMsgListener (const Frame::Header &h, const FrameFunc &delegate)
 
virtual FrameListenerConstSharedPtr createMsgListener (const FrameFunc &delegate)
 
virtual StateListenerConstSharedPtr createStateListener (const StateFunc &delegate)
 
virtual bool doesLoopBack () const
 
 DummyInterface (bool loopback)
 
virtual State getState ()
 
bool init (const std::string &device, bool loopback)
 
virtual bool recover ()
 
virtual void run ()
 
virtual bool send (const Frame &msg)
 
virtual void shutdown ()
 
virtual bool translateError (unsigned int internal_error, std::string &str)
 
- Public Member Functions inherited from can::DriverInterface
virtual bool init (const std::string &device, bool loopback, SettingsConstSharedPtr settings)
 
virtual ~DriverInterface ()
 
- Public Member Functions inherited from can::CommInterface
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 ~CommInterface ()
 
- Public Member Functions inherited from can::StateInterface
template<typename Instance , typename Callable >
StateListenerConstSharedPtr createStateListenerM (Instance inst, Callable callable)
 
virtual ~StateInterface ()
 

Private Types

using FrameDispatcher = FilteredDispatcher< unsigned int, CommInterface::FrameListener >
 
using Map = std::unordered_map< std::string, Frame >
 
using StateDispatcher = SimpleDispatcher< StateInterface::StateListener >
 

Private Member Functions

bool add_noconv (const std::string &k, const Frame &v, bool multi)
 

Private Attributes

FrameDispatcher frame_dispatcher_
 
bool loopback_
 
Map map_
 
State state_
 
StateDispatcher state_dispatcher_
 

Additional Inherited Members

- Public Types inherited from can::CommInterface
using FrameDelegate = DelegateHelper< FrameFunc >
 
using FrameFunc = std::function< void(const Frame &)>
 
using FrameListener = Listener< const FrameFunc, const Frame & >
 
using FrameListenerConstSharedPtr = FrameListener::ListenerConstSharedPtr
 
- Public Types inherited from can::StateInterface
using StateDelegate = DelegateHelper< StateFunc >
 
using StateFunc = std::function< void(const State &)>
 
using StateListener = Listener< const StateFunc, const State & >
 
using StateListenerConstSharedPtr = StateListener::ListenerConstSharedPtr
 

Detailed Description

Definition at line 13 of file dummy.h.

Member Typedef Documentation

◆ FrameDispatcher

Definition at line 14 of file dummy.h.

◆ Map

using can::DummyInterface::Map = std::unordered_map<std::string, Frame>
private

Definition at line 16 of file dummy.h.

◆ StateDispatcher

Definition at line 15 of file dummy.h.

Constructor & Destructor Documentation

◆ DummyInterface()

can::DummyInterface::DummyInterface ( bool  loopback)
inline

Definition at line 31 of file dummy.h.

Member Function Documentation

◆ add() [1/4]

bool can::DummyInterface::add ( const Frame k,
const Frame v,
bool  multi 
)
inline

Definition at line 36 of file dummy.h.

◆ add() [2/4]

bool can::DummyInterface::add ( const Frame k,
const std::string &  v,
bool  multi 
)
inline

Definition at line 42 of file dummy.h.

◆ add() [3/4]

bool can::DummyInterface::add ( const std::string &  k,
const Frame v,
bool  multi 
)
inline

Definition at line 33 of file dummy.h.

◆ add() [4/4]

bool can::DummyInterface::add ( const std::string &  k,
const std::string &  v,
bool  multi 
)
inline

Definition at line 39 of file dummy.h.

◆ add_noconv()

bool can::DummyInterface::add_noconv ( const std::string &  k,
const Frame v,
bool  multi 
)
inlineprivate

Definition at line 23 of file dummy.h.

◆ createMsgListener() [1/2]

virtual FrameListenerConstSharedPtr can::DummyInterface::createMsgListener ( const Frame::Header ,
const FrameFunc delegate 
)
inlinevirtual

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

Implements can::CommInterface.

Definition at line 61 of file dummy.h.

◆ createMsgListener() [2/2]

virtual FrameListenerConstSharedPtr can::DummyInterface::createMsgListener ( const FrameFunc delegate)
inlinevirtual

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

Implements can::CommInterface.

Definition at line 58 of file dummy.h.

◆ createStateListener()

virtual StateListenerConstSharedPtr can::DummyInterface::createStateListener ( const StateFunc delegate)
inlinevirtual

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

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

Implements can::StateInterface.

Definition at line 92 of file dummy.h.

◆ doesLoopBack()

virtual bool can::DummyInterface::doesLoopBack ( ) const
inlinevirtual

Implements can::DriverInterface.

Definition at line 80 of file dummy.h.

◆ getState()

virtual State can::DummyInterface::getState ( )
inlinevirtual
Returns
current state of driver

Implements can::DriverInterface.

Definition at line 68 of file dummy.h.

◆ init()

bool can::DummyInterface::init ( const std::string &  device,
bool  loopback 
)
inlinevirtual

Implements can::DriverInterface.

Definition at line 84 of file dummy.h.

◆ recover()

virtual bool can::DummyInterface::recover ( )
inlinevirtual

Recover interface after errors and emergency stops

Returns
true if device was recovered succesfully, false otherwise

Implements can::DriverInterface.

Definition at line 66 of file dummy.h.

◆ run()

virtual void can::DummyInterface::run ( )
inlinevirtual

Implements can::DriverInterface.

Definition at line 82 of file dummy.h.

◆ send()

virtual bool can::DummyInterface::send ( const Frame msg)
inlinevirtual

enqueue frame for sending

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

Implements can::CommInterface.

Definition at line 45 of file dummy.h.

◆ shutdown()

virtual void can::DummyInterface::shutdown ( )
inlinevirtual

shutdown interface

Returns
true if shutdown was succesful, false otherwise

Implements can::DriverInterface.

Definition at line 70 of file dummy.h.

◆ translateError()

virtual bool can::DummyInterface::translateError ( unsigned int  internal_error,
std::string &  str 
)
inlinevirtual

Implements can::DriverInterface.

Definition at line 72 of file dummy.h.

Member Data Documentation

◆ frame_dispatcher_

FrameDispatcher can::DummyInterface::frame_dispatcher_
private

Definition at line 17 of file dummy.h.

◆ loopback_

bool can::DummyInterface::loopback_
private

Definition at line 21 of file dummy.h.

◆ map_

Map can::DummyInterface::map_
private

Definition at line 20 of file dummy.h.

◆ state_

State can::DummyInterface::state_
private

Definition at line 19 of file dummy.h.

◆ state_dispatcher_

StateDispatcher can::DummyInterface::state_dispatcher_
private

Definition at line 18 of file dummy.h.


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