Merge lp:~zorba-coders/zorba/builtin-qnames-in-pool-fix into lp:zorba

Proposed by Ghislain Fourny
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10882
Merged at revision: 10884
Proposed branch: lp:~zorba-coders/zorba/builtin-qnames-in-pool-fix
Merge into: lp:zorba
Diff against target: 142 lines (+61/-65)
1 file modified
src/store/naive/store.cpp (+61/-65)
To merge this branch: bzr merge lp:~zorba-coders/zorba/builtin-qnames-in-pool-fix
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Markos Zaharioudakis Approve
Review via email: mp+110805@code.launchpad.net

Commit message

The builtin schema type names, in the store, are now created directly from the pool (this is to prevent a cyclic dependency if another item factory than the simple item factory needs to access the store to produce the QNames, because at this point the store has not been initialized yet).

Description of the change

The builtin schema type names, in the store, are now created directly from the pool (this is to prevent a cyclic dependency if another item factory than the simple item factory needs to access the store to produce the QNames, because at this point the store has not been initialized yet).

To post a comment you must log in.
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 builtin-qnames-in-pool-fix-2012-06-18T12-47-01.732Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 3 Pending.

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

I didn't really understand the reasoning for this change. I guess it's a sausalito thing. But it's ok with the simplestore, so i approve.

review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) :
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 builtin-qnames-in-pool-fix-2012-06-20T17-51-51.668Z 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
1=== modified file 'src/store/naive/store.cpp'
2--- src/store/naive/store.cpp 2012-06-15 21:31:03 +0000
3+++ src/store/naive/store.cpp 2012-06-18 12:46:32 +0000
4@@ -185,77 +185,73 @@
5 void Store::initTypeNames()
6 {
7 const char* ns = XS_URI;
8- BasicItemFactory* f = static_cast<BasicItemFactory*>(theItemFactory);
9
10 theSchemaTypeNames.resize(store::XS_LAST);
11
12 #ifdef ZORBA_WITH_JSON
13- f->createQName(JDM_NULL_QNAME, JDM_URI, "jdm", "null");
14- f->createQName(JDM_OBJECT_QNAME, JDM_URI, "jdm", "object");
15- f->createQName(JDM_ARRAY_QNAME, JDM_URI, "jdm", "array");
16+ JDM_NULL_QNAME = theQNamePool->insert(JDM_URI, "jdm", "null");
17+ JDM_OBJECT_QNAME = theQNamePool->insert(JDM_URI, "jdm", "object");
18+ JDM_ARRAY_QNAME = theQNamePool->insert(JDM_URI, "jdm", "array");
19 #endif
20
21- f->createQName(XS_UNTYPED_QNAME, ns, "xs", "untyped");
22-
23- f->createQName(XS_ANY_QNAME, ns, "xs", "anyType");
24-
25- f->createQName(XS_ANY_SIMPLE_QNAME, ns, "xs", "anySimpleType");
26-
27- f->createQName(theSchemaTypeNames[store::XS_ANY_ATOMIC], ns, "xs", "anyAtomicType");
28-
29- f->createQName(theSchemaTypeNames[store::XS_UNTYPED_ATOMIC], ns, "xs", "untypedAtomic");
30-
31- f->createQName(theSchemaTypeNames[store::XS_ANY_URI], ns, "xs", "anyURI");
32-
33- f->createQName(theSchemaTypeNames[store::XS_QNAME], ns, "xs", "QName");
34-
35- f->createQName(theSchemaTypeNames[store::XS_NOTATION], ns, "xs", "NOTATION");
36-
37- f->createQName(theSchemaTypeNames[store::XS_STRING], ns, "xs", "string");
38- f->createQName(theSchemaTypeNames[store::XS_NORMALIZED_STRING], ns, "xs", "normalizedString");
39- f->createQName(theSchemaTypeNames[store::XS_TOKEN], ns, "xs", "token");
40- f->createQName(theSchemaTypeNames[store::XS_NMTOKEN], ns, "xs", "NMTOKEN");
41- f->createQName(theSchemaTypeNames[store::XS_LANGUAGE], ns, "xs", "language");
42- f->createQName(theSchemaTypeNames[store::XS_NAME], ns, "xs", "Name");
43- f->createQName(theSchemaTypeNames[store::XS_NCNAME], ns, "xs", "NCName");
44- f->createQName(theSchemaTypeNames[store::XS_ID], ns, "xs", "ID");
45- f->createQName(theSchemaTypeNames[store::XS_IDREF], ns, "xs", "IDREF");
46- f->createQName(theSchemaTypeNames[store::XS_ENTITY], ns, "xs", "ENTITY");
47-
48- f->createQName(theSchemaTypeNames[store::XS_DATETIME], ns, "xs", "dateTime");
49- f->createQName(theSchemaTypeNames[store::XS_DATE], ns, "xs", "date");
50- f->createQName(theSchemaTypeNames[store::XS_TIME], ns, "xs", "time");
51- f->createQName(theSchemaTypeNames[store::XS_GYEAR_MONTH], ns, "xs", "gYearMonth");
52- f->createQName(theSchemaTypeNames[store::XS_GYEAR], ns, "xs", "gYear");
53- f->createQName(theSchemaTypeNames[store::XS_GMONTH_DAY], ns, "xs", "gMonthDay");
54- f->createQName(theSchemaTypeNames[store::XS_GDAY], ns, "xs", "gDay");
55- f->createQName(theSchemaTypeNames[store::XS_GMONTH], ns, "xs", "gMonth");
56-
57- f->createQName(theSchemaTypeNames[store::XS_DURATION], ns, "xs", "duration");
58- f->createQName(theSchemaTypeNames[store::XS_DT_DURATION], ns, "xs", "dayTimeDuration");
59- f->createQName(theSchemaTypeNames[store::XS_YM_DURATION], ns, "xs", "yearMonthDuration");
60-
61- f->createQName(theSchemaTypeNames[store::XS_FLOAT], ns, "xs", "float");
62- f->createQName(theSchemaTypeNames[store::XS_DOUBLE], ns, "xs", "double");
63- f->createQName(theSchemaTypeNames[store::XS_DECIMAL], ns, "xs", "decimal");
64- f->createQName(theSchemaTypeNames[store::XS_INTEGER], ns, "xs", "integer");
65- f->createQName(theSchemaTypeNames[store::XS_NON_POSITIVE_INTEGER], ns, "xs", "nonPositiveInteger");
66- f->createQName(theSchemaTypeNames[store::XS_NON_NEGATIVE_INTEGER], ns, "xs", "nonNegativeInteger");
67- f->createQName(theSchemaTypeNames[store::XS_NEGATIVE_INTEGER], ns, "xs", "negativeInteger");
68- f->createQName(theSchemaTypeNames[store::XS_POSITIVE_INTEGER], ns, "xs", "positiveInteger");
69-
70- f->createQName(theSchemaTypeNames[store::XS_LONG], ns, "xs", "long");
71- f->createQName(theSchemaTypeNames[store::XS_INT], ns, "xs", "int");
72- f->createQName(theSchemaTypeNames[store::XS_SHORT], ns, "xs", "short");
73- f->createQName(theSchemaTypeNames[store::XS_BYTE], ns, "xs", "byte");
74- f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_LONG], ns, "xs", "unsignedLong");
75- f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_INT], ns, "xs", "unsignedInt");
76- f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_SHORT], ns, "xs", "unsignedShort");
77- f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_BYTE], ns, "xs", "unsignedByte");
78-
79- f->createQName(theSchemaTypeNames[store::XS_BASE64BINARY], ns, "xs", "base64Binary");
80- f->createQName(theSchemaTypeNames[store::XS_HEXBINARY], ns, "xs", "hexBinary");
81- f->createQName(theSchemaTypeNames[store::XS_BOOLEAN], ns, "xs", "boolean");
82+ XS_UNTYPED_QNAME = theQNamePool->insert(ns, "xs", "untyped");
83+
84+ XS_ANY_QNAME = theQNamePool->insert(ns, "xs", "anyType");
85+
86+ theSchemaTypeNames[store::XS_ANY_ATOMIC] =
87+ theQNamePool->insert(ns, "xs", "anyAtomicType");
88+
89+ theSchemaTypeNames[store::XS_UNTYPED_ATOMIC] =
90+ theQNamePool->insert(ns, "xs", "untypedAtomic");
91+
92+ theSchemaTypeNames[store::XS_ANY_URI] = theQNamePool->insert(ns, "xs", "anyURI");
93+ theSchemaTypeNames[store::XS_QNAME] = theQNamePool->insert(ns, "xs", "QName");
94+ theSchemaTypeNames[store::XS_NOTATION] = theQNamePool->insert(ns, "xs", "NOTATION");
95+ theSchemaTypeNames[store::XS_STRING] = theQNamePool->insert(ns, "xs", "string");
96+ theSchemaTypeNames[store::XS_NORMALIZED_STRING] = theQNamePool->insert(ns, "xs", "normalizedString");
97+ theSchemaTypeNames[store::XS_TOKEN] = theQNamePool->insert(ns, "xs", "token");
98+ theSchemaTypeNames[store::XS_NMTOKEN] = theQNamePool->insert(ns, "xs", "NMTOKEN");
99+ theSchemaTypeNames[store::XS_LANGUAGE] = theQNamePool->insert(ns, "xs", "language");
100+ theSchemaTypeNames[store::XS_NAME] = theQNamePool->insert(ns, "xs", "Name");
101+ theSchemaTypeNames[store::XS_NCNAME] = theQNamePool->insert(ns, "xs", "NCName");
102+ theSchemaTypeNames[store::XS_ID] = theQNamePool->insert(ns, "xs", "ID");
103+ theSchemaTypeNames[store::XS_IDREF] = theQNamePool->insert(ns, "xs", "IDREF");
104+ theSchemaTypeNames[store::XS_ENTITY] = theQNamePool->insert(ns, "xs", "ENTITY");
105+
106+ theSchemaTypeNames[store::XS_DATETIME] = theQNamePool->insert(ns, "xs", "dateTime");
107+ theSchemaTypeNames[store::XS_DATE] = theQNamePool->insert(ns, "xs", "date");
108+ theSchemaTypeNames[store::XS_TIME] = theQNamePool->insert(ns, "xs", "time");
109+ theSchemaTypeNames[store::XS_GYEAR_MONTH] = theQNamePool->insert(ns, "xs", "gYearMonth");
110+ theSchemaTypeNames[store::XS_GYEAR] = theQNamePool->insert(ns, "xs", "gYear");
111+ theSchemaTypeNames[store::XS_GMONTH_DAY] = theQNamePool->insert(ns, "xs", "gMonthDay");
112+ theSchemaTypeNames[store::XS_GDAY] = theQNamePool->insert(ns, "xs", "gDay");
113+ theSchemaTypeNames[store::XS_GMONTH] = theQNamePool->insert(ns, "xs", "gMonth");
114+
115+ theSchemaTypeNames[store::XS_DURATION] = theQNamePool->insert(ns, "xs", "duration");
116+ theSchemaTypeNames[store::XS_DT_DURATION] = theQNamePool->insert(ns, "xs", "dayTimeDuration");
117+ theSchemaTypeNames[store::XS_YM_DURATION] = theQNamePool->insert(ns, "xs", "yearMonthDuration");
118+
119+ theSchemaTypeNames[store::XS_FLOAT] = theQNamePool->insert(ns, "xs", "float");
120+ theSchemaTypeNames[store::XS_DOUBLE] = theQNamePool->insert(ns, "xs", "double");
121+ theSchemaTypeNames[store::XS_DECIMAL] = theQNamePool->insert(ns, "xs", "decimal");
122+ theSchemaTypeNames[store::XS_INTEGER] = theQNamePool->insert(ns, "xs", "integer");
123+ theSchemaTypeNames[store::XS_NON_POSITIVE_INTEGER] = theQNamePool->insert(ns, "xs", "nonPositiveInteger");
124+ theSchemaTypeNames[store::XS_NON_NEGATIVE_INTEGER] = theQNamePool->insert(ns, "xs", "nonNegativeInteger");
125+ theSchemaTypeNames[store::XS_NEGATIVE_INTEGER] = theQNamePool->insert(ns, "xs", "negativeInteger");
126+ theSchemaTypeNames[store::XS_POSITIVE_INTEGER] = theQNamePool->insert(ns, "xs", "positiveInteger");
127+
128+ theSchemaTypeNames[store::XS_LONG] = theQNamePool->insert(ns, "xs", "long");
129+ theSchemaTypeNames[store::XS_INT] = theQNamePool->insert(ns, "xs", "int");
130+ theSchemaTypeNames[store::XS_SHORT] = theQNamePool->insert(ns, "xs", "short");
131+ theSchemaTypeNames[store::XS_BYTE] = theQNamePool->insert(ns, "xs", "byte");
132+ theSchemaTypeNames[store::XS_UNSIGNED_LONG] = theQNamePool->insert(ns, "xs", "unsignedLong");
133+ theSchemaTypeNames[store::XS_UNSIGNED_INT] = theQNamePool->insert(ns, "xs", "unsignedInt");
134+ theSchemaTypeNames[store::XS_UNSIGNED_SHORT] = theQNamePool->insert(ns, "xs", "unsignedShort");
135+ theSchemaTypeNames[store::XS_UNSIGNED_BYTE] = theQNamePool->insert(ns, "xs", "unsignedByte");
136+
137+ theSchemaTypeNames[store::XS_BASE64BINARY] = theQNamePool->insert(ns, "xs", "base64Binary");
138+ theSchemaTypeNames[store::XS_HEXBINARY] = theQNamePool->insert(ns, "xs", "hexBinary");
139+ theSchemaTypeNames[store::XS_BOOLEAN] = theQNamePool->insert(ns, "xs", "boolean");
140
141 for (ulong i = 0; i < store::XS_LAST; ++i)
142 {

Subscribers

People subscribed via source and target branches