My Elma Project
An event loop manager for embedded systems
 All Classes Functions
off.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& OffState:: stopwatch() { return (StopWatch&) state_machine(); }
12 
13 void OffState::exit(const Event& e) {
14  if ( e.name() == "start/stop" ) {
15  // User started the stopwatch
16  stopwatch().begin();
17  } else if ( e.name() == "reset" ) {
18  // User rest the stopwatch
19  stopwatch().reset();
20  }
21 }
Definition: off.h:6
A stop watch class, that inherits from StateMachine.
Definition: stopwatch.h:16