Subject | Hash | Author | Date (UTC) |
---|---|---|---|
index.h | 205cb1dc1ea3f9b21ec254a72e77fdff6d251acf | Ubuntu | 2020-04-05 14:34:22 |
disable example test | 089829ef81a8ad7a44851081c6bd62f7b19ea3e9 | Ubuntu | 2020-03-30 04:09:17 |
break build with example | 3fc9415f7897964c3a996717877e4b09b5ed8404 | Ubuntu | 2020-03-28 11:08:32 |
working on example | 31bcff3ed50891df5021c3c9f226e49705927e96 | mucbuc | 2020-03-20 03:23:07 |
update readme | eed9ed92196460256a53e6d2fb147ea42550ed6d | mucbuc | 2020-02-24 12:39:08 |
use pragma once | 87760dc750c951c5f1e7438a514ad73036058f6b | mucbuc | 2020-02-17 01:02:08 |
update dynamo/circuit | 8ff53cef8d7573b1a846d699614edacd09e68889 | mucbuc | 2020-02-17 00:59:36 |
update dynamo and circuit | 672bd2e329424816373f463183415e08cb858543 | mucbuc | 2020-02-17 00:52:40 |
format, update | cb54c865eff013e4abb6ef86c54814b52b46257e | mucbuc | 2020-02-14 05:36:21 |
gen docs | c9de816e21d2953c7ac4e73f0be3ccd440c84381 | mucbuc | 2020-02-12 14:13:08 |
rm twice-size | dc7df761559ee90e089ff274290da3628f429a30 | mucbuc | 2020-02-12 13:43:34 |
update libs | 177bc958e60841f894a4c9c4d5758db38e07a5c3 | mucbuc | 2020-02-12 13:22:59 |
once tests | 9aae5bf8c8a46439e7b350c4166c1be22c6028bf | mucbuc | 2020-01-20 20:08:50 |
once | a72a9ea4d78e082b0e4e6a8545af92e116bd7536 | mucbuc | 2020-01-20 17:32:34 |
dynamo | 25b14b6965bb24b21516dde3f4a2a1922d518ae5 | mucbuc | 2020-01-20 17:27:35 |
concurrent test passes | 2bd62976d536c8c81659453e899a2e9c588f4aa6 | mucbuc | 2020-01-20 12:54:46 |
update dynamo | 3315ba6e643d56478aaf05761368d76e9025de79 | mucbuc | 2020-01-20 12:13:05 |
circular update | 7545023e77dcb92f28612a62b6405cb488adddc8 | mucbuc | 2020-01-19 12:09:22 |
cleanup remove stuff | abe9e96601cdfc558823e6d856d16dac8ad15929 | mucbuc | 2020-01-19 11:52:54 |
circut update | 4d75370846cd93032a684b5193494273a9ba9da9 | mucbuc | 2020-01-19 11:50:21 |
File | Lines added | Lines deleted |
---|---|---|
src/emitter_impl.h | 1 | 1 |
src/index.h | 23 | 0 |
test/src/emit_once.cpp | 8 | 9 |
File src/emitter_impl.h changed (mode: 100644) (index a79d6bc..1dcb01f) | |||
11 | 11 | namespace om636 { | namespace om636 { |
12 | 12 | namespace control { | namespace control { |
13 | 13 | template <typename T, typename... U> | template <typename T, typename... U> |
14 | class EmitterImpl : Emitter<T, U...> { | ||
14 | class EmitterImpl : public Emitter<T, U...> { | ||
15 | 15 | public: | public: |
16 | 16 | typedef T event_type; | typedef T event_type; |
17 | 17 | typedef Emitter<event_type, U...> base_type; | typedef Emitter<event_type, U...> base_type; |
File src/index.h added (mode: 100644) (index 0000000..328dab3) | |||
1 | #pragma once | ||
2 | #include <memory> | ||
3 | |||
4 | #include "quemitter_impl.h" | ||
5 | #include "emitter_impl.h" | ||
6 | |||
7 | namespace om636 { | ||
8 | namespace control { | ||
9 | |||
10 | template<typename T, typename ... U> | ||
11 | std::shared_ptr<Emitter<T, U...>> make_Emitter() | ||
12 | { | ||
13 | return std::make_shared<EmitterImpl<T, U...>>(); | ||
14 | } | ||
15 | |||
16 | template<typename T, typename ... U> | ||
17 | std::shared_ptr<Emitter<T, U...>> make_Quemitter() | ||
18 | { | ||
19 | return std::make_shared<QuemitterImpl<T, default_policy, U...>>(); | ||
20 | } | ||
21 | |||
22 | } // control | ||
23 | } // om636 |
File test/src/emit_once.cpp changed (mode: 100644) (index 9df782b..e26ebca) | |||
1 | 1 | #include <tmp/src/test.h> | #include <tmp/src/test.h> |
2 | 2 | ||
3 | 3 | #include <iostream> | #include <iostream> |
4 | #include <lib/ohm/src/emitter_impl.h> | ||
4 | #include <lib/ohm/src/index.h> | ||
5 | 5 | ||
6 | 6 | using namespace std; | using namespace std; |
7 | 7 | using namespace om636; | using namespace om636; |
... | ... | using namespace control; | |
9 | 9 | ||
10 | 10 | int main() | int main() |
11 | 11 | { | { |
12 | typedef EmitterImpl<string, int> emitter_type; | ||
13 | emitter_type e; | ||
12 | auto e = make_Emitter<string, int>(); | ||
14 | 13 | ||
15 | 14 | unsigned counter(0); | unsigned counter(0); |
16 | 15 | ||
17 | auto l(e.once("hello", [&](int) { | ||
16 | auto l(e->once("hello", [&](int) { | ||
18 | 17 | ++counter; | ++counter; |
19 | 18 | })); | })); |
20 | 19 | ||
21 | auto k(e.once("allo", [&](int) { | ||
20 | auto k(e->once("allo", [&](int) { | ||
22 | 21 | ++counter; | ++counter; |
23 | 22 | })); | })); |
24 | 23 | ||
25 | e.interupt("hello", 0); | ||
26 | e.interupt("hello", 0); | ||
27 | e.interupt("allo", 9); | ||
28 | e.interupt("allo", 9); | ||
24 | e->interupt("hello", 0); | ||
25 | e->interupt("hello", 0); | ||
26 | e->interupt("allo", 9); | ||
27 | e->interupt("allo", 9); | ||
29 | 28 | ||
30 | 29 | ASSERT(counter == 2 && "emit once"); | ASSERT(counter == 2 && "emit once"); |
31 | 30 |