Subject | Hash | Author | Date (UTC) |
---|---|---|---|
fix test | 8b364e739d1e12cd77b9f63efb0a245a75e695df | mucbuc | 2020-01-18 21:49:21 |
fix emit once | 71aba1ef472aa23c9c9a8529b5258599a6289c16 | mucbuc | 2020-01-18 21:41:03 |
remove agentlifetime test | ce0fba661c6110fc050203a1a8f9fedf39258615 | mucbuc | 2020-01-18 11:25:44 |
emit with arg passes | 1b2288e8472b749c513120c441397a77298ab0b7 | mucbuc | 2020-01-17 10:58:28 |
dynamo update | 7082792be9aa3ccb56b0afbddf58bdf468d56030 | mucbuc | 2020-01-17 05:32:03 |
circuit | 9877e777b93a54d396248ad449f6ba5abf324733 | mucbuc | 2020-01-17 04:22:05 |
dynamo v2dev | 15f474b5a627558c230b2fe96c40fb5c68a176d0 | mucbuc | 2020-01-17 04:21:40 |
research | 47ce3a71d001f2aea7af852673b42b83f20be4dd | Ubuntu | 2019-12-22 17:19:57 |
working on test | b646f535e229ff57b421f0bee0570c8a4bda76a9 | Ubuntu | 2019-12-21 13:20:34 |
emit with args | 81cc2a4373cb92a07ba7acbab65ebabceb826dc0 | Ubuntu | 2019-12-21 06:40:24 |
format | 1192aea1b3bf9b400e02a11152a38e5dfc6b7ad6 | Ubuntu | 2019-12-21 06:27:42 |
todo | ce69f800504f9e5c643115b9ca887705dafafde3 | Ubuntu | 2019-12-18 07:43:15 |
format | e59b4ae5d0286ba6766e66427996f8ccab4eff0e | Ubuntu | 2019-12-18 07:38:21 |
redo interface | 3dd5822c6288ad004d1ec45e37a6f63d361aff39 | Ubuntu | 2019-12-18 07:38:11 |
temp test | 54800db7dbd02d7070f5018abd27bea261bd9097 | Ubuntu | 2019-12-18 07:07:07 |
cleanup test | 58f12d14f6db17e0916b115f470f87393e1ebce6 | Ubuntu | 2019-12-15 14:52:15 |
fix build error | 51fcd8e612a8e89cf6ef2c94cfb82b664b532313 | mucbuc | 2019-11-29 06:49:34 |
moved impl back | e536719eb2c090e49e1f389deed19dbdcd582275 | mucbuc | 2019-11-27 15:17:35 |
emitter_impl | 4d41cb0eb6ee37a66b9c8d3b02824ec2020bca31 | mucbuc | 2019-11-26 10:58:35 |
using template parameter packs | b01b5f9568215ccfd5c7c30cfb68ccc8a3c720da | mucbuc | 2019-11-14 14:21:50 |
File | Lines added | Lines deleted |
---|---|---|
test/src/on.cpp | 13 | 33 |
File test/src/on.cpp changed (mode: 100644) (index d4bc9a8..0177dae) | |||
1 | 1 | ||
2 | #include <iostream> | ||
3 | #include <lib/ohm/src/quemitter.h> | ||
4 | 2 | #include <tmp/src/test.h> | #include <tmp/src/test.h> |
5 | #include <vector> | ||
3 | |||
4 | #include <lib/ohm/src/emitter_impl.h> | ||
6 | 5 | ||
7 | 6 | using namespace std; | using namespace std; |
8 | 7 | using namespace om636; | using namespace om636; |
8 | using namespace control; | ||
9 | 9 | ||
10 | template <template <class, class> class T> | ||
11 | void check_on() | ||
10 | int main() | ||
12 | 11 | { | { |
13 | typedef T<string, function<void()>> emitter_type; | ||
14 | typedef typename emitter_type::listener_type listener_type; | ||
12 | using namespace std; | ||
15 | 13 | ||
16 | emitter_type emitter; | ||
17 | vector<listener_type> listeners; | ||
14 | EmitterImpl<string> emitter; | ||
18 | 15 | ||
19 | 16 | unsigned counter(0); | unsigned counter(0); |
20 | |||
21 | listeners.push_back(emitter.on("on", [&]() { | ||
17 | auto listener{ emitter.on("on", [&]() { | ||
22 | 18 | ++counter; | ++counter; |
23 | })); | ||
24 | |||
25 | emitter.emit("on"); | ||
26 | emitter.emit("on"); | ||
27 | emitter.emit("on"); | ||
28 | emitter.emit("on"); | ||
29 | |||
30 | ASSERT(counter == 4); | ||
31 | |||
32 | FOOTER; | ||
33 | } | ||
34 | #include <lib/ohm/src/emitter.h> | ||
35 | #include <tmp/src/test.h> | ||
36 | |||
37 | template <class T, class U> | ||
38 | using QueuedEmitter = om636::control::Quemitter<T, U>; | ||
39 | |||
40 | int main() | ||
41 | { | ||
42 | using namespace std; | ||
19 | })}; | ||
43 | 20 | ||
44 | check_on<om636::control::Emitter>(); | ||
45 | check_on<QueuedEmitter>(); | ||
21 | emitter.interupt("on"); | ||
22 | emitter.interupt("on"); | ||
23 | emitter.interupt("on"); | ||
24 | emitter.interupt("on"); | ||
46 | 25 | ||
26 | ASSERT(counter == 4 && "on" ); | ||
47 | 27 | return 0; | return 0; |
48 | 28 | } | } |