Merge lp:~zorba-coders/zorba/collection-claim-tree-ownership into lp:zorba

Proposed by Ghislain Fourny
Status: Merged
Approved by: Till Westmann
Approved revision: 10727
Merged at revision: 10727
Proposed branch: lp:~zorba-coders/zorba/collection-claim-tree-ownership
Merge into: lp:zorba
Diff against target: 78 lines (+27/-1)
4 files modified
src/store/naive/collection.cpp (+5/-0)
src/store/naive/collection.h (+4/-0)
src/store/naive/node_items.cpp (+10/-0)
src/store/naive/node_items.h (+8/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/collection-claim-tree-ownership
Reviewer Review Type Date Requested Status
Till Westmann Approve
Matthias Brantner Approve
Review via email: mp+98419@code.launchpad.net

Commit message

Collections can claim ownership of a node they own but that does not have the pointer.

Description of the change

Collections can claim ownership of a node they own but that does not have the pointer.

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

No approved revision specified.

10727. By Ghislain Fourny

claimOwnership is now protected.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Till Westmann (tillw) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job collection-claim-tree-ownership-2012-03-20T16-13-02.165Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/store/naive/collection.cpp'
--- src/store/naive/collection.cpp 2012-03-01 14:22:17 +0000
+++ src/store/naive/collection.cpp 2012-03-20 14:26:18 +0000
@@ -26,6 +26,11 @@
26namespace zorba {26namespace zorba {
27namespace simplestore {27namespace simplestore {
2828
29void Collection::claimOwnership(zorba::simplestore::XmlTree* aTree)
30{
31 aTree->claimedByCollection(this);
32}
33
29void Collection::getIndexes(34void Collection::getIndexes(
30 const store::Item* name,35 const store::Item* name,
31 std::vector<store::Index*>& indexes)36 std::vector<store::Index*>& indexes)
3237
=== modified file 'src/store/naive/collection.h'
--- src/store/naive/collection.h 2012-03-08 18:51:25 +0000
+++ src/store/naive/collection.h 2012-03-20 14:26:18 +0000
@@ -110,6 +110,10 @@
110110
111 void getActiveICs(std::vector<store::IC*>& ics);111 void getActiveICs(std::vector<store::IC*>& ics);
112112
113 /**************************** Claim of ownership ****************************/
114protected:
115 virtual void claimOwnership(zorba::simplestore::XmlTree* aTree);
116
113}; /* class Collection */117}; /* class Collection */
114118
115} /* namespace simplestore */ } /* namespace zorba */119} /* namespace simplestore */ } /* namespace zorba */
116120
=== modified file 'src/store/naive/node_items.cpp'
--- src/store/naive/node_items.cpp 2012-03-14 15:28:15 +0000
+++ src/store/naive/node_items.cpp 2012-03-20 14:26:18 +0000
@@ -105,6 +105,16 @@
105/*******************************************************************************105/*******************************************************************************
106106
107********************************************************************************/107********************************************************************************/
108void XmlTree::claimedByCollection(Collection* collection)
109{
110 ZORBA_ASSERT(collection != NULL);
111 theCollection = collection;
112}
113
114
115/*******************************************************************************
116
117********************************************************************************/
108void XmlTree::setCollection(Collection* collection, xs_integer pos)118void XmlTree::setCollection(Collection* collection, xs_integer pos)
109{119{
110 ZORBA_ASSERT(collection == NULL || theCollection == NULL);120 ZORBA_ASSERT(collection == NULL || theCollection == NULL);
111121
=== modified file 'src/store/naive/node_items.h'
--- src/store/naive/node_items.h 2012-03-15 15:30:19 +0000
+++ src/store/naive/node_items.h 2012-03-20 14:26:18 +0000
@@ -180,7 +180,7 @@
180 ulong theId;180 ulong theId;
181 xs_integer thePos;181 xs_integer thePos;
182182
183 Collection * theCollection;183 Collection * theCollection;
184184
185 XmlNode * theRootNode;185 XmlNode * theRootNode;
186186
@@ -223,6 +223,13 @@
223223
224 const Collection* getCollection() const { return theCollection; }224 const Collection* getCollection() const { return theCollection; }
225225
226private:
227friend class zorba::simplestore::Collection;
228 // Allows a collection to claim ownership of a node it already owns, but
229 // which does not have the backpointer yet.
230 void claimedByCollection(Collection* coll);
231
232public:
226 void setCollection(Collection* coll, xs_integer pos);233 void setCollection(Collection* coll, xs_integer pos);
227234
228 void setPosition(xs_integer pos) { thePos = pos; }235 void setPosition(xs_integer pos) { thePos = pos; }

Subscribers

People subscribed via source and target branches