TimerInterrupt

template<class Converter>
class TimerInterrupt : public vslib::Interrupt<Converter>

Public Functions

inline TimerInterrupt(std::string_view name, Converter &converter, std::chrono::microseconds delay, std::function<void(Converter&)> handler_function = [](Converter &) { ;})

Constructor for TimerInterrupt.

Parameters:
  • name – Name identifier for this interrupt

  • converter – Reference to the parent converter object

  • handler_function – Function to be called when an interrupt triggers

  • delay – Delay between interrupts in integer increments of a microsecond

inline virtual void start() override

Starts periodic interrupt.

inline virtual void stop() override

Stops periodic interrupt from triggering.

inline void setDelay(std::chrono::microseconds delay) noexcept

Sets the delay of the timer interrupt.

Parameters:

delayInterrupt delay in microseconds

inline int64_t getDelay() const

Returns the delay in microseconds.