Ghislain Fourny has proposed merging 
lp:~zorba-coders/zorba/builtin-qnames-in-pool-fix into lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)
  Matthias Brantner (matthias-brantner)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/builtin-qnames-in-pool-fix/+merge/110805

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).
-- 
https://code.launchpad.net/~zorba-coders/zorba/builtin-qnames-in-pool-fix/+merge/110805
Your team Zorba Coders is subscribed to branch lp:zorba.
=== 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 @@
 void Store::initTypeNames()
 {
   const char* ns = XS_URI;
-  BasicItemFactory* f = static_cast<BasicItemFactory*>(theItemFactory);
 
   theSchemaTypeNames.resize(store::XS_LAST);
 
 #ifdef ZORBA_WITH_JSON
-  f->createQName(JDM_NULL_QNAME, JDM_URI, "jdm", "null");
-  f->createQName(JDM_OBJECT_QNAME, JDM_URI, "jdm", "object");
-  f->createQName(JDM_ARRAY_QNAME, JDM_URI, "jdm", "array");
+  JDM_NULL_QNAME = theQNamePool->insert(JDM_URI, "jdm", "null");
+  JDM_OBJECT_QNAME = theQNamePool->insert(JDM_URI, "jdm", "object");
+  JDM_ARRAY_QNAME = theQNamePool->insert(JDM_URI, "jdm", "array");
 #endif
 
-  f->createQName(XS_UNTYPED_QNAME, ns, "xs", "untyped");
-
-  f->createQName(XS_ANY_QNAME, ns, "xs", "anyType");
-
-  f->createQName(XS_ANY_SIMPLE_QNAME, ns, "xs", "anySimpleType");
-
-  f->createQName(theSchemaTypeNames[store::XS_ANY_ATOMIC],     ns, "xs", "anyAtomicType");
-
-  f->createQName(theSchemaTypeNames[store::XS_UNTYPED_ATOMIC], ns, "xs", "untypedAtomic");
-
-  f->createQName(theSchemaTypeNames[store::XS_ANY_URI],        ns, "xs", "anyURI");
-
-  f->createQName(theSchemaTypeNames[store::XS_QNAME],          ns, "xs", "QName");
-
-  f->createQName(theSchemaTypeNames[store::XS_NOTATION],       ns, "xs", "NOTATION");
-
-  f->createQName(theSchemaTypeNames[store::XS_STRING],         ns, "xs", "string");
-  f->createQName(theSchemaTypeNames[store::XS_NORMALIZED_STRING], ns, "xs", "normalizedString");
-  f->createQName(theSchemaTypeNames[store::XS_TOKEN],          ns, "xs", "token");
-  f->createQName(theSchemaTypeNames[store::XS_NMTOKEN],        ns, "xs", "NMTOKEN");
-  f->createQName(theSchemaTypeNames[store::XS_LANGUAGE],       ns, "xs", "language");
-  f->createQName(theSchemaTypeNames[store::XS_NAME],           ns, "xs", "Name");
-  f->createQName(theSchemaTypeNames[store::XS_NCNAME],         ns, "xs", "NCName");
-  f->createQName(theSchemaTypeNames[store::XS_ID],             ns, "xs", "ID");
-  f->createQName(theSchemaTypeNames[store::XS_IDREF],          ns, "xs", "IDREF");
-  f->createQName(theSchemaTypeNames[store::XS_ENTITY],         ns, "xs", "ENTITY");
-
-  f->createQName(theSchemaTypeNames[store::XS_DATETIME],       ns, "xs", "dateTime");
-  f->createQName(theSchemaTypeNames[store::XS_DATE],           ns, "xs", "date");
-  f->createQName(theSchemaTypeNames[store::XS_TIME],           ns, "xs", "time");
-  f->createQName(theSchemaTypeNames[store::XS_GYEAR_MONTH],    ns, "xs", "gYearMonth");
-  f->createQName(theSchemaTypeNames[store::XS_GYEAR],          ns, "xs", "gYear");
-  f->createQName(theSchemaTypeNames[store::XS_GMONTH_DAY],     ns, "xs", "gMonthDay");
-  f->createQName(theSchemaTypeNames[store::XS_GDAY],           ns, "xs", "gDay");
-  f->createQName(theSchemaTypeNames[store::XS_GMONTH],         ns, "xs", "gMonth");
-
-  f->createQName(theSchemaTypeNames[store::XS_DURATION],       ns, "xs", "duration");
-  f->createQName(theSchemaTypeNames[store::XS_DT_DURATION],    ns, "xs", "dayTimeDuration");
-  f->createQName(theSchemaTypeNames[store::XS_YM_DURATION],    ns, "xs", "yearMonthDuration");
-
-  f->createQName(theSchemaTypeNames[store::XS_FLOAT],          ns, "xs", "float");
-  f->createQName(theSchemaTypeNames[store::XS_DOUBLE],         ns, "xs", "double");
-  f->createQName(theSchemaTypeNames[store::XS_DECIMAL],        ns, "xs", "decimal");
-  f->createQName(theSchemaTypeNames[store::XS_INTEGER],        ns, "xs", "integer");
-  f->createQName(theSchemaTypeNames[store::XS_NON_POSITIVE_INTEGER], ns, "xs", "nonPositiveInteger");
-  f->createQName(theSchemaTypeNames[store::XS_NON_NEGATIVE_INTEGER], ns, "xs", "nonNegativeInteger");
-  f->createQName(theSchemaTypeNames[store::XS_NEGATIVE_INTEGER], ns, "xs", "negativeInteger");
-  f->createQName(theSchemaTypeNames[store::XS_POSITIVE_INTEGER], ns, "xs", "positiveInteger");
-
-  f->createQName(theSchemaTypeNames[store::XS_LONG],           ns, "xs", "long");
-  f->createQName(theSchemaTypeNames[store::XS_INT],            ns, "xs", "int");
-  f->createQName(theSchemaTypeNames[store::XS_SHORT],          ns, "xs", "short");
-  f->createQName(theSchemaTypeNames[store::XS_BYTE],           ns, "xs", "byte");
-  f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_LONG],  ns, "xs", "unsignedLong");
-  f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_INT],   ns, "xs", "unsignedInt");
-  f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_SHORT], ns, "xs", "unsignedShort");
-  f->createQName(theSchemaTypeNames[store::XS_UNSIGNED_BYTE],  ns, "xs", "unsignedByte");
-
-  f->createQName(theSchemaTypeNames[store::XS_BASE64BINARY],   ns, "xs", "base64Binary");
-  f->createQName(theSchemaTypeNames[store::XS_HEXBINARY],      ns, "xs", "hexBinary");
-  f->createQName(theSchemaTypeNames[store::XS_BOOLEAN],        ns, "xs", "boolean");
+  XS_UNTYPED_QNAME = theQNamePool->insert(ns, "xs", "untyped");
+
+  XS_ANY_QNAME = theQNamePool->insert(ns, "xs", "anyType");
+
+  theSchemaTypeNames[store::XS_ANY_ATOMIC] =
+      theQNamePool->insert(ns, "xs", "anyAtomicType");
+
+  theSchemaTypeNames[store::XS_UNTYPED_ATOMIC] =
+      theQNamePool->insert(ns, "xs", "untypedAtomic");
+
+  theSchemaTypeNames[store::XS_ANY_URI] = theQNamePool->insert(ns, "xs", "anyURI");
+  theSchemaTypeNames[store::XS_QNAME] = theQNamePool->insert(ns, "xs", "QName");
+  theSchemaTypeNames[store::XS_NOTATION] = theQNamePool->insert(ns, "xs", "NOTATION");
+  theSchemaTypeNames[store::XS_STRING] = theQNamePool->insert(ns, "xs", "string");
+  theSchemaTypeNames[store::XS_NORMALIZED_STRING] = theQNamePool->insert(ns, "xs", "normalizedString");
+  theSchemaTypeNames[store::XS_TOKEN] = theQNamePool->insert(ns, "xs", "token");
+  theSchemaTypeNames[store::XS_NMTOKEN] = theQNamePool->insert(ns, "xs", "NMTOKEN");
+  theSchemaTypeNames[store::XS_LANGUAGE] = theQNamePool->insert(ns, "xs", "language");
+  theSchemaTypeNames[store::XS_NAME] = theQNamePool->insert(ns, "xs", "Name");
+  theSchemaTypeNames[store::XS_NCNAME] = theQNamePool->insert(ns, "xs", "NCName");
+  theSchemaTypeNames[store::XS_ID] = theQNamePool->insert(ns, "xs", "ID");
+  theSchemaTypeNames[store::XS_IDREF] = theQNamePool->insert(ns, "xs", "IDREF");
+  theSchemaTypeNames[store::XS_ENTITY] = theQNamePool->insert(ns, "xs", "ENTITY");
+
+  theSchemaTypeNames[store::XS_DATETIME] = theQNamePool->insert(ns, "xs", "dateTime");
+  theSchemaTypeNames[store::XS_DATE] = theQNamePool->insert(ns, "xs", "date");
+  theSchemaTypeNames[store::XS_TIME] = theQNamePool->insert(ns, "xs", "time");
+  theSchemaTypeNames[store::XS_GYEAR_MONTH] = theQNamePool->insert(ns, "xs", "gYearMonth");
+  theSchemaTypeNames[store::XS_GYEAR] = theQNamePool->insert(ns, "xs", "gYear");
+  theSchemaTypeNames[store::XS_GMONTH_DAY] = theQNamePool->insert(ns, "xs", "gMonthDay");
+  theSchemaTypeNames[store::XS_GDAY] = theQNamePool->insert(ns, "xs", "gDay");
+  theSchemaTypeNames[store::XS_GMONTH] = theQNamePool->insert(ns, "xs", "gMonth");
+
+  theSchemaTypeNames[store::XS_DURATION] = theQNamePool->insert(ns, "xs", "duration");
+  theSchemaTypeNames[store::XS_DT_DURATION] = theQNamePool->insert(ns, "xs", "dayTimeDuration");
+  theSchemaTypeNames[store::XS_YM_DURATION] = theQNamePool->insert(ns, "xs", "yearMonthDuration");
+
+  theSchemaTypeNames[store::XS_FLOAT] = theQNamePool->insert(ns, "xs", "float");
+  theSchemaTypeNames[store::XS_DOUBLE] = theQNamePool->insert(ns, "xs", "double");
+  theSchemaTypeNames[store::XS_DECIMAL] = theQNamePool->insert(ns, "xs", "decimal");
+  theSchemaTypeNames[store::XS_INTEGER] = theQNamePool->insert(ns, "xs", "integer");
+  theSchemaTypeNames[store::XS_NON_POSITIVE_INTEGER] = theQNamePool->insert(ns, "xs", "nonPositiveInteger");
+  theSchemaTypeNames[store::XS_NON_NEGATIVE_INTEGER] = theQNamePool->insert(ns, "xs", "nonNegativeInteger");
+  theSchemaTypeNames[store::XS_NEGATIVE_INTEGER] = theQNamePool->insert(ns, "xs", "negativeInteger");
+  theSchemaTypeNames[store::XS_POSITIVE_INTEGER] = theQNamePool->insert(ns, "xs", "positiveInteger");
+
+  theSchemaTypeNames[store::XS_LONG] = theQNamePool->insert(ns, "xs", "long");
+  theSchemaTypeNames[store::XS_INT] = theQNamePool->insert(ns, "xs", "int");
+  theSchemaTypeNames[store::XS_SHORT] = theQNamePool->insert(ns, "xs", "short");
+  theSchemaTypeNames[store::XS_BYTE] = theQNamePool->insert(ns, "xs", "byte");
+  theSchemaTypeNames[store::XS_UNSIGNED_LONG] = theQNamePool->insert(ns, "xs", "unsignedLong");
+  theSchemaTypeNames[store::XS_UNSIGNED_INT] = theQNamePool->insert(ns, "xs", "unsignedInt");
+  theSchemaTypeNames[store::XS_UNSIGNED_SHORT] = theQNamePool->insert(ns, "xs", "unsignedShort");
+  theSchemaTypeNames[store::XS_UNSIGNED_BYTE] = theQNamePool->insert(ns, "xs", "unsignedByte");
+
+  theSchemaTypeNames[store::XS_BASE64BINARY] = theQNamePool->insert(ns, "xs", "base64Binary");
+  theSchemaTypeNames[store::XS_HEXBINARY] = theQNamePool->insert(ns, "xs", "hexBinary");
+  theSchemaTypeNames[store::XS_BOOLEAN] = theQNamePool->insert(ns, "xs", "boolean");
 
   for (ulong i = 0; i < store::XS_LAST; ++i)
   {

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to