My Elma Project
An event loop manager for embedded systems
 All Classes Functions
on.cc
1 #include <iostream>
2 #include <chrono>
3 #include <vector>
4 
5 #include "stopwatch.h"
6 
7 using namespace std::chrono;
8 using namespace elma;
9 using namespace stopwatch;
10 
11 StopWatch&OnState:: stopwatch() { return (StopWatch&) state_machine(); }
12 
13 void OnState::exit(const Event& e) {
14  if ( e.name() == "start/stop" ) {
15  // User stopped the stopwatch
16  stopwatch().stop();
17  } else if ( e.name() == "lap" ) {
18  // User adds a lap to the stopwatch lap list
19  stopwatch().lap();
20  }
21 }
Definition: off.h:6
A stop watch class, that inherits from StateMachine.
Definition: stopwatch.h:16