List of commits:
Subject Hash Author Date (UTC)
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
dynamoe update 814d85ebb0c03dddfd2d804d404286cc01209687 mucbuc 2020-01-19 06:59:11
simplify interfiace f69d4f7a7c2c02125ac51ffb9d4ba41ed08f8646 mucbuc 2020-01-19 06:41:36
fix another test fd8e7fa14a4daa281e7fbcec875bfe56ce39e400 mucbuc 2020-01-18 22:42:40
working on tests 1b57cbb4e806eda21565dc8bd7e7fe7ff1cb5fff mucbuc 2020-01-18 22:36:15
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
Commit 25b14b6965bb24b21516dde3f4a2a1922d518ae5 - dynamo
Author: mucbuc
Author date (UTC): 2020-01-20 17:27
Committer name: mucbuc
Committer date (UTC): 2020-01-20 17:27
Parent(s): 2bd62976d536c8c81659453e899a2e9c588f4aa6
Signer:
Signing key:
Signing status: N
Tree: 405caec6dd10607f54392a2301e51986af07750f
File Lines added Lines deleted
src/emitter_impl.h 1 0
src/emitter_impl.hxx 7 0
src/interface.h 1 0
test/lib/dynamo/src/impl/batch.h 3 2
test/lib/dynamo/src/impl/batch.hxx 11 20
test/lib/dynamo/src/interface.h 1 1
File src/emitter_impl.h changed (mode: 100644) (index 403b598..9791e3c)
... ... namespace control {
20 20 using typename base_type::listener_type; using typename base_type::listener_type;
21 21
22 22 listener_type on(event_type, callback_type) override; listener_type on(event_type, callback_type) override;
23 listener_type once(event_type, callback_type) override;
23 24 void interupt(event_type, U...) override; void interupt(event_type, U...) override;
24 25
25 26 private: private:
File src/emitter_impl.hxx changed (mode: 100644) (index 3d316ac..cabccd3)
... ... namespace control {
8 8 return m_repeat[e].hook(c); return m_repeat[e].hook(c);
9 9 } }
10 10
11 /////////////////////////////////////////////////////////////////////////////////////
12 template <typename T, typename... U>
13 auto EmitterImpl<T, U...>::once(event_type e, callback_type c) -> listener_type
14 {
15 return m_repeat[e].hook_once(c);
16 }
17
11 18 ///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
12 19 template <typename T, typename... U> template <typename T, typename... U>
13 20 void EmitterImpl<T, U...>::interupt(event_type e, U... arg) void EmitterImpl<T, U...>::interupt(event_type e, U... arg)
File src/interface.h changed (mode: 100644) (index 7dc26fb..9ed84b9)
... ... namespace control {
18 18
19 19 virtual ~Emitter() = default; virtual ~Emitter() = default;
20 20 virtual listener_type on(event_type, callback_type) = 0; virtual listener_type on(event_type, callback_type) = 0;
21 virtual listener_type once(event_type, callback_type) = 0;
21 22 virtual void interupt(event_type, U...) = 0; virtual void interupt(event_type, U...) = 0;
22 23 }; };
23 24
File test/lib/dynamo/src/impl/batch.h changed (mode: 100644) (index f4bf54c..ca98a2f)
... ... namespace control {
19 19
20 20 ~BatchImpl() override = default; ~BatchImpl() override = default;
21 21 agent_type hook(function_type) override; agent_type hook(function_type) override;
22 agent_type hook_once(function_type) override;
22 23 void invoke(T...) override; void invoke(T...) override;
23 void invoke_once(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 circuit::CircuitQueue<pointer_type> batch_type;
26 typedef std::tuple<pointer_type, bool> tuple_type;
27 typedef circuit::CircuitQueue<tuple_type> batch_type;
27 28 batch_type& elements(); batch_type& elements();
28 29 const batch_type& elements() const; const batch_type& elements() const;
29 30
File test/lib/dynamo/src/impl/batch.hxx changed (mode: 100644) (index d2e3af4..3bac54b)
... ... namespace control {
5 5 auto BatchImpl<T...>::hook(function_type callback) -> agent_type auto BatchImpl<T...>::hook(function_type callback) -> agent_type
6 6 { {
7 7 auto agent(std::make_shared<function_type>(callback)); auto agent(std::make_shared<function_type>(callback));
8 m_elements.push(agent);
8 m_elements.push(std::make_tuple<pointer_type, bool>(agent, true));
9 9 return agent; return agent;
10 10 } }
11 11
12 12 ///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
13 13 template <typename... T> template <typename... T>
14 void BatchImpl<T...>::invoke(T... arg)
14 auto BatchImpl<T...>::hook_once(function_type callback) -> agent_type
15 15 { {
16 invoke([this](agent_type s) {
17 elements().push(s);
18 },
19 arg...);
20 }
21
22 /////////////////////////////////////////////////////////////////////////////////////
23 template <typename... T>
24 void BatchImpl<T...>::invoke_once(T... arg)
25 {
26 invoke([](agent_type) {}, arg...);
16 auto agent(std::make_shared<function_type>(callback));
17 m_elements.push(std::make_tuple<pointer_type, bool>(agent, false));
18 return agent;
27 19 } }
28 20
29 21 ///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
30 22 template <typename... T> template <typename... T>
31 template <typename U>
32 void BatchImpl<T...>::invoke(U cb, T... arg)
23 void BatchImpl<T...>::invoke(T... arg)
33 24 { {
34 25 batch_type traverse; batch_type traverse;
35 26 traverse.swap(elements()); traverse.swap(elements());
36 pointer_type agent;
27 tuple_type agent;
37 28 while (traverse.check_pop(agent)) { while (traverse.check_pop(agent)) {
38 agent_type s(agent.lock());
29 agent_type s(std::get<0>(agent).lock());
39 30 if (s) { if (s) {
40 31 (*s)(arg...); (*s)(arg...);
41 32 } }
42 s = agent.lock();
43 if (s) {
44 cb(s);
33 s = std::get<0>(agent).lock();
34 if (s && std::get<1>(agent)) {
35 elements().push(std::move(agent));
45 36 } }
46 37 } }
47 38 } }
File test/lib/dynamo/src/interface.h changed (mode: 100644) (index d8deeeb..7c7a13a)
... ... namespace control {
15 15
16 16 virtual ~Batch() = default; virtual ~Batch() = default;
17 17 virtual agent_type hook(function_type) = 0; virtual agent_type hook(function_type) = 0;
18 virtual agent_type hook_once(function_type) = 0;
18 19 virtual void invoke(T...) = 0; virtual void invoke(T...) = 0;
19 virtual void invoke_once(T...) = 0;
20 20 }; };
21 21
22 22 } // control } // control
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mucbuc/ohm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mucbuc/ohm

Clone this repository using git:
git clone git://git.rocketgit.com/user/mucbuc/ohm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main