| <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> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> |
| <hr><h1>XalanObjectCache.hpp</h1><a href="XalanObjectCache_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(XALAN_OBJECTCACHE_HEADER_GUARD)</font> |
| <a name="l00017"></a><a class="code" href="XalanObjectCache_8hpp.html#a0">00017</a> <font class="preprocessor"></font><font class="preprocessor">#define XALAN_OBJECTCACHE_HEADER_GUARD</font> |
| 00018 <font class="preprocessor"></font> |
| 00019 |
| 00020 |
| 00021 <font class="preprocessor">#include <algorithm></font> |
| 00022 |
| 00023 |
| 00024 |
| 00025 <font class="preprocessor">#include <<a class="code" href="XalanVector_8hpp.html">xalanc/Include/XalanVector.hpp</a>></font> |
| 00026 <font class="preprocessor">#include <<a class="code" href="STLHelper_8hpp.html">xalanc/Include/STLHelper.hpp</a>></font> |
| 00027 |
| 00028 |
| 00029 |
| 00030 |
| 00031 XALAN_CPP_NAMESPACE_BEGIN |
| 00032 |
| 00033 |
| 00034 |
| 00035 template<class ObjectType> |
| <a name="l00036"></a><a class="code" href="classDefaultCacheCreateFunctor.html">00036</a> <font class="keyword">class </font><a class="code" href="classDefaultCacheCreateFunctor.html">DefaultCacheCreateFunctor</a> |
| 00037 { |
| 00038 <font class="keyword">public</font>: |
| 00039 |
| 00040 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* |
| <a name="l00041"></a><a class="code" href="classDefaultCacheCreateFunctor.html#a0">00041</a> <a class="code" href="classDefaultCacheCreateFunctor.html#a0">operator()</a>(MemoryManagerType& theManager)<font class="keyword"> const</font> |
| 00042 <font class="keyword"> </font>{ |
| 00043 <font class="keyword">typedef</font> <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a> <a class="code" href="classXalanDeque.html">ThisType</a>; |
| 00044 |
| 00045 XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (<a class="code" href="classXalanDeque.html">ThisType</a>*)theManager.allocate(<font class="keyword">sizeof</font>(<a class="code" href="classXalanDeque.html">ThisType</a>))); |
| 00046 |
| 00047 <a class="code" href="classXalanDeque.html">ThisType</a>* theResult = theGuard.get(); |
| 00048 |
| 00049 <font class="keyword">new</font> (theResult) ThisType(); |
| 00050 |
| 00051 theGuard.release(); |
| 00052 |
| 00053 <font class="keywordflow">return</font> theResult; |
| 00054 } |
| 00055 }; |
| 00056 |
| 00057 |
| 00058 template<class ObjectType> |
| <a name="l00059"></a><a class="code" href="classDefaultCacheCreateFunctorMemMgr.html">00059</a> <font class="keyword">class </font><a class="code" href="classDefaultCacheCreateFunctorMemMgr.html">DefaultCacheCreateFunctorMemMgr</a> |
| 00060 { |
| 00061 <font class="keyword">public</font>: |
| 00062 |
| 00063 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* |
| <a name="l00064"></a><a class="code" href="classDefaultCacheCreateFunctorMemMgr.html#a0">00064</a> <a class="code" href="classDefaultCacheCreateFunctorMemMgr.html#a0">operator()</a>(MemoryManagerType& theManager)<font class="keyword"> const</font> |
| 00065 <font class="keyword"> </font>{ |
| 00066 <font class="keyword">typedef</font> <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a> <a class="code" href="classXalanDeque.html">ThisType</a>; |
| 00067 |
| 00068 XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (<a class="code" href="classXalanDeque.html">ThisType</a>*)theManager.allocate(<font class="keyword">sizeof</font>(<a class="code" href="classXalanDeque.html">ThisType</a>))); |
| 00069 |
| 00070 <a class="code" href="classXalanDeque.html">ThisType</a>* theResult = theGuard.get(); |
| 00071 |
| 00072 <font class="keyword">new</font> (theResult) ThisType(theManager); |
| 00073 |
| 00074 theGuard.release(); |
| 00075 |
| 00076 <font class="keywordflow">return</font> theResult; |
| 00077 } |
| 00078 }; |
| 00079 |
| 00080 |
| 00081 template<class ObjectType> |
| <a name="l00082"></a><a class="code" href="classDefaultCacheResetFunctor.html">00082</a> <font class="keyword">class </font><a class="code" href="classDefaultCacheResetFunctor.html">DefaultCacheResetFunctor</a> |
| 00083 { |
| 00084 <font class="keyword">public</font>: |
| 00085 |
| 00086 <font class="keywordtype">void</font> |
| <a name="l00087"></a><a class="code" href="classDefaultCacheResetFunctor.html#a0">00087</a> <a class="code" href="classDefaultCacheResetFunctor.html#a0">operator()</a>(<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>*)<font class="keyword"> const</font> |
| 00088 <font class="keyword"> </font>{ |
| 00089 } |
| 00090 }; |
| 00091 |
| 00092 |
| 00093 |
| 00094 template<class ObjectType> |
| <a name="l00095"></a><a class="code" href="classClearCacheResetFunctor.html">00095</a> <font class="keyword">class </font><a class="code" href="classClearCacheResetFunctor.html">ClearCacheResetFunctor</a> |
| 00096 { |
| 00097 <font class="keyword">public</font>: |
| 00098 |
| 00099 <font class="keywordtype">void</font> |
| <a name="l00100"></a><a class="code" href="classClearCacheResetFunctor.html#a0">00100</a> <a class="code" href="classClearCacheResetFunctor.html#a0">operator()</a>(<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* theInstance)<font class="keyword"> const</font> |
| 00101 <font class="keyword"> </font>{ |
| 00102 theInstance-><a class="code" href="DOMStringHelper_8hpp.html#a80">clear</a>(); |
| 00103 } |
| 00104 }; |
| 00105 |
| 00106 |
| 00107 |
| 00108 <font class="preprocessor">#if defined(XALAN_OBJECT_CACHE_KEEP_BUSY_LIST)</font> |
| 00109 <font class="preprocessor"></font> |
| 00110 <font class="keyword">template</font>< |
| 00111 <font class="keyword">class </font><a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>, |
| 00112 <font class="preprocessor">#if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS)</font> |
| 00113 <font class="preprocessor"></font><font class="keyword">class </font>CreateFunctorType, |
| 00114 <font class="keyword">class </font><a class="code" href="structDeleteFunctor.html">DeleteFunctorType</a>, |
| 00115 <font class="keyword">class </font>ResetFunctorType> |
| 00116 <font class="preprocessor">#else</font> |
| 00117 <font class="preprocessor"></font><font class="keyword">class </font>CreateFunctorType = <a class="code" href="classDefaultCacheCreateFunctor.html">DefaultCacheCreateFunctor</a><<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>>, |
| 00118 class <a class="code" href="structDeleteFunctor.html">DeleteFunctorType</a> = <a class="code" href="structDeleteFunctor.html">DeleteFunctor</a><<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>>, |
| 00119 class ResetFunctorType = <a class="code" href="classDefaultCacheResetFunctor.html">DefaultCacheResetFunctor</a><<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>> > |
| 00120 #endif |
| 00121 class <a class="code" href="classXalanObjectCache.html">XalanObjectCache</a> |
| 00122 { |
| 00123 <font class="keyword">public</font>: |
| 00124 |
| 00125 <font class="keyword">typedef</font> XalanVector<ObjectType*> VectorType; |
| 00126 |
| 00127 <font class="keyword">typedef</font> <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a> <a class="code" href="classXalanSourceTreeAttr.html">CacheObjectType</a>; |
| 00128 |
| 00129 <font class="keyword">explicit</font> |
| 00130 <a class="code" href="classXalanObjectCache.html#a0">XalanObjectCache</a>( |
| 00131 MemoryManagerType& theManager, |
| 00132 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> initialListSize = 0) : |
| 00133 m_availableList(theManager), |
| 00134 m_busyList(theManager) |
| 00135 { |
| 00136 m_availableList.reserve(initialListSize); |
| 00137 |
| 00138 m_busyList.reserve(initialListSize); |
| 00139 } |
| 00140 |
| 00141 <a class="code" href="classXalanObjectCache.html#a1">~XalanObjectCache</a>()<font class="keyword"></font> |
| 00142 <font class="keyword"> </font>{ |
| 00143 <a class="code" href="classXalanObjectCache.html#a4">reset</a>(); |
| 00144 |
| 00145 <font class="preprocessor">#if !defined(XALAN_NO_STD_NAMESPACE)</font> |
| 00146 <font class="preprocessor"></font> <font class="keyword">using</font> std::for_each; |
| 00147 <font class="preprocessor">#endif</font> |
| 00148 <font class="preprocessor"></font> |
| 00149 for_each( |
| 00150 m_availableList.begin(), |
| 00151 m_availableList.end(), |
| 00152 <a class="code" href="classXalanObjectCache.html#m1">m_deleteFunctor</a>(theManager)); |
| 00153 } |
| 00154 |
| 00155 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* |
| 00156 <a class="code" href="classXalanObjectCache.html#a2">get</a>()<font class="keyword"></font> |
| 00157 <font class="keyword"> </font>{ |
| 00158 <font class="comment">// We'll always return the back of the free list, since</font> |
| 00159 <font class="comment">// that's the cheapest thing.</font> |
| 00160 <font class="keywordflow">if</font> (m_availableList.empty() == <font class="keyword">true</font>) |
| 00161 { |
| 00162 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* <font class="keyword">const</font> theNewObject = <a class="code" href="classXalanObjectCache.html#m0">m_createFunctor</a>(m_availableList.getMemoryManager()); |
| 00163 |
| 00164 m_busyList.push_back(theNewObject); |
| 00165 |
| 00166 <font class="keywordflow">return</font> theNewObject; |
| 00167 } |
| 00168 <font class="keywordflow">else</font> |
| 00169 { |
| 00170 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* <font class="keyword">const</font> theObject = m_availableList.back(); |
| 00171 |
| 00172 m_busyList.push_back(theObject); |
| 00173 |
| 00174 m_availableList.pop_back(); |
| 00175 |
| 00176 <font class="keywordflow">return</font> theObject; |
| 00177 } |
| 00178 } |
| 00179 |
| 00180 <font class="keywordtype">bool</font> |
| 00181 <a class="code" href="classXalanObjectCache.html#a3">release</a>(<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* theInstance)<font class="keyword"></font> |
| 00182 <font class="keyword"> </font>{ |
| 00183 <font class="preprocessor">#if !defined(XALAN_NO_STD_NAMESPACE)</font> |
| 00184 <font class="preprocessor"></font> <font class="keyword">using</font> std::find; |
| 00185 <font class="preprocessor">#endif</font> |
| 00186 <font class="preprocessor"></font> |
| 00187 <font class="keyword">typedef</font> <font class="keyword">typename</font> VectorType::iterator IteratorType; |
| 00188 |
| 00189 <font class="keyword">const</font> IteratorType i = |
| 00190 find( |
| 00191 m_busyList.begin(), |
| 00192 m_busyList.end(), |
| 00193 theInstance); |
| 00194 |
| 00195 <font class="keywordflow">if</font> (i == m_busyList.end()) |
| 00196 { |
| 00197 <font class="keywordflow">return</font> <font class="keyword">false</font>; |
| 00198 } |
| 00199 <font class="keywordflow">else</font> |
| 00200 { |
| 00201 <a class="code" href="classXalanObjectCache.html#m2">m_resetFunctor</a>(theInstance); |
| 00202 |
| 00203 m_availableList.push_back(theInstance); |
| 00204 |
| 00205 m_busyList.erase(i); |
| 00206 |
| 00207 <font class="keywordflow">return</font> <font class="keyword">true</font>; |
| 00208 } |
| 00209 } |
| 00210 |
| 00211 <font class="keywordtype">void</font> |
| 00212 <a class="code" href="classXalanObjectCache.html#a4">reset</a>()<font class="keyword"></font> |
| 00213 <font class="keyword"> </font>{ |
| 00214 <font class="keywordflow">while</font> (m_busyList.empty() == <font class="keyword">false</font>) |
| 00215 { |
| 00216 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* <font class="keyword">const</font> theInstance = m_busyList.back(); |
| 00217 |
| 00218 <a class="code" href="classXalanObjectCache.html#m2">m_resetFunctor</a>(theInstance); |
| 00219 |
| 00220 m_availableList.push_back(theInstance); |
| 00221 |
| 00222 m_busyList.pop_back(); |
| 00223 } |
| 00224 } |
| 00225 |
| 00226 <font class="comment">// Functors for various operations...</font> |
| 00227 CreateFunctorType m_createFunctor; |
| 00228 |
| 00229 <a class="code" href="structDeleteFunctor.html">DeleteFunctorType</a> m_deleteFunctor; |
| 00230 |
| 00231 ResetFunctorType m_resetFunctor; |
| 00232 |
| 00233 <font class="keyword">private</font>: |
| 00234 |
| 00235 <font class="comment">// There are not defined...</font> |
| 00236 <a class="code" href="classXalanObjectCache.html#a0">XalanObjectCache</a>(<font class="keyword">const</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType></a>& theRHS); |
| 00237 |
| 00238 <a class="code" href="classXalanObjectCache.html">XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType></a>& |
| 00239 operator=(<font class="keyword">const</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType></a>& theRHS); |
| 00240 |
| 00241 |
| 00242 <font class="comment">// Data members...</font> |
| 00243 VectorType m_availableList; |
| 00244 |
| 00245 VectorType m_busyList; |
| 00246 }; |
| 00247 |
| 00248 |
| 00249 |
| 00250 <font class="preprocessor">#else</font> |
| 00251 <font class="preprocessor"></font> |
| 00252 |
| 00253 |
| 00254 <font class="keyword">template</font>< |
| 00255 <font class="keyword">class </font><a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>, |
| 00256 <font class="preprocessor">#if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS)</font> |
| 00257 <font class="preprocessor"></font><font class="keyword">class </font>CreateFunctorType, |
| 00258 <font class="keyword">class </font><a class="code" href="structDeleteFunctor.html">DeleteFunctorType</a>, |
| 00259 <font class="keyword">class </font>ResetFunctorType> |
| 00260 <font class="preprocessor">#else</font> |
| 00261 <font class="preprocessor"></font><font class="keyword">class </font>CreateFunctorType = <a class="code" href="classDefaultCacheCreateFunctor.html">DefaultCacheCreateFunctor</a><<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>>, |
| 00262 class <a class="code" href="structDeleteFunctor.html">DeleteFunctorType</a> = <a class="code" href="structDeleteFunctor.html">DeleteFunctor</a><<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>>, |
| 00263 class ResetFunctorType = <a class="code" href="classDefaultCacheResetFunctor.html">DefaultCacheResetFunctor</a><<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>> > |
| 00264 #endif |
| <a name="l00265"></a><a class="code" href="classXalanObjectCache.html">00265</a> class <a class="code" href="classXalanObjectCache.html">XalanObjectCache</a> |
| 00266 { |
| 00267 <font class="keyword">public</font>: |
| 00268 |
| <a name="l00269"></a><a class="code" href="classXalanObjectCache.html#s0">00269</a> <font class="keyword">typedef</font> XalanVector<ObjectType*> VectorType; |
| 00270 |
| <a name="l00271"></a><a class="code" href="classXalanObjectCache.html#s1">00271</a> <font class="keyword">typedef</font> <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a> <a class="code" href="classXalanSourceTreeAttr.html">CacheObjectType</a>; |
| 00272 |
| 00273 <font class="keyword">explicit</font> |
| <a name="l00274"></a><a class="code" href="classXalanObjectCache.html#a0">00274</a> <a class="code" href="classXalanObjectCache.html#a0">XalanObjectCache</a>(MemoryManagerType& theManager, |
| 00275 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> initialListSize = 0) : |
| 00276 m_deleteFunctor(theManager), |
| 00277 m_availableList(theManager) |
| 00278 { |
| 00279 m_availableList.reserve(initialListSize); |
| 00280 } |
| 00281 |
| <a name="l00282"></a><a class="code" href="classXalanObjectCache.html#a1">00282</a> <a class="code" href="classXalanObjectCache.html#a1">~XalanObjectCache</a>()<font class="keyword"></font> |
| 00283 <font class="keyword"> </font>{ |
| 00284 <a class="code" href="classXalanObjectCache.html#a4">reset</a>(); |
| 00285 |
| 00286 <font class="preprocessor">#if !defined(XALAN_NO_STD_NAMESPACE)</font> |
| 00287 <font class="preprocessor"></font> <font class="keyword">using</font> std::for_each; |
| 00288 <font class="preprocessor">#endif</font> |
| 00289 <font class="preprocessor"></font> |
| 00290 for_each( |
| 00291 m_availableList.begin(), |
| 00292 m_availableList.end(), |
| 00293 m_deleteFunctor); |
| 00294 } |
| 00295 |
| 00296 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* |
| <a name="l00297"></a><a class="code" href="classXalanObjectCache.html#a2">00297</a> <a class="code" href="classXalanObjectCache.html#a2">get</a>()<font class="keyword"></font> |
| 00298 <font class="keyword"> </font>{ |
| 00299 <font class="comment">// We'll always return the back of the free list, since</font> |
| 00300 <font class="comment">// that's the cheapest thing.</font> |
| 00301 <font class="keywordflow">if</font> (m_availableList.empty() == <font class="keyword">true</font>) |
| 00302 { |
| 00303 <font class="keywordflow">return</font> <a class="code" href="classXalanObjectCache.html#m0">m_createFunctor</a>(m_availableList.getMemoryManager()); |
| 00304 } |
| 00305 <font class="keywordflow">else</font> |
| 00306 { |
| 00307 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* <font class="keyword">const</font> theObject = m_availableList.back(); |
| 00308 |
| 00309 m_availableList.pop_back(); |
| 00310 |
| 00311 <font class="keywordflow">return</font> theObject; |
| 00312 } |
| 00313 } |
| 00314 |
| 00315 <font class="keywordtype">bool</font> |
| <a name="l00316"></a><a class="code" href="classXalanObjectCache.html#a3">00316</a> <a class="code" href="classXalanObjectCache.html#a3">release</a>(<a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>* theInstance)<font class="keyword"></font> |
| 00317 <font class="keyword"> </font>{ |
| 00318 <a class="code" href="classXalanObjectCache.html#m2">m_resetFunctor</a>(theInstance); |
| 00319 |
| 00320 m_availableList.push_back(theInstance); |
| 00321 |
| 00322 <font class="keywordflow">return</font> <font class="keyword">true</font>; |
| 00323 } |
| 00324 |
| 00325 <font class="keywordtype">void</font> |
| <a name="l00326"></a><a class="code" href="classXalanObjectCache.html#a4">00326</a> <a class="code" href="classXalanObjectCache.html#a4">reset</a>()<font class="keyword"></font> |
| 00327 <font class="keyword"> </font>{ |
| 00328 } |
| 00329 |
| 00330 <font class="comment">// Functors for various operations...</font> |
| <a name="l00331"></a><a class="code" href="classXalanObjectCache.html#m0">00331</a> CreateFunctorType m_createFunctor; |
| 00332 |
| <a name="l00333"></a><a class="code" href="classXalanObjectCache.html#m1">00333</a> <a class="code" href="structDeleteFunctor.html">DeleteFunctorType</a> m_deleteFunctor; |
| 00334 |
| <a name="l00335"></a><a class="code" href="classXalanObjectCache.html#m2">00335</a> ResetFunctorType m_resetFunctor; |
| 00336 |
| 00337 <font class="keyword">private</font>: |
| 00338 |
| 00339 <font class="comment">// These are not defined...</font> |
| 00340 <a class="code" href="classXalanObjectCache.html#a0">XalanObjectCache</a>(<font class="keyword">const</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType></a>& theRHS); |
| 00341 |
| 00342 <a class="code" href="classXalanObjectCache.html">XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType></a>& |
| 00343 operator=(<font class="keyword">const</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType></a>& theRHS); |
| 00344 |
| 00345 |
| 00346 <font class="comment">// Data members...</font> |
| 00347 VectorType m_availableList; |
| 00348 }; |
| 00349 |
| 00350 |
| 00351 |
| 00352 <font class="preprocessor">#endif</font> |
| 00353 <font class="preprocessor"></font> |
| 00354 |
| 00355 |
| 00356 template<class XalanObjectCacheType> |
| <a name="l00357"></a><a class="code" href="classGuardCachedObject.html">00357</a> <font class="keyword">class </font><a class="code" href="classGuardCachedObject.html">GuardCachedObject</a> |
| 00358 { |
| 00359 <font class="keyword">public</font>: |
| 00360 |
| <a name="l00361"></a><a class="code" href="classGuardCachedObject.html#s0">00361</a> <font class="keyword">typedef</font> <font class="keyword">typename</font> XalanObjectCacheType::CacheObjectType <a class="code" href="classXalanSourceTreeAttr.html">CacheObjectType</a>; |
| 00362 |
| <a name="l00363"></a><a class="code" href="classGuardCachedObject.html#a0">00363</a> <a class="code" href="classGuardCachedObject.html#a0">GuardCachedObject</a>(XalanObjectCacheType& theCache) : |
| 00364 m_cache(theCache), |
| 00365 m_cachedObject(theCache.get()) |
| 00366 { |
| 00367 } |
| 00368 |
| <a name="l00369"></a><a class="code" href="classGuardCachedObject.html#a1">00369</a> <a class="code" href="classGuardCachedObject.html#a1">~GuardCachedObject</a>()<font class="keyword"></font> |
| 00370 <font class="keyword"> </font>{ |
| 00371 <font class="keywordflow">if</font> (m_cachedObject != 0) |
| 00372 { |
| 00373 m_cache.release(m_cachedObject); |
| 00374 } |
| 00375 } |
| 00376 |
| 00377 <a class="code" href="classXalanSourceTreeAttr.html">CacheObjectType</a>* |
| <a name="l00378"></a><a class="code" href="classGuardCachedObject.html#a2">00378</a> <a class="code" href="classGuardCachedObject.html#a2">get</a>()<font class="keyword"> const</font> |
| 00379 <font class="keyword"> </font>{ |
| 00380 <font class="keywordflow">return</font> m_cachedObject; |
| 00381 } |
| 00382 |
| 00383 <a class="code" href="classXalanSourceTreeAttr.html">CacheObjectType</a>* |
| <a name="l00384"></a><a class="code" href="classGuardCachedObject.html#a3">00384</a> <a class="code" href="classGuardCachedObject.html#a3">release</a>()<font class="keyword"></font> |
| 00385 <font class="keyword"> </font>{ |
| 00386 <a class="code" href="classXalanSourceTreeAttr.html">CacheObjectType</a>* <font class="keyword">const</font> temp = m_cachedObject; |
| 00387 |
| 00388 m_cachedObject = 0; |
| 00389 |
| 00390 <font class="keywordflow">return</font> temp; |
| 00391 } |
| 00392 |
| 00393 <font class="keyword">private</font>: |
| 00394 |
| 00395 <font class="comment">// Not implemented...</font> |
| 00396 <a class="code" href="classGuardCachedObject.html#a0">GuardCachedObject</a>(<font class="keyword">const</font> <a class="code" href="classGuardCachedObject.html">GuardCachedObject<XalanObjectCacheType></a>&); |
| 00397 |
| 00398 |
| 00399 <font class="comment">// Data members...</font> |
| 00400 XalanObjectCacheType& m_cache; |
| 00401 |
| 00402 <a class="code" href="classXalanSourceTreeAttr.html">CacheObjectType</a>* m_cachedObject; |
| 00403 }; |
| 00404 |
| 00405 |
| 00406 |
| 00407 template<class ObjectType> |
| <a name="l00408"></a><a class="code" href="classXalanObjectCacheDefault.html">00408</a> <font class="keyword">class </font><a class="code" href="classXalanObjectCacheDefault.html">XalanObjectCacheDefault</a> : |
| 00409 <font class="keyword">public</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache</a>< |
| 00410 ObjectType, |
| 00411 DefaultCacheCreateFunctor<ObjectType>, |
| 00412 DeleteFunctor<ObjectType>, |
| 00413 DefaultCacheResetFunctor<ObjectType> > |
| 00414 { |
| 00415 <font class="keyword">public</font>: |
| 00416 |
| 00417 <font class="keyword">typedef</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache</a>< |
| 00418 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>, |
| 00419 <a class="code" href="classDefaultCacheCreateFunctor.html">DefaultCacheCreateFunctor<ObjectType></a>, |
| 00420 <a class="code" href="structDeleteFunctor.html">DeleteFunctor<ObjectType></a>, |
| <a name="l00421"></a><a class="code" href="classXalanObjectCacheDefault.html#s0">00421</a> <a class="code" href="classDefaultCacheResetFunctor.html">DefaultCacheResetFunctor<ObjectType></a> > <a class="code" href="classstd_1_1unary__function.html">BaseClassType</a>; |
| 00422 |
| 00423 <font class="keyword">explicit</font> |
| <a name="l00424"></a><a class="code" href="classXalanObjectCacheDefault.html#a0">00424</a> <a class="code" href="classXalanObjectCacheDefault.html#a0">XalanObjectCacheDefault</a>( |
| 00425 MemoryManagerType& theManager, |
| 00426 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> initialListSize = 0) : |
| 00427 <a class="code" href="classstd_1_1unary__function.html">BaseClassType</a>(theManager, initialListSize) |
| 00428 { |
| 00429 } |
| 00430 }; |
| 00431 |
| 00432 |
| 00433 |
| 00434 template<class ObjectType> |
| <a name="l00435"></a><a class="code" href="classXalanMemoryManagerObjectCacheDefault.html">00435</a> <font class="keyword">class </font><a class="code" href="classXalanMemoryManagerObjectCacheDefault.html">XalanMemoryManagerObjectCacheDefault</a> : |
| 00436 <font class="keyword">public</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache</a>< |
| 00437 ObjectType, |
| 00438 DefaultCacheCreateFunctorMemMgr<ObjectType>, |
| 00439 DeleteFunctor<ObjectType>, |
| 00440 DefaultCacheResetFunctor<ObjectType> > |
| 00441 { |
| 00442 <font class="keyword">public</font>: |
| 00443 |
| 00444 <font class="keyword">typedef</font> <a class="code" href="classXalanObjectCache.html">XalanObjectCache</a>< |
| 00445 <a class="code" href="classXalanSourceTreeAttr.html">ObjectType</a>, |
| 00446 <a class="code" href="classDefaultCacheCreateFunctorMemMgr.html">DefaultCacheCreateFunctorMemMgr<ObjectType></a>, |
| 00447 <a class="code" href="structDeleteFunctor.html">DeleteFunctor<ObjectType></a>, |
| <a name="l00448"></a><a class="code" href="classXalanMemoryManagerObjectCacheDefault.html#s0">00448</a> <a class="code" href="classDefaultCacheResetFunctor.html">DefaultCacheResetFunctor<ObjectType></a> > <a class="code" href="classstd_1_1unary__function.html">BaseClassType</a>; |
| 00449 |
| 00450 <font class="keyword">explicit</font> |
| <a name="l00451"></a><a class="code" href="classXalanMemoryManagerObjectCacheDefault.html#a0">00451</a> <a class="code" href="classXalanMemoryManagerObjectCacheDefault.html#a0">XalanMemoryManagerObjectCacheDefault</a>( |
| 00452 MemoryManagerType& theManager, |
| 00453 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> initialListSize = 0) : |
| 00454 <a class="code" href="classstd_1_1unary__function.html">BaseClassType</a>(theManager, initialListSize) |
| 00455 { |
| 00456 } |
| 00457 }; |
| 00458 |
| 00459 |
| 00460 |
| 00461 XALAN_CPP_NAMESPACE_END |
| 00462 |
| 00463 |
| 00464 |
| 00465 <font class="preprocessor">#endif</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 © 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>
|