1 #ifndef SOCKETCAN_INTERFACE_DUMMY_H 2 #define SOCKETCAN_INTERFACE_DUMMY_H 7 #include <boost/algorithm/string.hpp> 14 typedef boost::unordered_multimap<std::string, Frame>
Map;
22 if(multi || map_.find(k) == map_.end()){
23 map_.insert( std::make_pair(boost::to_lower_copy(k), v));
31 bool add(
const std::string &k,
const Frame &v,
bool multi){
32 return add_noconv(boost::to_lower_copy(k), v, multi);
37 bool add(
const std::string &k,
const std::string &v,
bool multi){
40 bool add(
const Frame &k,
const std::string &v,
bool multi){
44 if(loopback_) frame_dispatcher_.
dispatch(msg);
46 std::pair <Map::iterator, Map::iterator> r = map_.equal_range(
tostring(msg,
true));
47 for (Map::iterator it=r.first; it!=r.second; ++it){
48 frame_dispatcher_.
dispatch(it->second);
51 catch(
const std::out_of_range &e){
71 if (!internal_error) {
82 bool init(
const std::string &device,
bool loopback){
virtual bool doesLoopBack() const
bool add_noconv(const std::string &k, const Frame &v, bool multi)
FilteredDispatcher< const unsigned int, CommInterface::FrameListener > FrameDispatcher
virtual FrameListenerConstSharedPtr createMsgListener(const FrameDelegate &delegate)
std::string tostring(const Header &h, bool lc)
virtual StateListenerConstSharedPtr createStateListener(const StateDelegate &delegate)
void dispatch(const typename BaseClass::Type &obj)
DummyInterface(bool loopback)
StateDispatcher state_dispatcher_
Frame toframe(const std::string &s)
virtual bool translateError(unsigned int internal_error, std::string &str)
StateListener::ListenerConstSharedPtr StateListenerConstSharedPtr
virtual FrameListenerConstSharedPtr createMsgListener(const Frame::Header &h, const FrameDelegate &delegate)
void dispatch(const Type &obj)
bool add(const Frame &k, const std::string &v, bool multi)
bool add(const std::string &k, const Frame &v, bool multi)
enum can::State::DriverState driver_state
bool add(const Frame &k, const Frame &v, bool multi)
boost::shared_ptr< DummyInterface > DummyInterfaceSharedPtr
bool add(const std::string &k, const std::string &v, bool multi)
SimpleDispatcher< StateInterface::StateListener > StateDispatcher
BaseClass::ListenerConstSharedPtr createListener(const K &key, const typename BaseClass::Callable &callable)
ListenerConstSharedPtr createListener(const Callable &callable)
unsigned int internal_error
driver specific error
bool init(const std::string &device, bool loopback)
virtual bool send(const Frame &msg)
FrameListener::ListenerConstSharedPtr FrameListenerConstSharedPtr
boost::unordered_multimap< std::string, Frame > Map
FrameDispatcher frame_dispatcher_