You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

297 lines
42 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.9.1"/>
  7. <title>Xerces-C++: XMLGrammarPool.hpp Source File</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <body>
  14. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  15. <div id="titlearea">
  16. <table cellspacing="0" cellpadding="0">
  17. <tbody>
  18. <tr style="height: 56px;">
  19. <td style="padding-left: 0.5em;">
  20. <div id="projectname">Xerces-C++
  21. &#160;<span id="projectnumber">3.1.2</span>
  22. </div>
  23. </td>
  24. </tr>
  25. </tbody>
  26. </table>
  27. </div>
  28. <!-- end header part -->
  29. <!-- Generated by Doxygen 1.8.9.1 -->
  30. <div id="navrow1" class="tabs">
  31. <ul class="tablist">
  32. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  33. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  34. <li><a href="annotated.html"><span>Classes</span></a></li>
  35. <li class="current"><a href="files.html"><span>Files</span></a></li>
  36. </ul>
  37. </div>
  38. <div id="navrow2" class="tabs2">
  39. <ul class="tablist">
  40. <li><a href="files.html"><span>File&#160;List</span></a></li>
  41. <li><a href="globals.html"><span>File&#160;Members</span></a></li>
  42. </ul>
  43. </div>
  44. <div id="nav-path" class="navpath">
  45. <ul>
  46. <li class="navelem"><a class="el" href="dir_901b4356d5f32ee418b4c714d07fb65a.html">src</a></li><li class="navelem"><a class="el" href="dir_477226ead712f319998d821c029f7620.html">xercesc</a></li><li class="navelem"><a class="el" href="dir_41aef2f7a87f1ae87976cc1bb7e908ff.html">framework</a></li> </ul>
  47. </div>
  48. </div><!-- top -->
  49. <div class="header">
  50. <div class="headertitle">
  51. <div class="title">XMLGrammarPool.hpp</div> </div>
  52. </div><!--header-->
  53. <div class="contents">
  54. <a href="XMLGrammarPool_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div>
  55. <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span></div>
  56. <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span></div>
  57. <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * this work for additional information regarding copyright ownership.</span></div>
  58. <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span></div>
  59. <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance with</span></div>
  60. <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * the License. You may obtain a copy of the License at</span></div>
  61. <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * </span></div>
  62. <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
  63. <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * </span></div>
  64. <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
  65. <div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
  66. <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
  67. <div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
  68. <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * limitations under the License.</span></div>
  69. <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div>
  70. <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div>
  71. <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">/*</span></div>
  72. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> * $Id: XMLGrammarPool.hpp 527149 2007-04-10 14:56:39Z amassari $</span></div>
  73. <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment"> */</span></div>
  74. <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
  75. <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#if !defined(XERCESC_INCLUDE_GUARD_XMLGRAMMARPOOL_HPP)</span></div>
  76. <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define XERCESC_INCLUDE_GUARD_XMLGRAMMARPOOL_HPP</span></div>
  77. <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
  78. <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="PlatformUtils_8hpp.html">xercesc/util/PlatformUtils.hpp</a>&gt;</span></div>
  79. <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;xercesc/util/RefHashTableOf.hpp&gt;</span></div>
  80. <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="XMemory_8hpp.html">xercesc/util/XMemory.hpp</a>&gt;</span></div>
  81. <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="XSModel_8hpp.html">xercesc/framework/psvi/XSModel.hpp</a>&gt;</span></div>
  82. <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
  83. <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div>
  84. <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<a class="code" href="XercesDefs_8hpp.html#a43d74fa53d868d978f3e97cbb78b194d">XERCES_CPP_NAMESPACE_BEGIN</a></div>
  85. <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
  86. <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">class </span>Grammar;</div>
  87. <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">class </span><a class="code" href="classXMLGrammarDescription.html">XMLGrammarDescription</a>;</div>
  88. <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">class </span>DTDGrammar;</div>
  89. <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">class </span>SchemaGrammar;</div>
  90. <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">class </span><a class="code" href="classXMLDTDDescription.html">XMLDTDDescription</a>;</div>
  91. <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="keyword">class </span><a class="code" href="classXMLSchemaDescription.html">XMLSchemaDescription</a>;</div>
  92. <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="keyword">class </span>XMLStringPool;</div>
  93. <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="keyword">class </span><a class="code" href="classBinInputStream.html">BinInputStream</a>;</div>
  94. <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="keyword">class </span><a class="code" href="classBinOutputStream.html">BinOutputStream</a>;</div>
  95. <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
  96. <div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classXMLGrammarPool.html"> 43</a></span>&#160;<span class="keyword">class </span><a class="code" href="XercesDefs_8hpp.html#a13df5a01e63e51f62a1467b588b59054">XMLPARSER_EXPORT</a> <a class="code" href="classXMLGrammarPool.html">XMLGrammarPool</a> : <span class="keyword">public</span> <a class="code" href="classXMemory.html">XMemory</a></div>
  97. <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;{</div>
  98. <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="keyword">public</span> :</div>
  99. <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  100. <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment"></span> <span class="comment">// -----------------------------------------------------------------------</span></div>
  101. <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment"></span></div>
  102. <div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classXMLGrammarPool.html#a792b7f4329e5f5879e697267e1f77045"> 55</a></span>&#160; <span class="keyword">virtual</span> <a class="code" href="classXMLGrammarPool.html#a792b7f4329e5f5879e697267e1f77045">~XMLGrammarPool</a>(){};</div>
  103. <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div>
  104. <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  105. <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="comment"></span> <span class="comment">// -----------------------------------------------------------------------</span></div>
  106. <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment"></span></div>
  107. <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> cacheGrammar(Grammar* <span class="keyword">const</span> gramToCache) = 0;</div>
  108. <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; </div>
  109. <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keyword">virtual</span> Grammar* retrieveGrammar(<a class="code" href="classXMLGrammarDescription.html">XMLGrammarDescription</a>* <span class="keyword">const</span> gramDesc) = 0;</div>
  110. <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; </div>
  111. <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; </div>
  112. <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keyword">virtual</span> Grammar* orphanGrammar(<span class="keyword">const</span> <a class="code" href="Xerces__autoconf__config_8borland_8hpp.html#a8cb107980a360c490ad7661f5d27cc0e">XMLCh</a>* <span class="keyword">const</span> nameSpaceKey) = 0; </div>
  113. <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div>
  114. <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div>
  115. <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keyword">virtual</span> RefHashTableOfEnumerator&lt;Grammar&gt; getGrammarEnumerator() <span class="keyword">const</span> = 0;</div>
  116. <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div>
  117. <div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> clear() = 0;</div>
  118. <div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; </div>
  119. <div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> lockPool() = 0;</div>
  120. <div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; </div>
  121. <div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> unlockPool() = 0;</div>
  122. <div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div>
  123. <div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div>
  124. <div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  125. <div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="comment"></span> <span class="comment">// -----------------------------------------------------------------------</span></div>
  126. <div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="comment"></span></div>
  127. <div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keyword">virtual</span> DTDGrammar* createDTDGrammar() = 0;</div>
  128. <div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
  129. <div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keyword">virtual</span> SchemaGrammar* createSchemaGrammar() = 0;</div>
  130. <div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; </div>
  131. <div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classXMLDTDDescription.html">XMLDTDDescription</a>* createDTDDescription(<span class="keyword">const</span> <a class="code" href="Xerces__autoconf__config_8borland_8hpp.html#a8cb107980a360c490ad7661f5d27cc0e">XMLCh</a>* <span class="keyword">const</span> systemId) = 0;</div>
  132. <div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classXMLSchemaDescription.html">XMLSchemaDescription</a>* createSchemaDescription(<span class="keyword">const</span> <a class="code" href="Xerces__autoconf__config_8borland_8hpp.html#a8cb107980a360c490ad7661f5d27cc0e">XMLCh</a>* <span class="keyword">const</span> targetNamespace) = 0;</div>
  133. <div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div>
  134. <div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div>
  135. <div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  136. <div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;<span class="comment"></span> <span class="comment">// ----------------------------------------------------------------------- </span></div>
  137. <div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="comment"></span></div>
  138. <div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="comment">/***</span></div>
  139. <div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;<span class="comment"> * Return an XSModel derived from the components of all SchemaGrammars</span></div>
  140. <div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="comment"> * in the grammar pool. If the pool is locked, this should</span></div>
  141. <div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;<span class="comment"> * be a thread-safe operation.</span></div>
  142. <div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="comment"> *</span></div>
  143. <div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="comment"> * NOTE: The function should NEVER return NULL. If there are no grammars in</span></div>
  144. <div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="comment"> * the pool it should return an XSModel containing the Schema for Schema. </span></div>
  145. <div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="comment"> *</span></div>
  146. <div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="comment"> * Calling getXSModel() on an unlocked grammar pool may result in the</span></div>
  147. <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="comment"> * creation of a new XSModel with the old XSModel being deleted.</span></div>
  148. <div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="comment"> * The bool parameter will indicate if the XSModel was changed.</span></div>
  149. <div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;<span class="comment"> * </span></div>
  150. <div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="comment"> */</span></div>
  151. <div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keyword">virtual</span> <a class="code" href="classXSModel.html">XSModel</a> *getXSModel(<span class="keywordtype">bool</span>&amp; XSModelWasChanged) = 0;</div>
  152. <div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
  153. <div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">// @}</span></div>
  154. <div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div>
  155. <div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  156. <div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="comment"></span> <span class="comment">// ----------------------------------------------------------------------- </span></div>
  157. <div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="comment"></span></div>
  158. <div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="classXMLGrammarPool.html#ae12c5153eb902652d3ebd5c8d504e5b3"> 200</a></span>&#160; <span class="keyword">inline</span> <a class="code" href="classMemoryManager.html">MemoryManager</a>* <a class="code" href="classXMLGrammarPool.html#ae12c5153eb902652d3ebd5c8d504e5b3">getMemoryManager</a>()</div>
  159. <div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; {</div>
  160. <div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">return</span> fMemMgr;</div>
  161. <div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; }</div>
  162. <div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;</div>
  163. <div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keyword">virtual</span> XMLStringPool *getURIStringPool() = 0;</div>
  164. <div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;</div>
  165. <div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  166. <div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;<span class="comment"></span> <span class="comment">// ----------------------------------------------------------------------- </span></div>
  167. <div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;</div>
  168. <div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="comment">/***</span></div>
  169. <div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;<span class="comment"> *</span></div>
  170. <div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;<span class="comment"> * 1. Context: Serialize/Deserialize All Grammars In One Session</span></div>
  171. <div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;<span class="comment"> *</span></div>
  172. <div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;<span class="comment"> * Since it is common that a declaration in one grammar may reference </span></div>
  173. <div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;<span class="comment"> * to definitions in other grammars, it is required to serialize those </span></div>
  174. <div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="comment"> * related (or interdependent) grammars in to one persistent data store </span></div>
  175. <div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;<span class="comment"> * in one serialization session (storing), and deserialize them from the</span></div>
  176. <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;<span class="comment"> * persistent data store in one deserialization session (loading) back</span></div>
  177. <div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="comment"> * to the grammar pool. </span></div>
  178. <div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;<span class="comment"> *</span></div>
  179. <div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="comment"> * 2. Multiple serializations</span></div>
  180. <div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;<span class="comment"> *</span></div>
  181. <div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="comment"> * It is acceptable that client application requests more than one </span></div>
  182. <div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="comment"> * grammar serialization on a particular grammar pool, to track the </span></div>
  183. <div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="comment"> * different grammars cached, or for whatever reasons that client </span></div>
  184. <div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;<span class="comment"> * application is interested in. </span></div>
  185. <div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="comment"> *</span></div>
  186. <div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="comment"> * 3. Multiple deserializations</span></div>
  187. <div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="comment"> * </span></div>
  188. <div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="comment"> * Request for grammar deserialization either after the grammar pool has </span></div>
  189. <div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="comment"> * its own cached grammars, or request for more than one grammar </span></div>
  190. <div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;<span class="comment"> * deserialization, may cause undesired and unpredictable consequence</span></div>
  191. <div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="comment"> * and therefore client application shall be aware that individual </span></div>
  192. <div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;<span class="comment"> * implementationis may NOT support this.</span></div>
  193. <div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;<span class="comment"> *</span></div>
  194. <div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="comment"> * However it is strongly recommended that the client application requests </span></div>
  195. <div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;<span class="comment"> * no more than one grammar deserialization even a particular implementation</span></div>
  196. <div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="comment"> * may allow multiple deserializations.</span></div>
  197. <div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;<span class="comment"> *</span></div>
  198. <div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;<span class="comment"> * 4. Locking</span></div>
  199. <div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="comment"> *</span></div>
  200. <div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;<span class="comment"> * Both serialization and deserialization requires to lock the grammar pool</span></div>
  201. <div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;<span class="comment"> * before operation and unlock after operation. In the case the grammar pool</span></div>
  202. <div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;<span class="comment"> * is locked by a third party, the request for serialization/deserialization</span></div>
  203. <div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;<span class="comment"> * will NOT be entertained.</span></div>
  204. <div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="comment"> *</span></div>
  205. <div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;<span class="comment"> * 5. Versioning</span></div>
  206. <div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;<span class="comment"> *</span></div>
  207. <div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;<span class="comment"> * The Persistent data store has a version tag to be verified during </span></div>
  208. <div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;<span class="comment"> * deserialization, thus a grammar pool may decide if it supports</span></div>
  209. <div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;<span class="comment"> * a binary data created by a different release of Xerces.</span></div>
  210. <div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;<span class="comment"> * </span></div>
  211. <div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;<span class="comment"> * 6. Clean up</span></div>
  212. <div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="comment"> *</span></div>
  213. <div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="comment"> * The client application shall be aware that in the event of an exception</span></div>
  214. <div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="comment"> * thrown due to a corrupted data store during deserialization, implementation</span></div>
  215. <div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="comment"> * may not be able to clean up all resources allocated, and therefore it is </span></div>
  216. <div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;<span class="comment"> * client application&#39;s responsibility to clean up those unreleased resources.</span></div>
  217. <div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="comment"> *</span></div>
  218. <div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;<span class="comment"> *</span></div>
  219. <div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;<span class="comment"> */</span></div>
  220. <div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> serializeGrammars(<a class="code" href="classBinOutputStream.html">BinOutputStream</a>* <span class="keyword">const</span>) = 0; </div>
  221. <div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> deserializeGrammars(<a class="code" href="classBinInputStream.html">BinInputStream</a>* <span class="keyword">const</span>) = 0; </div>
  222. <div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; </div>
  223. <div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="comment">/*</span></div>
  224. <div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;<span class="comment"> * Set/get a flag to not create XSAnnotations when deserializing the grammar.</span></div>
  225. <div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;<span class="comment"> * Defaults to false (create XSAnnotations when deserializing the grammar).</span></div>
  226. <div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;<span class="comment"> */</span></div>
  227. <div class="line"><a name="l00277"></a><span class="lineno"><a class="line" href="classXMLGrammarPool.html#af320d13b44ba404c9653e5934ddd782a"> 277</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classXMLGrammarPool.html#af320d13b44ba404c9653e5934ddd782a">setIgnoreSerializedAnnotations</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> flag)</div>
  228. <div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; {</div>
  229. <div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; fIgnoreSerializedAnnotations = flag;</div>
  230. <div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; };</div>
  231. <div class="line"><a name="l00281"></a><span class="lineno"><a class="line" href="classXMLGrammarPool.html#a9b8187ba62782cc03c0ad1fc6a658023"> 281</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classXMLGrammarPool.html#a9b8187ba62782cc03c0ad1fc6a658023">getIgnoreSerializedAnnotations</a>()<span class="keyword"> const</span></div>
  232. <div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;<span class="keyword"> </span>{</div>
  233. <div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordflow">return</span> fIgnoreSerializedAnnotations;</div>
  234. <div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; };</div>
  235. <div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;</div>
  236. <div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;<span class="keyword">protected</span> :</div>
  237. <div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  238. <div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="comment"></span> <span class="comment">// -----------------------------------------------------------------------</span></div>
  239. <div class="line"><a name="l00291"></a><span class="lineno"><a class="line" href="classXMLGrammarPool.html#a0dc250a1820cebb8aa99449d1c57e502"> 291</a></span>&#160;<span class="comment"></span> <a class="code" href="classXMLGrammarPool.html#a0dc250a1820cebb8aa99449d1c57e502">XMLGrammarPool</a>(<a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> memMgr = <a class="code" href="classXMLPlatformUtils.html#a97eff0d9fff3567bea3acd3ca4d95252">XMLPlatformUtils::fgMemoryManager</a>)</div>
  240. <div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; :fMemMgr(memMgr)</div>
  241. <div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; ,fIgnoreSerializedAnnotations(false)</div>
  242. <div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; {</div>
  243. <div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; };</div>
  244. <div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
  245. <div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160;<span class="keyword">private</span> :</div>
  246. <div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  247. <div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;<span class="comment"></span> <span class="comment">// -----------------------------------------------------------------------</span></div>
  248. <div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160;<span class="comment"></span> <a class="code" href="classXMLGrammarPool.html">XMLGrammarPool</a>(<span class="keyword">const</span> <a class="code" href="classXMLGrammarPool.html">XMLGrammarPool</a>&amp; );</div>
  249. <div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <a class="code" href="classXMLGrammarPool.html">XMLGrammarPool</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="classXMLGrammarPool.html">XMLGrammarPool</a>&amp; );</div>
  250. <div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;</div>
  251. <div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  252. <div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="comment">//</span></div>
  253. <div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <span class="comment">// fMemMgr: plugged-in (or defaulted-in) memory manager</span></div>
  254. <div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <span class="comment">// not owned </span></div>
  255. <div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="comment">// no reset after initialization</span></div>
  256. <div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <span class="comment">//</span></div>
  257. <div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="comment">// -----------------------------------------------------------------------</span></div>
  258. <div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; </div>
  259. <div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> fMemMgr;</div>
  260. <div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="keywordtype">bool</span> fIgnoreSerializedAnnotations;</div>
  261. <div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;</div>
  262. <div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;};</div>
  263. <div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;</div>
  264. <div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;<a class="code" href="XercesDefs_8hpp.html#af03d5cb905763ef7a7bd22ab82718285">XERCES_CPP_NAMESPACE_END</a></div>
  265. <div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;</div>
  266. <div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;<span class="preprocessor">#endif</span></div>
  267. <div class="ttc" id="classBinOutputStream_html"><div class="ttname"><a href="classBinOutputStream.html">BinOutputStream</a></div><div class="ttdef"><b>Definition:</b> BinOutputStream.hpp:29</div></div>
  268. <div class="ttc" id="classXMemory_html"><div class="ttname"><a href="classXMemory.html">XMemory</a></div><div class="ttdoc">This class makes it possible to override the C++ memory management by adding new/delete operators to ...</div><div class="ttdef"><b>Definition:</b> XMemory.hpp:40</div></div>
  269. <div class="ttc" id="classXMLPlatformUtils_html_a97eff0d9fff3567bea3acd3ca4d95252"><div class="ttname"><a href="classXMLPlatformUtils.html#a97eff0d9fff3567bea3acd3ca4d95252">XMLPlatformUtils::fgMemoryManager</a></div><div class="ttdeci">static MemoryManager * fgMemoryManager</div><div class="ttdoc">The configurable memory manager. </div><div class="ttdef"><b>Definition:</b> PlatformUtils.hpp:121</div></div>
  270. <div class="ttc" id="classXMLGrammarPool_html_a9b8187ba62782cc03c0ad1fc6a658023"><div class="ttname"><a href="classXMLGrammarPool.html#a9b8187ba62782cc03c0ad1fc6a658023">XMLGrammarPool::getIgnoreSerializedAnnotations</a></div><div class="ttdeci">bool getIgnoreSerializedAnnotations() const </div><div class="ttdef"><b>Definition:</b> XMLGrammarPool.hpp:281</div></div>
  271. <div class="ttc" id="classXMLGrammarPool_html"><div class="ttname"><a href="classXMLGrammarPool.html">XMLGrammarPool</a></div><div class="ttdef"><b>Definition:</b> XMLGrammarPool.hpp:43</div></div>
  272. <div class="ttc" id="XSModel_8hpp_html"><div class="ttname"><a href="XSModel_8hpp.html">XSModel.hpp</a></div></div>
  273. <div class="ttc" id="classXMLGrammarPool_html_a792b7f4329e5f5879e697267e1f77045"><div class="ttname"><a href="classXMLGrammarPool.html#a792b7f4329e5f5879e697267e1f77045">XMLGrammarPool::~XMLGrammarPool</a></div><div class="ttdeci">virtual ~XMLGrammarPool()</div><div class="ttdoc">virtual destructor </div><div class="ttdef"><b>Definition:</b> XMLGrammarPool.hpp:55</div></div>
  274. <div class="ttc" id="classXMLGrammarPool_html_a0dc250a1820cebb8aa99449d1c57e502"><div class="ttname"><a href="classXMLGrammarPool.html#a0dc250a1820cebb8aa99449d1c57e502">XMLGrammarPool::XMLGrammarPool</a></div><div class="ttdeci">XMLGrammarPool(MemoryManager *const memMgr=XMLPlatformUtils::fgMemoryManager)</div><div class="ttdoc">Hidden Constructors. </div><div class="ttdef"><b>Definition:</b> XMLGrammarPool.hpp:291</div></div>
  275. <div class="ttc" id="XercesDefs_8hpp_html_a13df5a01e63e51f62a1467b588b59054"><div class="ttname"><a href="XercesDefs_8hpp.html#a13df5a01e63e51f62a1467b588b59054">XMLPARSER_EXPORT</a></div><div class="ttdeci">#define XMLPARSER_EXPORT</div><div class="ttdef"><b>Definition:</b> XercesDefs.hpp:163</div></div>
  276. <div class="ttc" id="classXSModel_html"><div class="ttname"><a href="classXSModel.html">XSModel</a></div><div class="ttdef"><b>Definition:</b> XSModel.hpp:59</div></div>
  277. <div class="ttc" id="PlatformUtils_8hpp_html"><div class="ttname"><a href="PlatformUtils_8hpp.html">PlatformUtils.hpp</a></div></div>
  278. <div class="ttc" id="classMemoryManager_html"><div class="ttname"><a href="classMemoryManager.html">MemoryManager</a></div><div class="ttdoc">Configurable memory manager. </div><div class="ttdef"><b>Definition:</b> MemoryManager.hpp:39</div></div>
  279. <div class="ttc" id="XercesDefs_8hpp_html_a43d74fa53d868d978f3e97cbb78b194d"><div class="ttname"><a href="XercesDefs_8hpp.html#a43d74fa53d868d978f3e97cbb78b194d">XERCES_CPP_NAMESPACE_BEGIN</a></div><div class="ttdeci">#define XERCES_CPP_NAMESPACE_BEGIN</div><div class="ttdef"><b>Definition:</b> XercesDefs.hpp:112</div></div>
  280. <div class="ttc" id="Xerces__autoconf__config_8borland_8hpp_html_a8cb107980a360c490ad7661f5d27cc0e"><div class="ttname"><a href="Xerces__autoconf__config_8borland_8hpp.html#a8cb107980a360c490ad7661f5d27cc0e">XMLCh</a></div><div class="ttdeci">wchar_t XMLCh</div><div class="ttdef"><b>Definition:</b> Xerces_autoconf_config.borland.hpp:92</div></div>
  281. <div class="ttc" id="XercesDefs_8hpp_html_af03d5cb905763ef7a7bd22ab82718285"><div class="ttname"><a href="XercesDefs_8hpp.html#af03d5cb905763ef7a7bd22ab82718285">XERCES_CPP_NAMESPACE_END</a></div><div class="ttdeci">#define XERCES_CPP_NAMESPACE_END</div><div class="ttdef"><b>Definition:</b> XercesDefs.hpp:113</div></div>
  282. <div class="ttc" id="classXMLDTDDescription_html"><div class="ttname"><a href="classXMLDTDDescription.html">XMLDTDDescription</a></div><div class="ttdef"><b>Definition:</b> XMLDTDDescription.hpp:29</div></div>
  283. <div class="ttc" id="classXMLGrammarPool_html_ae12c5153eb902652d3ebd5c8d504e5b3"><div class="ttname"><a href="classXMLGrammarPool.html#ae12c5153eb902652d3ebd5c8d504e5b3">XMLGrammarPool::getMemoryManager</a></div><div class="ttdeci">MemoryManager * getMemoryManager()</div><div class="ttdoc">getMemoryManager </div><div class="ttdef"><b>Definition:</b> XMLGrammarPool.hpp:200</div></div>
  284. <div class="ttc" id="classBinInputStream_html"><div class="ttname"><a href="classBinInputStream.html">BinInputStream</a></div><div class="ttdef"><b>Definition:</b> BinInputStream.hpp:29</div></div>
  285. <div class="ttc" id="classXMLGrammarDescription_html"><div class="ttname"><a href="classXMLGrammarDescription.html">XMLGrammarDescription</a></div><div class="ttdef"><b>Definition:</b> XMLGrammarDescription.hpp:32</div></div>
  286. <div class="ttc" id="XMemory_8hpp_html"><div class="ttname"><a href="XMemory_8hpp.html">XMemory.hpp</a></div></div>
  287. <div class="ttc" id="classXMLSchemaDescription_html"><div class="ttname"><a href="classXMLSchemaDescription.html">XMLSchemaDescription</a></div><div class="ttdef"><b>Definition:</b> XMLSchemaDescription.hpp:32</div></div>
  288. <div class="ttc" id="classXMLGrammarPool_html_af320d13b44ba404c9653e5934ddd782a"><div class="ttname"><a href="classXMLGrammarPool.html#af320d13b44ba404c9653e5934ddd782a">XMLGrammarPool::setIgnoreSerializedAnnotations</a></div><div class="ttdeci">void setIgnoreSerializedAnnotations(const bool flag)</div><div class="ttdef"><b>Definition:</b> XMLGrammarPool.hpp:277</div></div>
  289. </div><!-- fragment --></div><!-- contents -->
  290. <!-- start footer part -->
  291. <hr class="footer"/><address class="footer"><small>
  292. Generated on Wed Mar 18 2015 10:43:37 for Xerces-C++ by &#160;<a href="http://www.doxygen.org/index.html">
  293. <img class="footer" src="doxygen.png" alt="doxygen"/>
  294. </a> 1.8.9.1
  295. </small></address>
  296. </body>
  297. </html>