blob: 244d6f624fc4dcb8eeec21d6bbc40d292b52b2ea [file] [log] [blame]
<HTML><HEAD><TITLE>Xalan-C++ API Documentation</TITLE></HEAD>
<BODY>
<h2 align="center">Xalan-C++ API Documentation</h2>
<h3 align="center">The Xalan C++ XSLT Processor Version 1.10</h3>
</BODY>
<!-- Generated by Doxygen 1.2.8.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>XPathFactory.hpp</h1><a href="XPathFactory_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font>
00002 <font class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</font>
00003 <font class="comment"> *</font>
00004 <font class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</font>
00005 <font class="comment"> * you may not use this file except in compliance with the License.</font>
00006 <font class="comment"> * You may obtain a copy of the License at</font>
00007 <font class="comment"> *</font>
00008 <font class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</font>
00009 <font class="comment"> *</font>
00010 <font class="comment"> * Unless required by applicable law or agreed to in writing, software</font>
00011 <font class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</font>
00012 <font class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</font>
00013 <font class="comment"> * See the License for the specific language governing permissions and</font>
00014 <font class="comment"> * limitations under the License.</font>
00015 <font class="comment"> */</font>
00016 <font class="preprocessor">#if !defined(XPATHFACTORY_HEADER_GUARD_1357924680)</font>
<a name="l00017"></a><a class="code" href="XPathFactory_8hpp.html#a0">00017</a> <font class="preprocessor"></font><font class="preprocessor">#define XPATHFACTORY_HEADER_GUARD_1357924680</font>
00018 <font class="preprocessor"></font>
00019
00020
00021 <font class="comment">// Base include file. Must be first.</font>
00022 <font class="preprocessor">#include &lt;<a class="code" href="XPathDefinitions_8hpp.html">xalanc/XPath/XPathDefinitions.hpp</a>&gt;</font>
00023
00024 <font class="preprocessor">#include &lt;<a class="code" href="XalanMemoryManagement_8hpp.html">xalanc/Include/XalanMemoryManagement.hpp</a>&gt;</font>
00025
00026 <font class="preprocessor">#include &lt;cassert&gt;</font>
00027 <font class="preprocessor">#include &lt;functional&gt;</font>
00028
00029
00030
00031 XALAN_CPP_NAMESPACE_BEGIN
00032
00033
00034
00035 <font class="keyword">class </font><a class="code" href="classXPath.html">XPath</a>;
00036
00037
00038
<a name="l00039"></a><a class="code" href="classXPathFactory.html">00039</a> <font class="keyword">class </font>XALAN_XPATH_EXPORT <a class="code" href="classXPathFactory.html">XPathFactory</a>
00040 {
00041 <font class="keyword">public</font>:
00042
00043 <font class="keyword">explicit</font>
00044 <a class="code" href="classXPathFactory.html#a0">XPathFactory</a>();
00045
00046 <font class="keyword">virtual</font>
00047 <a class="code" href="classXPathFactory.html#a1">~XPathFactory</a>();
00048
00055 <font class="keywordtype">bool</font>
<a name="l00056"></a><a class="code" href="classXPathFactory.html#a2">00056</a> <a class="code" href="classXPathFactory.html#a2">returnObject</a>(<font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>* theXPath)<font class="keyword"></font>
00057 <font class="keyword"> </font>{
00058 <font class="keywordflow">return</font> <a class="code" href="classXPathFactory.html#b0">doReturnObject</a>(theXPath);
00059 }
00060
00065 <font class="keyword">virtual</font> <font class="keywordtype">void</font>
00066 <a class="code" href="classXPathFactory.html#a3">reset</a>() = 0;
00067
00073 <font class="keyword">virtual</font> <a class="code" href="classXPath.html">XPath</a>*
00074 <a class="code" href="classXPathFactory.html#a4">create</a>() = 0;
00075
00081 <font class="preprocessor">#if defined(XALAN_NO_STD_NAMESPACE)</font>
00082 <font class="preprocessor"></font> <font class="keyword">struct </font>DeleteXPathFunctor : <font class="keyword">public</font> unary_function&lt;const XPath*, void&gt;
00083 #else
<a name="l00084"></a><a class="code" href="structXPathFactory_1_1DeleteXPathFunctor.html">00084</a> struct DeleteXPathFunctor : <font class="keyword">public</font> std::unary_function&lt;const XPath*, void&gt;
00085 #endif
00086 {
00087 <font class="keyword">public</font>:
00088
<a name="l00089"></a><a class="code" href="structXPathFactory_1_1DeleteXPathFunctor.html#a0">00089</a> <a class="code" href="structXPathFactory_1_1DeleteXPathFunctor.html#a0">DeleteXPathFunctor</a>(
00090 <a class="code" href="classXPathFactory.html">XPathFactory</a>&amp; theFactoryInstance,
00091 <font class="keywordtype">bool</font> fInReset = <font class="keyword">false</font>) :
00092 m_factoryInstance(theFactoryInstance),
00093 m_fInReset(fInReset)
00094 {
00095 }
00096
00097 result_type
<a name="l00098"></a><a class="code" href="structXPathFactory_1_1DeleteXPathFunctor.html#a1">00098</a> <a class="code" href="structXPathFactory_1_1DeleteXPathFunctor.html#a1">operator()</a>(argument_type theXPath)<font class="keyword"> const</font>
00099 <font class="keyword"> </font>{
00100 <font class="keywordflow">if</font> (m_fInReset == <font class="keyword">true</font>)
00101 {
00102 m_factoryInstance.<a class="code" href="classXPathFactory.html#b0">doReturnObject</a>(theXPath,
00103 <font class="keyword">true</font>);
00104 }
00105 <font class="keywordflow">else</font>
00106 {
00107 m_factoryInstance.<a class="code" href="classXPathFactory.html#a2">returnObject</a>(theXPath);
00108 }
00109 }
00110
00111 <font class="keyword">private</font>:
00112
00113 <a class="code" href="classXPathFactory.html">XPathFactory</a>&amp; m_factoryInstance;
00114
00115 <font class="keyword">const</font> <font class="keywordtype">bool</font> m_fInReset;
00116 };
00117
<a name="l00118"></a><a class="code" href="classXPathFactory.html#l0">00118</a> <font class="keyword">friend</font> <font class="keyword">struct </font>DeleteXPathFunctor;
00119
00120 <font class="keyword">protected</font>:
00121
00122 <font class="keyword">virtual</font> <font class="keywordtype">bool</font>
00123 <a class="code" href="classXPathFactory.html#b0">doReturnObject</a>(
00124 <font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>* theXPath,
00125 <font class="keywordtype">bool</font> fInReset = <font class="keyword">false</font>) = 0;
00126 };
00127
00128
00129
<a name="l00133"></a><a class="code" href="classXPathGuard.html">00133</a> <font class="keyword">class </font><a class="code" href="classXPathGuard.html">XPathGuard</a>
00134 {
00135 <font class="keyword">public</font>:
00136
<a name="l00143"></a><a class="code" href="classXPathGuard.html#a0">00143</a> <a class="code" href="classXPathGuard.html#a0">XPathGuard</a>(
00144 <a class="code" href="classXPathFactory.html">XPathFactory</a>&amp; theFactory,
00145 <font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>* theXPath) :
00146 m_factory(&amp;theFactory),
00147 m_object(theXPath)
00148 {
00149 }
00150
00151 <font class="comment">// Note that copy construction transfers ownership, just</font>
00152 <font class="comment">// as std::auto_ptr.</font>
<a name="l00153"></a><a class="code" href="classXPathGuard.html#a1">00153</a> <a class="code" href="classXPathGuard.html#a0">XPathGuard</a>(<a class="code" href="classXPathGuard.html">XPathGuard</a>&amp; theRHS)<font class="keyword"></font>
00154 <font class="keyword"> </font>{
00155 <font class="comment">// Release the current object...</font>
00156 <a class="code" href="classXPathGuard.html#a6">release</a>();
00157
00158 <font class="comment">// Copy the factory and object pointers...</font>
00159 m_factory = theRHS.m_factory;
00160 m_object = theRHS.m_object;
00161
00162 <font class="comment">// The source object no longer points to</font>
00163 <font class="comment">// the object...</font>
00164 theRHS.m_factory = 0;
00165 theRHS.m_object = 0;
00166 }
00167
<a name="l00168"></a><a class="code" href="classXPathGuard.html#a2">00168</a> <a class="code" href="classXPathGuard.html#a2">~XPathGuard</a>()<font class="keyword"></font>
00169 <font class="keyword"> </font>{
00170 <a class="code" href="classXPathGuard.html#a5">reset</a>();
00171 }
00172
00178 <font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>*
<a name="l00179"></a><a class="code" href="classXPathGuard.html#a3">00179</a> <a class="code" href="classXPathGuard.html#a3">operator-&gt;</a>()<font class="keyword"> const</font>
00180 <font class="keyword"> </font>{
00181 assert(m_object != 0);
00182
00183 <font class="keywordflow">return</font> m_object;
00184 }
00185
00191 <font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>*
<a name="l00192"></a><a class="code" href="classXPathGuard.html#a4">00192</a> <a class="code" href="classXPathGuard.html#a4">get</a>()<font class="keyword"> const</font>
00193 <font class="keyword"> </font>{
00194 <font class="keywordflow">return</font> m_object;
00195 }
00196
00200 <font class="keywordtype">void</font>
<a name="l00201"></a><a class="code" href="classXPathGuard.html#a5">00201</a> <a class="code" href="classXPathGuard.html#a5">reset</a>()<font class="keyword"></font>
00202 <font class="keyword"> </font>{
00203 <font class="keywordflow">if</font> (m_object != 0)
00204 {
00205 assert(m_factory != 0);
00206
00207 m_factory-&gt;<a class="code" href="classXPathFactory.html#a2">returnObject</a>(m_object);
00208
00209 m_object = 0;
00210 }
00211
00212 m_factory = 0;
00213 }
00214
00220 <font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>*
<a name="l00221"></a><a class="code" href="classXPathGuard.html#a6">00221</a> <a class="code" href="classXPathGuard.html#a6">release</a>()<font class="keyword"></font>
00222 <font class="keyword"> </font>{
00223 <font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>* <font class="keyword">const</font> theTemp = m_object;
00224
00225 m_object = 0;
00226
00227 <font class="keywordflow">return</font> theTemp;
00228 }
00229
00230 <font class="keyword">private</font>:
00231
00232 <a class="code" href="classXPathGuard.html">XPathGuard</a>&amp;
00233 operator=(<font class="keyword">const</font> <a class="code" href="classXPathGuard.html">XPathGuard</a>&amp;);
00234
00235 <font class="keywordtype">bool</font>
00236 <a class="code" href="ElemAttributeSet_8hpp.html#a1">operator==</a>(<font class="keyword">const</font> <a class="code" href="classXPathGuard.html">XPathGuard</a>&amp;) <font class="keyword">const</font>;
00237
00238
00239 <font class="comment">// Data members...</font>
00240 <a class="code" href="classXPathFactory.html">XPathFactory</a>* m_factory;
00241 <font class="keyword">const</font> <a class="code" href="classXPath.html">XPath</a>* m_object;
00242 };
00243
00244
00245
00246 XALAN_CPP_NAMESPACE_END
00247
00248
00249
00250 <font class="preprocessor">#endif // XPATHFACTORY_HEADER_GUARD_1357924680</font>
</font></pre></div><p align="center"><a href="diagramnotes.html">Interpreting class diagrams</a></p>
<p><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
<i><A href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</A> and
<A href="http://www.research.att.com/sw/tools/graphviz/">GraphViz</A> are used to generate this API documentation from the Xalan-C header files.</I></FONT></p>
<TABLE border="0" cellpadding="0" cellspacing="0" width="820"><TR><TD bgcolor="#0086b2"><IMG height="1" src="../resources/dot.gif" width="1" alt="dot"></TD></TR></TABLE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%">
<TR>
<TD WIDTH="80%" VALIGN="TOP">
<P ALIGN="CENTER"><B>Xalan-C++ XSLT Processor Version 1.10</B><BR>
Copyright &copy; 1999-2004 The Apache Software Foundation. All Rights Reserved.</i></p>
</TD>
</TR>
<TR>
<TD WIDTH="100%">
<P ALIGN="CENTER"><IMG SRC="ApacheLogo.jpg" WIDTH="387" HEIGHT="100" ALIGN="BOTTOM" BORDER="0" ALT="Apache Logo">
</TD>
</TR>
</TABLE>