2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
44#ifndef DOXYGEN_SHOULD_SKIP_THIS
46#include "utils/Timeval.h"
61 if (!enable(STDIN_FILENO)) {
62 std::cout <<
"KeyboardReader not activated";
67 std::cout <<
"ReadEvent" << std::endl;
69
70
71
72
75 const ssize_t ret = read(STDIN_FILENO, buffer, 256);
81 value = std::stol(buffer);
83 std::cout <<
"Value = " << value << std::endl;
86 }
catch (std::invalid_argument& e) {
87 std::cout << e.what() <<
": "
88 <<
"no conversion possible: input = " << buffer << std::endl;
std::function< void(long)> callBack
KeyboardReader(const std::function< void(long)> &cb)
void unobservedEvent() override
void readEvent() override
ReadEventReceiver(const std::string &name, const utils::Timeval &timeout)