Subject | Hash | Author | Date (UTC) |
---|---|---|---|
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 |
cleanup | 0403bb7332d11797467282d58735cefb518e8407 | mucbuc | 2019-11-12 05:13:03 |
rm emitter | 55ae1aa2ce377d75e47d18a2ed29b44b7e24f93f | mucbuc | 2019-11-12 04:49:21 |
File | Lines added | Lines deleted |
---|---|---|
test/agent_life_time.json | 0 | 9 |
test/src/agent_life_time.cpp | 0 | 92 |
test/tests.json | 0 | 1 |
File test/agent_life_time.json deleted (index 1892553..0000000) | |||
1 | { | ||
2 | "include":[ | ||
3 | "lib/ohm/ohm.json" | ||
4 | ], | ||
5 | "sources": [ | ||
6 | "src/agent_life_time.cpp", | ||
7 | "src/emitter_fwd.h" | ||
8 | ] | ||
9 | } |
File test/src/agent_life_time.cpp deleted (index 44488da..0000000) | |||
1 | #include <iostream> | ||
2 | #include <vector> | ||
3 | |||
4 | #include <tmp/src/test.h> | ||
5 | #include <lib/ohm/src/emitter_impl.h> | ||
6 | |||
7 | using namespace std; | ||
8 | using namespace om636; | ||
9 | |||
10 | int main() | ||
11 | { | ||
12 | struct dummy_callback { | ||
13 | dummy_callback() | ||
14 | { | ||
15 | ++instance_counter(); | ||
16 | } | ||
17 | |||
18 | dummy_callback(const dummy_callback&) | ||
19 | : dummy_callback() | ||
20 | { | ||
21 | } | ||
22 | |||
23 | ~dummy_callback() | ||
24 | { | ||
25 | --instance_counter(); | ||
26 | } | ||
27 | |||
28 | dummy_callback& operator=(const dummy_callback&) = default; | ||
29 | |||
30 | static size_t& instance_counter() | ||
31 | { | ||
32 | static size_t counter(0); | ||
33 | return counter; | ||
34 | } | ||
35 | }; | ||
36 | |||
37 | static string event("init"); | ||
38 | typedef om636::control::EmitterImpl<string, dummy_callback> emitter_type; | ||
39 | typedef typename emitter_type::listener_type listener_type; | ||
40 | emitter_type emitter; | ||
41 | |||
42 | if (1) { | ||
43 | auto listener(emitter.on(event, [](){})); | ||
44 | emitter.removeListeners(event); | ||
45 | |||
46 | // this reference is owned by the listener | ||
47 | ASSERT(dummy_callback::instance_counter() == 1); | ||
48 | } | ||
49 | ASSERT(!dummy_callback::instance_counter()); | ||
50 | |||
51 | if (1) { | ||
52 | auto listener(emitter.on(event, dummy_callback())); | ||
53 | emitter.removeAllListeners(); | ||
54 | |||
55 | // this reference is owned by the listener | ||
56 | ASSERT(dummy_callback::instance_counter() == 1); | ||
57 | } | ||
58 | ASSERT(!dummy_callback::instance_counter()); | ||
59 | |||
60 | if (1) { | ||
61 | listener_type listener; | ||
62 | if (1) { | ||
63 | auto temp(emitter.on(event, dummy_callback())); | ||
64 | ASSERT(dummy_callback::instance_counter() == 1); | ||
65 | |||
66 | listener = temp; | ||
67 | |||
68 | ASSERT(dummy_callback::instance_counter() == 1); | ||
69 | } | ||
70 | |||
71 | // this reference is owned by the emitter | ||
72 | ASSERT(dummy_callback::instance_counter() == 1); | ||
73 | } | ||
74 | |||
75 | emitter.removeListeners(event); | ||
76 | ASSERT(!dummy_callback::instance_counter()); | ||
77 | |||
78 | FOOTER; | ||
79 | } | ||
80 | |||
81 | template <class T, class U> | ||
82 | using QueuedEmitter = om636::control::Quemitter<T, U>; | ||
83 | |||
84 | int main() | ||
85 | { | ||
86 | using namespace std; | ||
87 | |||
88 | check_agent_life_time<om636::control::EmitterImpl>(); | ||
89 | // check_agent_life_time<QueuedEmitter>(); | ||
90 | |||
91 | return 0; | ||
92 | } |
File test/tests.json changed (mode: 100644) (index 87033dd..984c27a) | |||
1 | 1 | { | { |
2 | 2 | "tests":[ | "tests":[ |
3 | 3 | "concurrent.json", | "concurrent.json", |
4 | "agent_life_time.json", | ||
5 | 4 | "emit_once.json", | "emit_once.json", |
6 | 5 | "dispatch_logic.json", | "dispatch_logic.json", |
7 | 6 | "emit_while_emit.json", | "emit_while_emit.json", |