List of commits:
Subject Hash Author Date (UTC)
test for dead object removal 293a4ecb0c1b37e3f6de4c382c544f858e591b5d Ubuntu 2019-12-24 12:22:51
listener type 17dbf951b9f1c9d5597eec229bbb1493b7b7f9c0 Ubuntu 2019-12-24 11:50:57
impl folder 40a4b7b8898954a4c23ccbaa89e6f8b153a7aa7f Ubuntu 2019-12-24 07:28:25
formating 8a22c8b92ed52f7bc93856da8a724152e28d0a42 Ubuntu 2019-12-24 06:48:42
cleanup 30d1d919695bd75eefaf87fc946b94de78a67d60 Ubuntu 2019-12-24 06:46:23
dynamofwd 5b9c10a5c20ed27bccd2799f1695840aebb1d671 mucbuc 2019-12-24 02:33:38
cleanup 749066255127ffde23d8fda529764687252a29c3 Ubuntu 2019-12-23 13:46:37
more cleanup 828ab3c6685b28185f5cf300a8fb00c6d5e2427a Ubuntu 2019-12-23 05:53:18
cleanup d4a0e241f80849385bca4323ce28a38788bd03aa Ubuntu 2019-12-23 05:49:59
abstraction complete 210e60e6a600a1a1565a5eba52c9cceb7fc2d108 Ubuntu 2019-12-23 05:48:13
batch is now abstract 681a77dad6a0af7d2b053bdb1f24eda94158828d Ubuntu 2019-12-23 04:23:05
some cleanup 67af884f30b760e6dfeb16866faf180c2f419f3e mucbuc 2019-12-23 02:37:58
tests passing 227d2a97ddcc62abf13835ff77ed2abb55e304ee mucbuc 2019-12-22 21:32:38
some cleanup 32f6958b242ade546d396db1ad593b1b1e864533 mucbuc 2019-12-22 20:02:55
agent 8714f1b8e69d8037fb634fefefa2166cc0d73cc8 mucbuc 2019-12-22 19:56:03
shared_agent b647e38e4bb58096f6c58756dfa2718cacc30e64 mucbuc 2019-12-22 18:56:17
fix compile time error fbc1c35e2389d9fffebe94808385ded809b4061a mucbuc 2019-11-03 00:30:41
cleanup template stuff 4ebc0945d2e8cf2c7a1f75d3dab125b83f76078d mucbuc 2019-11-02 21:09:51
more cleanup bfbe00170ae67ea7e8e1cb23e4e352b18188b5a9 mucbuc 2019-11-02 21:01:10
delete explicit template stuff 1a43665b79bb3df8e28cb7be2d460cbec6cd6a0f mucbuc 2019-11-02 20:55:26
Commit 293a4ecb0c1b37e3f6de4c382c544f858e591b5d - test for dead object removal
Author: Ubuntu
Author date (UTC): 2019-12-24 12:22
Committer name: Ubuntu
Committer date (UTC): 2019-12-24 12:22
Parent(s): 17dbf951b9f1c9d5597eec229bbb1493b7b7f9c0
Signer:
Signing key:
Signing status: N
Tree: d578874e0e0d67f16a4cd821b5e587019b6360b4
File Lines added Lines deleted
src/impl/batch.h 2 2
src/impl/batch.hxx 11 9
test/src/batch.h 12 0
test/src/main.cpp 1 1
File src/impl/batch.h changed (mode: 100644) (index f467d06..d11a7d8)
... ... namespace control {
22 22 void kill_invoke(T...) override; void kill_invoke(T...) override;
23 23 void kill() override; void kill() override;
24 24
25 private:
26 25 typedef std::weak_ptr<typename agent_type::element_type> pointer_type; typedef std::weak_ptr<typename agent_type::element_type> pointer_type;
27 26 typedef std::vector<pointer_type> batch_type; typedef std::vector<pointer_type> batch_type;
28 27 batch_type& elements(); batch_type& elements();
29 28 const batch_type& elements() const; const batch_type& elements() const;
30 void merge_added_elements();
31 29
30 private:
31 void merge_added_elements();
32 32 batch_type m_elements; batch_type m_elements;
33 33 batch_type m_elements_add; batch_type m_elements_add;
34 34 }; };
File src/impl/batch.hxx changed (mode: 100644) (index 09402c4..9295163)
... ... namespace control {
64 64 void process(T& elements, V... v) void process(T& elements, V... v)
65 65 { {
66 66 T copy(elements); T copy(elements);
67 for_each(copy.begin(), copy.end(), [&](typename T::value_type p) {
68 auto s(p.lock());
67 for(auto i = copy.begin(); i != copy.end(); ++i)
68 {
69 auto s(i->lock());
69 70 if (s) if (s)
70 71 s->invoke(v...); s->invoke(v...);
71 //else
72 //elements.erase(p);
73 });
72 else
73 elements.erase(i);
74 }
74 75 } }
75 76
76 77 ///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
 
... ... namespace control {
78 79 void process_and_kill(T& elements, V... v) void process_and_kill(T& elements, V... v)
79 80 { {
80 81 T copy(elements); T copy(elements);
81 for_each(copy.begin(), copy.end(), [&](typename T::value_type p) {
82 auto s(p.lock());
82 elements.clear();
83 for(auto i = copy.begin(); i != copy.end(); ++i)
84 {
85 auto s(i->lock());
83 86 if (s) if (s)
84 87 s->kill_invoke(v...); s->kill_invoke(v...);
85 });
86 elements.clear();
88 }
87 89 } }
88 90
89 91 ///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
File test/src/batch.h changed (mode: 100644) (index c3e789e..dab2db9)
... ... using namespace om636;
2 2 using namespace std; using namespace std;
3 3
4 4 typedef control::BatchImpl<> batch_type; typedef control::BatchImpl<> batch_type;
5 void dead_agent_removal()
6 {
7 typedef control::BatchImpl<int> batch_type;
8 batch_type batch;
9
10 batch.hook([&](int i) {
11 });
12
13 batch.invoke(9);
14
15 ASSERT(batch.elements().empty() && "dead agent removal");
16 }
5 17
6 18 void check_traverse_with_arg() void check_traverse_with_arg()
7 19 { {
File test/src/main.cpp changed (mode: 100644) (index a7ace12..def6979)
... ... int main(int argc, const char* argv[])
13 13 //check_traverse_while_traverse(); //check_traverse_while_traverse();
14 14 check_traverse_with_arg(); check_traverse_with_arg();
15 15 check_traverse_with_args(); check_traverse_with_args();
16
16 dead_agent_removal();
17 17 return 0; return 0;
18 18 } }
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/dynamo

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

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

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