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
=== modified file 'src/store/naive/store.cpp'
--- src/store/naive/store.cpp 2012-06-15 21:31:03 +0000
+++ src/store/naive/store.cpp 2012-06-18 12:46:32 +0000
@@ -185,77 +185,73 @@
185void Store::initTypeNames()185void Store::initTypeNames()
186{186{
187 const char* ns = XS_URI;187 const char* ns = XS_URI;
188 BasicItemFactory* f = static_cast<BasicItemFactory*>(theItemFactory);
189188
190 theSchemaTypeNames.resize(store::XS_LAST);189 theSchemaTypeNames.resize(store::XS_LAST);
191190
192#ifdef ZORBA_WITH_JSON191#ifdef ZORBA_WITH_JSON
193 f->createQName(JDM_NULL_QNAME, JDM_URI, "jdm", "null");192 JDM_NULL_QNAME = theQNamePool->insert(JDM_URI, "jdm", "null");
194 f->createQName(JDM_OBJECT_QNAME, JDM_URI, "jdm", "object");193 JDM_OBJECT_QNAME = theQNamePool->insert(JDM_URI, "jdm", "object");
195 f->createQName(JDM_ARRAY_QNAME, JDM_URI, "jdm", "array");194 JDM_ARRAY_QNAME = theQNamePool->insert(JDM_URI, "jdm", "array");
196#endif195#endif
197196
198 f->createQName(XS_UNTYPED_QNAME, ns, "xs", "untyped");197 XS_UNTYPED_QNAME = theQNamePool->insert(ns, "xs", "untyped");
199198
200 f->createQName(XS_ANY_QNAME, ns, "xs", "anyType");199 XS_ANY_QNAME = theQNamePool->insert(ns, "xs", "anyType");
201200
202 f->createQName(XS_ANY_SIMPLE_QNAME, ns, "xs", "anySimpleType");201 theSchemaTypeNames[store::XS_ANY_ATOMIC] =
203202 theQNamePool->insert(ns, "xs", "anyAtomicType");
204 f->createQName(theSchemaTypeNames[store::XS_ANY_ATOMIC], ns, "xs", "anyAtomicType");203
205204 theSchemaTypeNames[store::XS_UNTYPED_ATOMIC] =
206 f->createQName(theSchemaTypeNames[store::XS_UNTYPED_ATOMIC], ns, "xs", "untypedAtomic");205 theQNamePool->insert(ns, "xs", "untypedAtomic");
207206
208 f->createQName(theSchemaTypeNames[store::XS_ANY_URI], ns, "xs", "anyURI");207 theSchemaTypeNames[store::XS_ANY_URI] = theQNamePool->insert(ns, "xs", "anyURI");
209208 theSchemaTypeNames[store::XS_QNAME] = theQNamePool->insert(ns, "xs", "QName");
210 f->createQName(theSchemaTypeNames[store::XS_QNAME], ns, "xs", "QName");209 theSchemaTypeNames[store::XS_NOTATION] = theQNamePool->insert(ns, "xs", "NOTATION");
211210 theSchemaTypeNames[store::XS_STRING] = theQNamePool->insert(ns, "xs", "string");
212 f->createQName(theSchemaTypeNames[store::XS_NOTATION], ns, "xs", "NOTATION");211 theSchemaTypeNames[store::XS_NORMALIZED_STRING] = theQNamePool->insert(ns, "xs", "normalizedString");
213212 theSchemaTypeNames[store::XS_TOKEN] = theQNamePool->insert(ns, "xs", "token");
214 f->createQName(theSchemaTypeNames[store::XS_STRING], ns, "xs", "string");213 theSchemaTypeNames[store::XS_NMTOKEN] = theQNamePool->insert(ns, "xs", "NMTOKEN");
215 f->createQName(theSchemaTypeNames[store::XS_NORMALIZED_STRING], ns, "xs", "normalizedString");214 theSchemaTypeNames[store::XS_LANGUAGE] = theQNamePool->insert(ns, "xs", "language");
216 f->createQName(theSchemaTypeNames[store::XS_TOKEN], ns, "xs", "token");215 theSchemaTypeNames[store::XS_NAME] = theQNamePool->insert(ns, "xs", "Name");
217 f->createQName(theSchemaTypeNames[store::XS_NMTOKEN], ns, "xs", "NMTOKEN");216 theSchemaTypeNames[store::XS_NCNAME] = theQNamePool->insert(ns, "xs", "NCName");
218 f->createQName(theSchemaTypeNames[store::XS_LANGUAGE], ns, "xs", "language");217 theSchemaTypeNames[store::XS_ID] = theQNamePool->insert(ns, "xs", "ID");
219 f->createQName(theSchemaTypeNames[store::XS_NAME], ns, "xs", "Name");218 theSchemaTypeNames[store::XS_IDREF] = theQNamePool->insert(ns, "xs", "IDREF");
220 f->createQName(theSchemaTypeNames[store::XS_NCNAME], ns, "xs", "NCName");219 theSchemaTypeNames[store::XS_ENTITY] = theQNamePool->insert(ns, "xs", "ENTITY");
221 f->createQName(theSchemaTypeNames[store::XS_ID], ns, "xs", "ID");220
222 f->createQName(theSchemaTypeNames[store::XS_IDREF], ns, "xs", "IDREF");221 theSchemaTypeNames[store::XS_DATETIME] = theQNamePool->insert(ns, "xs", "dateTime");
223 f->createQName(theSchemaTypeNames[store::XS_ENTITY], ns, "xs", "ENTITY");222 theSchemaTypeNames[store::XS_DATE] = theQNamePool->insert(ns, "xs", "date");
224223 theSchemaTypeNames[store::XS_TIME] = theQNamePool->insert(ns, "xs", "time");
225 f->createQName(theSchemaTypeNames[store::XS_DATETIME], ns, "xs", "dateTime");224 theSchemaTypeNames[store::XS_GYEAR_MONTH] = theQNamePool->insert(ns, "xs", "gYearMonth");
226 f->createQName(theSchemaTypeNames[store::XS_DATE], ns, "xs", "date");225 theSchemaTypeNames[store::XS_GYEAR] = theQNamePool->insert(ns, "xs", "gYear");
227 f->createQName(theSchemaTypeNames[store::XS_TIME], ns, "xs", "time");226 theSchemaTypeNames[store::XS_GMONTH_DAY] = theQNamePool->insert(ns, "xs", "gMonthDay");
228 f->createQName(theSchemaTypeNames[store::XS_GYEAR_MONTH], ns, "xs", "gYearMonth");227 theSchemaTypeNames[store::XS_GDAY] = theQNamePool->insert(ns, "xs", "gDay");
229 f->createQName(theSchemaTypeNames[store::XS_GYEAR], ns, "xs", "gYear");228 theSchemaTypeNames[store::XS_GMONTH] = theQNamePool->insert(ns, "xs", "gMonth");
230 f->createQName(theSchemaTypeNames[store::XS_GMONTH_DAY], ns, "xs", "gMonthDay");229
231 f->createQName(theSchemaTypeNames[store::XS_GDAY], ns, "xs", "gDay");230 theSchemaTypeNames[store::XS_DURATION] = theQNamePool->insert(ns, "xs", "duration");
232 f->createQName(theSchemaTypeNames[store::XS_GMONTH], ns, "xs", "gMonth");231 theSchemaTypeNames[store::XS_DT_DURATION] = theQNamePool->insert(ns, "xs", "dayTimeDuration");
233232 theSchemaTypeNames[store::XS_YM_DURATION] = theQNamePool->insert(ns, "xs", "yearMonthDuration");
234 f->createQName(theSchemaTypeNames[store::XS_DURATION], ns, "xs", "duration");233
235 f->createQName(theSchemaTypeNames[store::XS_DT_DURATION], ns, "xs", "dayTimeDuration");234 theSchemaTypeNames[store::XS_FLOAT] = theQNamePool->insert(ns, "xs", "float");
236 f->createQName(theSchemaTypeNames[store::XS_YM_DURATION], ns, "xs", "yearMonthDuration");235 theSchemaTypeNames[store::XS_DOUBLE] = theQNamePool->insert(ns, "xs", "double");
237236 theSchemaTypeNames[store::XS_DECIMAL] = theQNamePool->insert(ns, "xs", "decimal");
238 f->createQName(theSchemaTypeNames[store::XS_FLOAT], ns, "xs", "float");237 theSchemaTypeNames[store::XS_INTEGER] = theQNamePool->insert(ns, "xs", "integer");
239 f->createQName(theSchemaTypeNames[store::XS_DOUBLE], ns, "xs", "double");238 theSchemaTypeNames[store::XS_NON_POSITIVE_INTEGER] = theQNamePool->insert(ns, "xs", "nonPositiveInteger");
240 f->createQName(theSchemaTypeNames[store::XS_DECIMAL], ns, "xs", "decimal");239 theSchemaTypeNames[store::XS_NON_NEGATIVE_INTEGER] = theQNamePool->insert(ns, "xs", "nonNegativeInteger");
241 f->createQName(theSchemaTypeNames[store::XS_INTEGER], ns, "xs", "integer");240 theSchemaTypeNames[store::XS_NEGATIVE_INTEGER] = theQNamePool->insert(ns, "xs", "negativeInteger");
242 f->createQName(theSchemaTypeNames[store::XS_NON_POSITIVE_INTEGER], ns, "xs", "nonPositiveInteger");241 theSchemaTypeNames[store::XS_POSITIVE_INTEGER] = theQNamePool->insert(ns, "xs", "positiveInteger");
243 f->createQName(theSchemaTypeNames[store::XS_NON_NEGATIVE_INTEGER], ns, "xs", "nonNegativeInteger");242
244 f->createQName(theSchemaTypeNames[store::XS_NEGATIVE_INTEGER], ns, "xs", "negativeInteger");243 theSchemaTypeNames[store::XS_LONG] = theQNamePool->insert(ns, "xs", "long");
245 f->createQName(theSchemaTypeNames[store::XS_POSITIVE_INTEGER], ns, "xs", "positiveInteger");244 theSchemaTypeNames[store::XS_INT] = theQNamePool->insert(ns, "xs", "int");
246245 theSchemaTypeNames[store::XS_SHORT] = theQNamePool->insert(ns, "xs", "short");
247 f->createQName(theSchemaTypeNames[store::XS_LONG], ns, "xs", "long");246 theSchemaTypeNames[store::XS_BYTE] = theQNamePool->insert(ns, "xs", "byte");
248 f->createQName(theSchemaTypeNames[store::XS_INT], ns, "xs", "int");247 theSchemaTypeNames[store::XS_UNSIGNED_LONG] = theQNamePool->insert(ns, "xs", "unsignedLong");
249 f->createQName(theSchemaTypeNames[store::XS_SHORT], ns, "xs", "short");248 theSchemaTypeNames[store::XS_UNSIGNED_INT] = theQNamePool->insert(ns, "xs", "unsignedInt");
250 f->createQName(theSchemaTypeNames[store::XS_BYTE], ns, "xs", "byte");249 theSchemaTypeNames[store::XS_UNSIGNED_SHORT] = theQNamePool->insert(ns, "xs", "unsignedShort");
251 f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_LONG], ns, "xs", "unsignedLong");250 theSchemaTypeNames[store::XS_UNSIGNED_BYTE] = theQNamePool->insert(ns, "xs", "unsignedByte");
252 f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_INT], ns, "xs", "unsignedInt");251
253 f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_SHORT], ns, "xs", "unsignedShort");252 theSchemaTypeNames[store::XS_BASE64BINARY] = theQNamePool->insert(ns, "xs", "base64Binary");
254 f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_BYTE], ns, "xs", "unsignedByte");253 theSchemaTypeNames[store::XS_HEXBINARY] = theQNamePool->insert(ns, "xs", "hexBinary");
255254 theSchemaTypeNames[store::XS_BOOLEAN] = theQNamePool->insert(ns, "xs", "boolean");
256 f->createQName(theSchemaTypeNames[store::XS_BASE64BINARY], ns, "xs", "base64Binary");
257 f->createQName(theSchemaTypeNames[store::XS_HEXBINARY], ns, "xs", "hexBinary");
258 f->createQName(theSchemaTypeNames[store::XS_BOOLEAN], ns, "xs", "boolean");
259255
260 for (ulong i = 0; i < store::XS_LAST; ++i)256 for (ulong i = 0; i < store::XS_LAST; ++i)
261 {257 {

Subscribers

People subscribed via source and target branches