INFM HIL Interface
Interface between Artery simulation and DuTs
PeriodicTimer.h
1
26#ifndef SIM_TO_DUT_INTERFACE_PERIODICTIMER_H
27#define SIM_TO_DUT_INTERFACE_PERIODICTIMER_H
28
29#include <boost/asio.hpp>
30#include <boost/asio/steady_timer.hpp>
31#include "../Events/SimEvent.h"
32
33namespace sim_interface {
40 public:
41 explicit PeriodicTimer(const std::shared_ptr<boost::asio::io_service> &io, int periodMs, SimEvent event,
42 std::function<void(const SimEvent &)> callback);
43
44 void start();
45
46 void stop();
47
48 private:
49 void tick(const boost::system::error_code &e);
50
51 boost::asio::steady_timer timer;
52 std::function<void(const SimEvent &)> callback;
53 SimEvent event;
54 int periodMs;
55 };
56}
57
58
59#endif //SIM_TO_DUT_INTERFACE_PERIODICTIMER_H
Timer to call given callback periodically with given event
Definition: PeriodicTimer.h:39
void stop()
Definition: PeriodicTimer.cpp:49
void start()
Definition: PeriodicTimer.cpp:42
Event object used to communicate between simulation and DuTs.
Definition: SimEvent.h:47
Definition: CANConnector.cpp:29