Subject | Hash | Author | Date (UTC) |
---|---|---|---|
format source | 0288bc49240445da1dd0013feb6e2d157d8a5cea | mucbuc | 2020-02-13 14:35:16 |
example builds | 701303d8c13b423195f3f0e43c8e5d26af5360c8 | mucbuc | 2020-02-13 14:33:01 |
circuit update | 6b334746c8f61dbeb8707a9045b83d01ce7259de | mucbuc | 2020-02-12 13:36:57 |
interface | 8aaad13bc18270477139d6144771cebdba2928d6 | mucbuc | 2020-01-23 05:38:16 |
hook_once | e800fa98f37b99f456e0f474d2a95eac87dbe020 | mucbuc | 2020-01-20 17:22:05 |
twice_size => circuit | 07e34c75c67aa4ccaed56d26357bb29f75914005 | mucbuc | 2020-01-20 12:09:43 |
reset agent and check before callback | 9ce516c3b921eb0e853b17119a4960fdf3936dcf | mucbuc | 2020-01-19 06:57:31 |
include statement | 2c33dfbb947f7aafd05413b78dea3a0c036cf91b | mucbuc | 2020-01-17 10:29:01 |
formating | 99ddddbf993037c4bdc573c149b28db242ac0862 | mucbuc | 2020-01-17 05:30:56 |
invoke_once | b6ee37d690063e31b0300fdef0319d26293f0532 | mucbuc | 2020-01-17 05:29:52 |
remove agent | 31359a9da855067033433f4310d172dadc813f28 | mucbuc | 2020-01-16 12:55:13 |
formati | 13721c73e8d359eab3f32a030a35a42b83a341f0 | mucbuc | 2020-01-16 12:40:00 |
fix tests | 343e081bf929c31592f835b279e5e4cd2c149539 | mucbuc | 2020-01-16 12:37:58 |
strip interface | 991fc85aa55fc6f1d08fe94673840c14f2087ea8 | mucbuc | 2020-01-16 05:44:55 |
*break* circuit poc | 26840f5e3ecca09bc113cb42fff5275c9213e0ae | mucbuc | 2020-01-14 11:32:23 |
add circuit | 0cc2be277c7c0bdd4026e056292cc2d6f4150195 | mucbuc | 2020-01-14 11:30:23 |
formating | d0c058639d2aec3f3e8f94da64e03e316d1c0914 | mucbuc | 2020-01-14 11:04:33 |
documentation | f9e40f305cb18e274187ca4a6d5337d074d1ff30 | mucbuc | 2020-01-12 15:38:09 |
fixed test | ea8fe3cc68d22f66233227333ca7e5e5ba5bf61b | Ubuntu | 2020-01-05 10:03:01 |
fix test | 3000b9771071dad410993acf8a3fca2cae11c47b | Ubuntu | 2019-12-29 14:41:59 |
File | Lines added | Lines deleted |
---|---|---|
package.json | 2 | 1 |
src/dynamofwd.h | 2 | 2 |
src/factory.h | 8 | 11 |
src/impl/batch.h | 1 | 1 |
src/impl/batch.hxx | 3 | 3 |
test/src/example.cpp | 9 | 9 |
File package.json changed (mode: 100644) (index d8a7cde..fc0162e) | |||
3 | 3 | "name":"dynamo", | "name":"dynamo", |
4 | 4 | "scripts": { | "scripts": { |
5 | 5 | "test": "crimp test/test.json -g", | "test": "crimp test/test.json -g", |
6 | "generateDocs":"doc-tool package_header src_interface ./EXAMPLE.md > README.md" | ||
6 | "generateDocs":"doc-tool package_header src_interface ./EXAMPLE.md > README.md", | ||
7 | "format": "clang-format -i --style=Webkit src/*.h src/impl/*.h src/impl/*.hxx test/src/*.cpp" | ||
7 | 8 | } | } |
8 | 9 | } | } |
File src/dynamofwd.h changed (mode: 100644) (index 88057a0..402d909) | |||
2 | 2 | ||
3 | 3 | namespace om636 { | namespace om636 { |
4 | 4 | namespace control { | namespace control { |
5 | template <typename ...> | ||
5 | template <typename...> | ||
6 | 6 | struct Agent; | struct Agent; |
7 | 7 | ||
8 | template <typename ...> | ||
8 | template <typename...> | ||
9 | 9 | struct Batch; | struct Batch; |
10 | 10 | } | } |
11 | 11 | } | } |
File src/factory.h changed (mode: 100644) (index 5cf722d..fd13097) | |||
2 | 2 | ||
3 | 3 | #include "impl/batch.h" | #include "impl/batch.h" |
4 | 4 | ||
5 | namespace om636 | ||
6 | { | ||
5 | namespace om636 { | ||
7 | 6 | ||
8 | namespace control | ||
9 | { | ||
10 | |||
11 | template<typename ... T> | ||
12 | std::shared_ptr<BatchImpl<T ...>> make_batch() | ||
13 | { | ||
14 | return std::make_shared<BatchImpl<T ...>>(); | ||
15 | } | ||
7 | namespace control { | ||
16 | 8 | ||
17 | } | ||
9 | template <typename... T> | ||
10 | std::shared_ptr<BatchImpl<T...>> make_batch() | ||
11 | { | ||
12 | return std::make_shared<BatchImpl<T...>>(); | ||
13 | } | ||
18 | 14 | ||
19 | 15 | } | } |
20 | 16 | ||
17 | } |
File src/impl/batch.h changed (mode: 100644) (index ca98a2f..986d903) | |||
... | ... | namespace control { | |
23 | 23 | void invoke(T...) override; | void invoke(T...) override; |
24 | 24 | ||
25 | 25 | typedef std::weak_ptr<typename agent_type::element_type> pointer_type; | typedef std::weak_ptr<typename agent_type::element_type> pointer_type; |
26 | typedef std::tuple<pointer_type, bool> tuple_type; | ||
26 | typedef std::tuple<pointer_type, bool> tuple_type; | ||
27 | 27 | typedef circuit::CircuitQueue<tuple_type> batch_type; | typedef circuit::CircuitQueue<tuple_type> batch_type; |
28 | 28 | batch_type& elements(); | batch_type& elements(); |
29 | 29 | const batch_type& elements() const; | const batch_type& elements() const; |
File src/impl/batch.hxx changed (mode: 100644) (index 3bac54b..39bd122) | |||
... | ... | namespace control { | |
29 | 29 | agent_type s(std::get<0>(agent).lock()); | agent_type s(std::get<0>(agent).lock()); |
30 | 30 | if (s) { | if (s) { |
31 | 31 | (*s)(arg...); | (*s)(arg...); |
32 | } | ||
33 | s = std::get<0>(agent).lock(); | ||
34 | if (s && std::get<1>(agent)) { | ||
32 | } | ||
33 | s = std::get<0>(agent).lock(); | ||
34 | if (s && std::get<1>(agent)) { | ||
35 | 35 | elements().push(std::move(agent)); | elements().push(std::move(agent)); |
36 | 36 | } | } |
37 | 37 | } | } |
File test/src/example.cpp changed (mode: 100644) (index 0c9b522..f939609) | |||
1 | 1 | #include <tmp/src/test.h> | #include <tmp/src/test.h> |
2 | 2 | ||
3 | #include <lib/dynamo/src/interface.h> | ||
4 | 3 | #include <lib/dynamo/src/factory.h> | #include <lib/dynamo/src/factory.h> |
4 | #include <lib/dynamo/src/interface.h> | ||
5 | 5 | ||
6 | 6 | int main() | int main() |
7 | 7 | { | { |
8 | auto b = om636::control::make_batch<int>(); | ||
9 | |||
10 | int sum { 0 }; | ||
11 | |||
12 | auto q = b->hook([&](int i){ sum += i; }); | ||
13 | auto p = b->hook([&](int i){ sum *= i; }); | ||
14 | b->invoke(5); | ||
15 | return sum == 25; | ||
8 | auto b = om636::control::make_batch<int>(); | ||
9 | |||
10 | int sum { 0 }; | ||
11 | |||
12 | auto q = b->hook([&](int i) { sum += i; }); | ||
13 | auto p = b->hook([&](int i) { sum *= i; }); | ||
14 | b->invoke(5); | ||
15 | return sum == 25; | ||
16 | 16 | } | } |