425 lines
42 KiB
HTML
425 lines
42 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>XQilla Simple API Documentation</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<a style="float:right;" href="http://sourceforge.net/projects/xqilla"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=152021&type=2" border="0" alt="SourceForge.net Logo" /></a>
|
|
<!-- Generated by Doxygen 1.5.5 -->
|
|
<div class="navigation" id="top">
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li><a href="classes.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<h1>XPath2MemoryManager.hpp</h1><a href="XPath2MemoryManager_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
|
|
<a name="l00002"></a>00002 <span class="comment"> * Copyright (c) 2001-2008</span>
|
|
<a name="l00003"></a>00003 <span class="comment"> * DecisionSoft Limited. All rights reserved.</span>
|
|
<a name="l00004"></a>00004 <span class="comment"> * Copyright (c) 2004-2008</span>
|
|
<a name="l00005"></a>00005 <span class="comment"> * Oracle. All rights reserved.</span>
|
|
<a name="l00006"></a>00006 <span class="comment"> *</span>
|
|
<a name="l00007"></a>00007 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
|
|
<a name="l00008"></a>00008 <span class="comment"> * you may not use this file except in compliance with the License.</span>
|
|
<a name="l00009"></a>00009 <span class="comment"> * You may obtain a copy of the License at</span>
|
|
<a name="l00010"></a>00010 <span class="comment"> *</span>
|
|
<a name="l00011"></a>00011 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
|
|
<a name="l00012"></a>00012 <span class="comment"> *</span>
|
|
<a name="l00013"></a>00013 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
|
|
<a name="l00014"></a>00014 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
|
|
<a name="l00015"></a>00015 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
|
|
<a name="l00016"></a>00016 <span class="comment"> * See the License for the specific language governing permissions and</span>
|
|
<a name="l00017"></a>00017 <span class="comment"> * limitations under the License.</span>
|
|
<a name="l00018"></a>00018 <span class="comment"> *</span>
|
|
<a name="l00019"></a>00019 <span class="comment"> * $Id: XPath2MemoryManager.hpp 688 2008-11-27 02:45:23Z caiying $</span>
|
|
<a name="l00020"></a>00020 <span class="comment"> */</span>
|
|
<a name="l00021"></a>00021
|
|
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef __XPATH2MEMORYMANAGER_HPP</span>
|
|
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define __XPATH2MEMORYMANAGER_HPP</span>
|
|
<a name="l00024"></a>00024 <span class="preprocessor"></span>
|
|
<a name="l00025"></a>00025 <span class="preprocessor">#include <algorithm></span>
|
|
<a name="l00026"></a>00026 <span class="preprocessor">#include <assert.h></span>
|
|
<a name="l00027"></a>00027
|
|
<a name="l00028"></a>00028 <span class="preprocessor">#include <xqilla/framework/XQillaExport.hpp></span>
|
|
<a name="l00029"></a>00029
|
|
<a name="l00030"></a>00030 <span class="preprocessor">#include <<a class="code" href="MemoryManager_8hpp.html">xercesc/framework/MemoryManager.hpp</a>></span>
|
|
<a name="l00031"></a>00031
|
|
<a name="l00032"></a>00032 XERCES_CPP_NAMESPACE_BEGIN
|
|
<a name="l00033"></a>00033 <span class="keyword">class </span>DOMNode;
|
|
<a name="l00034"></a>00034 <span class="keyword">class </span>XMLGrammarPool;
|
|
<a name="l00035"></a>00035 XERCES_CPP_NAMESPACE_END
|
|
<a name="l00036"></a>00036
|
|
<a name="l00037"></a>00037 <span class="keyword">class </span><a class="code" href="classVariableStore.html" title="The pure virtual base class for accessing variables at runtime.">VariableStore</a>;
|
|
<a name="l00038"></a>00038 <span class="keyword">class </span><a class="code" href="classVariableTypeStore.html" title="This is the wrapper class for the variable store, which implements the lookup and...">VariableTypeStore</a>;
|
|
<a name="l00039"></a>00039 <span class="keyword">class </span><a class="code" href="classDynamicContext.html" title="The execution time dynamic context interface.">DynamicContext</a>;
|
|
<a name="l00040"></a>00040 <span class="keyword">class </span><a class="code" href="classCollation.html">Collation</a>;
|
|
<a name="l00041"></a>00041 <span class="keyword">class </span>CollationHelper;
|
|
<a name="l00042"></a>00042 <span class="keyword">class </span>XQillaNSResolver;
|
|
<a name="l00043"></a>00043 <span class="keyword">class </span><a class="code" href="classATDecimalOrDerived.html">ATDecimalOrDerived</a>;
|
|
<a name="l00044"></a>00044 <span class="keyword">class </span><a class="code" href="classStringPool.html">StringPool</a>;
|
|
<a name="l00045"></a>00045
|
|
<a name="l00046"></a><a class="code" href="classXPath2MemoryManager.html">00046</a> <span class="keyword">class </span>XQILLA_API <a class="code" href="classXPath2MemoryManager.html">XPath2MemoryManager</a> : <span class="keyword">public</span> XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager
|
|
<a name="l00047"></a>00047 {
|
|
<a name="l00048"></a>00048 <span class="keyword">public</span>:
|
|
<a name="l00049"></a><a class="code" href="classXPath2MemoryManager.html#2a42454955f541092df5332858ff284c">00049</a> <span class="keyword">virtual</span> ~<a class="code" href="classXPath2MemoryManager.html">XPath2MemoryManager</a>() {}
|
|
<a name="l00050"></a>00050
|
|
<a name="l00052"></a>00052 <span class="keyword">virtual</span> <span class="keywordtype">void</span> reset() = 0;
|
|
<a name="l00053"></a>00053
|
|
<a name="l00055"></a>00055 <span class="keyword">virtual</span> <span class="keyword">const</span> XMLCh* getPooledString(<span class="keyword">const</span> XMLCh *src) = 0;
|
|
<a name="l00056"></a>00056 <span class="keyword">virtual</span> <span class="keyword">const</span> XMLCh* getPooledString(<span class="keyword">const</span> XMLCh *src, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length) = 0;
|
|
<a name="l00057"></a>00057 <span class="keyword">virtual</span> <span class="keyword">const</span> XMLCh* getPooledString(<span class="keyword">const</span> <span class="keywordtype">char</span> *src) = 0;
|
|
<a name="l00058"></a>00058
|
|
<a name="l00059"></a>00059 <span class="comment">// from MemoryManager</span>
|
|
<a name="l00060"></a>00060 <span class="preprocessor">#if _XERCES_VERSION >= 30000</span>
|
|
<a name="l00061"></a>00061 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span>* allocate(XMLSize_t numElements) = 0;
|
|
<a name="l00062"></a>00062 <span class="preprocessor">#else</span>
|
|
<a name="l00063"></a>00063 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span>* allocate(<span class="keywordtype">size_t</span> numElements) = 0;
|
|
<a name="l00064"></a>00064 <span class="preprocessor">#endif </span>
|
|
<a name="l00065"></a>00065 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> deallocate(<span class="keywordtype">void</span>* p) = 0;
|
|
<a name="l00066"></a>00066
|
|
<a name="l00068"></a>00068 <span class="keyword">virtual</span> <a class="code" href="classCollation.html">Collation</a>* createCollation(CollationHelper* helper) = 0;
|
|
<a name="l00069"></a>00069
|
|
<a name="l00071"></a>00071 <span class="keyword">virtual</span> XQillaNSResolver* createNSResolver(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *resolverNode) = 0;
|
|
<a name="l00072"></a>00072
|
|
<a name="l00074"></a>00074 <span class="keyword">virtual</span> <a class="code" href="classVariableTypeStore.html" title="This is the wrapper class for the variable store, which implements the lookup and...">VariableTypeStore</a>* createVariableTypeStore() = 0;
|
|
<a name="l00075"></a>00075
|
|
<a name="l00077"></a>00077 <span class="keyword">virtual</span> <a class="code" href="classATDecimalOrDerived.html">ATDecimalOrDerived</a>* createInteger(<span class="keywordtype">int</span> value) = 0;
|
|
<a name="l00078"></a>00078
|
|
<a name="l00079"></a>00079 <span class="keyword">virtual</span> <span class="keywordtype">void</span> dumpStatistics() <span class="keyword">const</span> = 0;
|
|
<a name="l00080"></a>00080 <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> getAllocatedObjectCount() <span class="keyword">const</span> = 0;
|
|
<a name="l00081"></a>00081 <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> getTotalAllocatedMemory() <span class="keyword">const</span> = 0;
|
|
<a name="l00082"></a>00082 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classStringPool.html">StringPool</a> *getStringPool() <span class="keyword">const</span> = 0;
|
|
<a name="l00083"></a>00083 };<span class="comment">//XPath2MemoryManager</span>
|
|
<a name="l00084"></a>00084
|
|
<a name="l00085"></a>00085 <span class="keyword">template</span> <<span class="keyword">class</span> _Tp>
|
|
<a name="l00086"></a><a class="code" href="classXQillaAllocator.html">00086</a> <span class="keyword">class </span><a class="code" href="classXQillaAllocator.html">XQillaAllocator</a>
|
|
<a name="l00087"></a>00087 {
|
|
<a name="l00088"></a>00088 <span class="keyword">public</span>:
|
|
<a name="l00089"></a><a class="code" href="classXQillaAllocator.html#276f8d8b17823fd320eb80e37a09c4dd">00089</a> <span class="keyword">typedef</span> <span class="keywordtype">size_t</span> <a class="code" href="classXQillaAllocator.html#276f8d8b17823fd320eb80e37a09c4dd">size_type</a>;
|
|
<a name="l00090"></a><a class="code" href="classXQillaAllocator.html#89df7c8392d644bcde141dcd602110f4">00090</a> <span class="keyword">typedef</span> ptrdiff_t <a class="code" href="classXQillaAllocator.html#89df7c8392d644bcde141dcd602110f4">difference_type</a>;
|
|
<a name="l00091"></a><a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">00091</a> <span class="keyword">typedef</span> _Tp* <a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">pointer</a>;
|
|
<a name="l00092"></a><a class="code" href="classXQillaAllocator.html#cec548af851f23a1984b99cf37614235">00092</a> <span class="keyword">typedef</span> <span class="keyword">const</span> _Tp* <a class="code" href="classXQillaAllocator.html#cec548af851f23a1984b99cf37614235">const_pointer</a>;
|
|
<a name="l00093"></a><a class="code" href="classXQillaAllocator.html#4d10ef0e016a60698016ed4bd730817e">00093</a> <span class="keyword">typedef</span> _Tp& <a class="code" href="classXQillaAllocator.html#4d10ef0e016a60698016ed4bd730817e">reference</a>;
|
|
<a name="l00094"></a><a class="code" href="classXQillaAllocator.html#d77181acbd0fe45a361f5a7ef75cee7d">00094</a> <span class="keyword">typedef</span> <span class="keyword">const</span> _Tp& <a class="code" href="classXQillaAllocator.html#d77181acbd0fe45a361f5a7ef75cee7d">const_reference</a>;
|
|
<a name="l00095"></a><a class="code" href="classXQillaAllocator.html#c1fe0b1a3f5533725c65e9a22fbe1330">00095</a> <span class="keyword">typedef</span> _Tp <a class="code" href="classXQillaAllocator.html#c1fe0b1a3f5533725c65e9a22fbe1330">value_type</a>;
|
|
<a name="l00096"></a>00096
|
|
<a name="l00097"></a><a class="code" href="structXQillaAllocator_1_1rebind.html">00097</a> <span class="keyword">template</span> <<span class="keyword">class</span> _Tp1> <span class="keyword">struct </span><a class="code" href="structXQillaAllocator_1_1rebind.html">rebind</a> {
|
|
<a name="l00098"></a><a class="code" href="structXQillaAllocator_1_1rebind.html#5dc95c37a843ba22e4b0c913984e295b">00098</a> <span class="keyword">typedef</span> <a class="code" href="classXQillaAllocator.html">XQillaAllocator<_Tp1></a> <a class="code" href="classXQillaAllocator.html">other</a>;
|
|
<a name="l00099"></a>00099 };
|
|
<a name="l00100"></a>00100
|
|
<a name="l00101"></a>00101 <span class="comment">// Should never be used - for compiling on AIX only</span>
|
|
<a name="l00102"></a><a class="code" href="classXQillaAllocator.html#f520219abb4c15f9310a39932cfeedae">00102</a> <a class="code" href="classXQillaAllocator.html#f520219abb4c15f9310a39932cfeedae">XQillaAllocator</a>()
|
|
<a name="l00103"></a>00103 {
|
|
<a name="l00104"></a>00104 assert(<span class="keyword">false</span>);
|
|
<a name="l00105"></a>00105 }
|
|
<a name="l00106"></a>00106
|
|
<a name="l00107"></a><a class="code" href="classXQillaAllocator.html#76a14cd5932cbf00888a2d8ac3453c5d">00107</a> <a class="code" href="classXQillaAllocator.html#f520219abb4c15f9310a39932cfeedae">XQillaAllocator</a>(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr)
|
|
<a name="l00108"></a>00108 {
|
|
<a name="l00109"></a>00109 <a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>=memMgr;
|
|
<a name="l00110"></a>00110 }
|
|
<a name="l00111"></a>00111
|
|
<a name="l00112"></a>00112 <span class="comment">// define a copy constructor, because we don't want to copy the singleton object</span>
|
|
<a name="l00113"></a><a class="code" href="classXQillaAllocator.html#8c8b5274bae995052ab04cf48f6340f8">00113</a> <a class="code" href="classXQillaAllocator.html#f520219abb4c15f9310a39932cfeedae">XQillaAllocator</a>(<span class="keyword">const</span> <a class="code" href="classXQillaAllocator.html">XQillaAllocator<_Tp></a>& o)
|
|
<a name="l00114"></a>00114 {
|
|
<a name="l00115"></a>00115 <a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>=o.<a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>;
|
|
<a name="l00116"></a>00116 }
|
|
<a name="l00117"></a>00117 <span class="preprocessor">#if _MSC_VER >= 1500</span>
|
|
<a name="l00118"></a>00118 <span class="preprocessor"></span> <span class="comment">// Needed for Visual Studio 2008 </span>
|
|
<a name="l00119"></a>00119 <span class="keyword">template</span><<span class="keyword">class</span> _Tp1> <a class="code" href="classXQillaAllocator.html#f520219abb4c15f9310a39932cfeedae">XQillaAllocator</a>(<span class="keyword">const</span> <a class="code" href="classXQillaAllocator.html">XQillaAllocator<_Tp1></a>& o)
|
|
<a name="l00120"></a>00120 {
|
|
<a name="l00121"></a>00121 <a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a> = o.<a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>;
|
|
<a name="l00122"></a>00122 }
|
|
<a name="l00123"></a>00123 <span class="preprocessor">#endif</span>
|
|
<a name="l00124"></a><a class="code" href="classXQillaAllocator.html#f70c2dfdd0ad6102bd10dbdc34e302aa">00124</a> <span class="preprocessor"></span> <a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">pointer</a> <a class="code" href="classXQillaAllocator.html#f70c2dfdd0ad6102bd10dbdc34e302aa">allocate</a>(<span class="keywordtype">size_t</span> _n, <span class="keyword">const</span> <span class="keywordtype">void</span>* = 0)
|
|
<a name="l00125"></a>00125 {
|
|
<a name="l00126"></a>00126 <span class="keywordflow">if</span>(_n==1)
|
|
<a name="l00127"></a>00127 <span class="keywordflow">return</span> (<a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">pointer</a>)<a class="code" href="classXQillaAllocator.html#e64ca33304db228d5eae2397710ef4d0">_singleton</a>;
|
|
<a name="l00128"></a>00128 <span class="comment">//std::cout << "XQillaAllocator::allocate(" << _n << ")" << std::endl;</span>
|
|
<a name="l00129"></a>00129 <span class="keywordflow">if</span>(<a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>)
|
|
<a name="l00130"></a>00130 <span class="keywordflow">return</span> _n != 0 ? <span class="keyword">static_cast<</span><a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">pointer</a><span class="keyword">></span>(<a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>-><a class="code" href="classxercesc_1_1MemoryManager.html#b6bbb5b604d2159e7ccc4532e4f422af" title="This method allocates requested memory.">allocate</a>(_n*<span class="keyword">sizeof</span>(_Tp))) : 0;
|
|
<a name="l00131"></a>00131 <span class="keywordflow">else</span>
|
|
<a name="l00132"></a>00132 <span class="keywordflow">return</span> _n != 0 ? <span class="keyword">static_cast<</span><a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">pointer</a><span class="keyword">></span>(malloc(_n*<span class="keyword">sizeof</span>(_Tp))) : 0;
|
|
<a name="l00133"></a>00133 }
|
|
<a name="l00134"></a>00134
|
|
<a name="l00135"></a><a class="code" href="classXQillaAllocator.html#7dd8460bfe7d0cb32ddaeae25285cc6e">00135</a> <span class="keywordtype">void</span> <a class="code" href="classXQillaAllocator.html#7dd8460bfe7d0cb32ddaeae25285cc6e">deallocate</a>(<span class="keywordtype">void</span>* _p, <span class="keywordtype">size_t</span> _n)
|
|
<a name="l00136"></a>00136 {
|
|
<a name="l00137"></a>00137 <span class="comment">//std::cout << "XQillaAllocator::deallocate(" << _n << ")" << std::endl;</span>
|
|
<a name="l00138"></a>00138 <span class="keywordflow">if</span>(_p) {
|
|
<a name="l00139"></a>00139 <span class="keywordflow">if</span>(_p!=<a class="code" href="classXQillaAllocator.html#e64ca33304db228d5eae2397710ef4d0">_singleton</a>) {
|
|
<a name="l00140"></a>00140 <span class="keywordflow">if</span>(<a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>)
|
|
<a name="l00141"></a>00141 <a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>-><a class="code" href="classxercesc_1_1MemoryManager.html#4fd46b0b3634cf5540170ff3dcdfc414" title="This method deallocates memory.">deallocate</a>(_p);
|
|
<a name="l00142"></a>00142 <span class="keywordflow">else</span>
|
|
<a name="l00143"></a>00143 free(_p);
|
|
<a name="l00144"></a>00144 }
|
|
<a name="l00145"></a>00145 }
|
|
<a name="l00146"></a>00146 }
|
|
<a name="l00147"></a>00147
|
|
<a name="l00148"></a><a class="code" href="classXQillaAllocator.html#42ebac999fcbd730f22c9135934b2b58">00148</a> <span class="keywordtype">void</span> <a class="code" href="classXQillaAllocator.html#42ebac999fcbd730f22c9135934b2b58">construct</a>(<a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">pointer</a> _p, <a class="code" href="classXQillaAllocator.html#d77181acbd0fe45a361f5a7ef75cee7d">const_reference</a> _v)
|
|
<a name="l00149"></a>00149 {
|
|
<a name="l00150"></a>00150 <span class="keyword">new</span> ((<span class="keywordtype">void</span> *)_p) _Tp(_v);
|
|
<a name="l00151"></a>00151 }
|
|
<a name="l00152"></a>00152
|
|
<a name="l00153"></a><a class="code" href="classXQillaAllocator.html#3a2d8454aacf52e2300d64dc24217149">00153</a> <span class="keywordtype">void</span> <a class="code" href="classXQillaAllocator.html#3a2d8454aacf52e2300d64dc24217149">destroy</a>(<a class="code" href="classXQillaAllocator.html#81d4c25067e642232a9f16e8996a0cd2">pointer</a> _p)
|
|
<a name="l00154"></a>00154 {
|
|
<a name="l00155"></a>00155 _p->~_Tp();
|
|
<a name="l00156"></a>00156 }
|
|
<a name="l00157"></a>00157
|
|
<a name="l00158"></a><a class="code" href="classXQillaAllocator.html#c05c18680abff04d434652d4b027574f">00158</a> <a class="code" href="classXQillaAllocator.html#276f8d8b17823fd320eb80e37a09c4dd">size_type</a> <a class="code" href="classXQillaAllocator.html#c05c18680abff04d434652d4b027574f">max_size</a>()<span class="keyword"> const</span>
|
|
<a name="l00159"></a>00159 <span class="keyword"> </span>{
|
|
<a name="l00160"></a>00160 <span class="keywordflow">return</span> 0xFFFFFFFF;
|
|
<a name="l00161"></a>00161 }
|
|
<a name="l00162"></a>00162
|
|
<a name="l00163"></a><a class="code" href="classXQillaAllocator.html#06de1403cc59ae912772456f5b2fd9ed">00163</a> <a class="code" href="classXQillaAllocator.html#276f8d8b17823fd320eb80e37a09c4dd">size_type</a> <a class="code" href="classXQillaAllocator.html#c05c18680abff04d434652d4b027574f">max_size</a>(<a class="code" href="classXQillaAllocator.html#276f8d8b17823fd320eb80e37a09c4dd">size_type</a>)<span class="keyword"> const</span>
|
|
<a name="l00164"></a>00164 <span class="keyword"> </span>{
|
|
<a name="l00165"></a>00165 <span class="keywordflow">return</span> 0xFFFFFFFF;
|
|
<a name="l00166"></a>00166 }
|
|
<a name="l00167"></a>00167
|
|
<a name="l00168"></a><a class="code" href="classXQillaAllocator.html#e64ca33304db228d5eae2397710ef4d0">00168</a> <span class="keywordtype">char</span> <a class="code" href="classXQillaAllocator.html#e64ca33304db228d5eae2397710ef4d0">_singleton</a>[<span class="keyword">sizeof</span>(_Tp)];
|
|
<a name="l00169"></a><a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">00169</a> XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* <a class="code" href="classXQillaAllocator.html#d3f8310a45fd563d33a55e9542100fa9">_memMgr</a>;
|
|
<a name="l00170"></a>00170 };
|
|
<a name="l00171"></a>00171
|
|
<a name="l00172"></a>00172 <span class="comment">// ---------------------------------------------------------------------------</span>
|
|
<a name="l00173"></a>00173 <span class="comment">//</span>
|
|
<a name="l00174"></a>00174 <span class="comment">// Operator new. Global overloaded version, lets any object be allocated on</span>
|
|
<a name="l00175"></a>00175 <span class="comment">// the heap owned by a MemoryManager.</span>
|
|
<a name="l00176"></a>00176 <span class="comment">//</span>
|
|
<a name="l00177"></a>00177 <span class="comment">// ---------------------------------------------------------------------------</span>
|
|
<a name="l00178"></a><a class="code" href="XPath2MemoryManager_8hpp.html#167311a5bb3ed59f0f906d097e3a3363">00178</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> * <a class="code" href="XPath2MemoryManager_8hpp.html#167311a5bb3ed59f0f906d097e3a3363">operator new</a>(<span class="keywordtype">size_t</span> amt, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr)
|
|
<a name="l00179"></a>00179 {
|
|
<a name="l00180"></a>00180 <span class="keywordtype">void</span> *p = memMgr->allocate(amt);
|
|
<a name="l00181"></a>00181 <span class="keywordflow">return</span> p;
|
|
<a name="l00182"></a>00182 }
|
|
<a name="l00183"></a>00183
|
|
<a name="l00184"></a><a class="code" href="XPath2MemoryManager_8hpp.html#e9e5a8b04973d492638fe3eb86f466f7">00184</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="XPath2MemoryManager_8hpp.html#e9e5a8b04973d492638fe3eb86f466f7">operator delete</a>(<span class="keywordtype">void</span>* ptr, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr)
|
|
<a name="l00185"></a>00185 {
|
|
<a name="l00186"></a>00186 memMgr->deallocate(ptr);
|
|
<a name="l00187"></a>00187 }
|
|
<a name="l00188"></a>00188
|
|
<a name="l00189"></a>00189 <span class="keyword">template</span><<span class="keyword">class</span> TYPE>
|
|
<a name="l00190"></a><a class="code" href="classAutoRelease.html">00190</a> <span class="keyword">class </span><a class="code" href="classAutoRelease.html">AutoRelease</a>
|
|
<a name="l00191"></a>00191 {
|
|
<a name="l00192"></a>00192 <span class="keyword">public</span>:
|
|
<a name="l00193"></a><a class="code" href="classAutoRelease.html#686c035fad9b8aa2974261c7251bb672">00193</a> <a class="code" href="classAutoRelease.html#686c035fad9b8aa2974261c7251bb672">AutoRelease</a>(TYPE *p)
|
|
<a name="l00194"></a>00194 : p_(p) {}
|
|
<a name="l00195"></a><a class="code" href="classAutoRelease.html#9ee0c67d727350665894472e292524e3">00195</a> <a class="code" href="classAutoRelease.html#9ee0c67d727350665894472e292524e3">~AutoRelease</a>()
|
|
<a name="l00196"></a>00196 {
|
|
<a name="l00197"></a>00197 <span class="keywordflow">if</span>(p_ != 0)
|
|
<a name="l00198"></a>00198 p_->release();
|
|
<a name="l00199"></a>00199 }
|
|
<a name="l00200"></a>00200
|
|
<a name="l00201"></a><a class="code" href="classAutoRelease.html#69ec68d4a46934e078c38efbaa445a17">00201</a> TYPE &<a class="code" href="classAutoRelease.html#69ec68d4a46934e078c38efbaa445a17">operator*</a>()<span class="keyword"> const</span>
|
|
<a name="l00202"></a>00202 <span class="keyword"> </span>{
|
|
<a name="l00203"></a>00203 <span class="keywordflow">return</span> *p_;
|
|
<a name="l00204"></a>00204 }
|
|
<a name="l00205"></a><a class="code" href="classAutoRelease.html#989dbe58a526654e017147b182f717da">00205</a> TYPE *<a class="code" href="classAutoRelease.html#989dbe58a526654e017147b182f717da">operator-></a>()<span class="keyword"> const</span>
|
|
<a name="l00206"></a>00206 <span class="keyword"> </span>{
|
|
<a name="l00207"></a>00207 <span class="keywordflow">return</span> p_;
|
|
<a name="l00208"></a>00208 }
|
|
<a name="l00209"></a><a class="code" href="classAutoRelease.html#10a8a1d86f7079a0884cb60be02b7716">00209</a> <a class="code" href="classAutoRelease.html#10a8a1d86f7079a0884cb60be02b7716">operator TYPE*</a>()<span class="keyword"> const</span>
|
|
<a name="l00210"></a>00210 <span class="keyword"> </span>{
|
|
<a name="l00211"></a>00211 <span class="keywordflow">return</span> p_;
|
|
<a name="l00212"></a>00212 }
|
|
<a name="l00213"></a><a class="code" href="classAutoRelease.html#ce348d3e52b7a37db5d50692905be8aa">00213</a> TYPE *<span class="keyword">get</span>() <span class="keyword">const</span>
|
|
<a name="l00214"></a>00214 {
|
|
<a name="l00215"></a>00215 <span class="keywordflow">return</span> p_;
|
|
<a name="l00216"></a>00216 }
|
|
<a name="l00217"></a><a class="code" href="classAutoRelease.html#662a4db9c2b1d0a01a9c08d7f375ad28">00217</a> TYPE *<a class="code" href="classAutoRelease.html#662a4db9c2b1d0a01a9c08d7f375ad28">adopt</a>()
|
|
<a name="l00218"></a>00218 {
|
|
<a name="l00219"></a>00219 TYPE *tmp = p_;
|
|
<a name="l00220"></a>00220 p_ = 0;
|
|
<a name="l00221"></a>00221 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00222"></a>00222 }
|
|
<a name="l00223"></a><a class="code" href="classAutoRelease.html#372db34ea6ca4d9b4da4337f5f11cf5d">00223</a> TYPE *<a class="code" href="classAutoRelease.html#372db34ea6ca4d9b4da4337f5f11cf5d">swap</a>(TYPE *p)
|
|
<a name="l00224"></a>00224 {
|
|
<a name="l00225"></a>00225 TYPE *tmp = p_;
|
|
<a name="l00226"></a>00226 p_ = p;
|
|
<a name="l00227"></a>00227 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00228"></a>00228 }
|
|
<a name="l00229"></a><a class="code" href="classAutoRelease.html#9bf8d8491e856723e95e7263e3cec4a3">00229</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(TYPE *p)
|
|
<a name="l00230"></a>00230 {
|
|
<a name="l00231"></a>00231 <span class="keywordflow">if</span>(p_ != 0)
|
|
<a name="l00232"></a>00232 p_->release();
|
|
<a name="l00233"></a>00233 p_ = p;
|
|
<a name="l00234"></a>00234 }
|
|
<a name="l00235"></a>00235
|
|
<a name="l00236"></a>00236 <span class="keyword">private</span>:
|
|
<a name="l00237"></a>00237 <a class="code" href="classAutoRelease.html#686c035fad9b8aa2974261c7251bb672">AutoRelease</a>(<span class="keyword">const</span> <a class="code" href="classAutoRelease.html">AutoRelease<TYPE></a> &);
|
|
<a name="l00238"></a>00238 <a class="code" href="classAutoRelease.html">AutoRelease<TYPE></a> &operator=(<span class="keyword">const</span> <a class="code" href="classAutoRelease.html">AutoRelease<TYPE></a> &);
|
|
<a name="l00239"></a>00239
|
|
<a name="l00240"></a>00240 TYPE *p_;
|
|
<a name="l00241"></a>00241 };
|
|
<a name="l00242"></a>00242
|
|
<a name="l00243"></a>00243 <span class="keyword">template</span><<span class="keyword">class</span> TYPE>
|
|
<a name="l00244"></a><a class="code" href="classAutoDelete.html">00244</a> <span class="keyword">class </span><a class="code" href="classAutoDelete.html">AutoDelete</a>
|
|
<a name="l00245"></a>00245 {
|
|
<a name="l00246"></a>00246 <span class="keyword">public</span>:
|
|
<a name="l00247"></a><a class="code" href="classAutoDelete.html#670c852dae170f5c4bea55d3539ba9a8">00247</a> <a class="code" href="classAutoDelete.html#670c852dae170f5c4bea55d3539ba9a8">AutoDelete</a>(TYPE *p)
|
|
<a name="l00248"></a>00248 : p_(p) {}
|
|
<a name="l00249"></a><a class="code" href="classAutoDelete.html#d5ab2d6d805ba02bac1e1929a5603613">00249</a> <a class="code" href="classAutoDelete.html#d5ab2d6d805ba02bac1e1929a5603613">~AutoDelete</a>()
|
|
<a name="l00250"></a>00250 {
|
|
<a name="l00251"></a>00251 <span class="keyword">delete</span> p_;
|
|
<a name="l00252"></a>00252 }
|
|
<a name="l00253"></a>00253
|
|
<a name="l00254"></a><a class="code" href="classAutoDelete.html#6e3a15f982c029a4bcd72b164715650c">00254</a> TYPE &<a class="code" href="classAutoDelete.html#6e3a15f982c029a4bcd72b164715650c">operator*</a>()<span class="keyword"> const</span>
|
|
<a name="l00255"></a>00255 <span class="keyword"> </span>{
|
|
<a name="l00256"></a>00256 <span class="keywordflow">return</span> *p_;
|
|
<a name="l00257"></a>00257 }
|
|
<a name="l00258"></a><a class="code" href="classAutoDelete.html#56c27b16f0c679aeb8a77748fc5f196f">00258</a> TYPE *<a class="code" href="classAutoDelete.html#56c27b16f0c679aeb8a77748fc5f196f">operator-></a>()<span class="keyword"> const</span>
|
|
<a name="l00259"></a>00259 <span class="keyword"> </span>{
|
|
<a name="l00260"></a>00260 <span class="keywordflow">return</span> p_;
|
|
<a name="l00261"></a>00261 }
|
|
<a name="l00262"></a><a class="code" href="classAutoDelete.html#02f98ce2be63b12a2197dd6419c81880">00262</a> <a class="code" href="classAutoDelete.html#02f98ce2be63b12a2197dd6419c81880">operator TYPE*</a>()<span class="keyword"> const</span>
|
|
<a name="l00263"></a>00263 <span class="keyword"> </span>{
|
|
<a name="l00264"></a>00264 <span class="keywordflow">return</span> p_;
|
|
<a name="l00265"></a>00265 }
|
|
<a name="l00266"></a><a class="code" href="classAutoDelete.html#d99f9f2ce4238127f675a1e4f50efd43">00266</a> TYPE *<span class="keyword">get</span>() <span class="keyword">const</span>
|
|
<a name="l00267"></a>00267 {
|
|
<a name="l00268"></a>00268 <span class="keywordflow">return</span> p_;
|
|
<a name="l00269"></a>00269 }
|
|
<a name="l00270"></a><a class="code" href="classAutoDelete.html#1f33c6ac21f2160fa854975c96336491">00270</a> TYPE *<a class="code" href="classAutoDelete.html#1f33c6ac21f2160fa854975c96336491">adopt</a>()
|
|
<a name="l00271"></a>00271 {
|
|
<a name="l00272"></a>00272 TYPE *tmp = p_;
|
|
<a name="l00273"></a>00273 p_ = 0;
|
|
<a name="l00274"></a>00274 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00275"></a>00275 }
|
|
<a name="l00276"></a><a class="code" href="classAutoDelete.html#2960c5bdae56a81340b975f59b5066ce">00276</a> TYPE *<a class="code" href="classAutoDelete.html#2960c5bdae56a81340b975f59b5066ce">swap</a>(TYPE *p)
|
|
<a name="l00277"></a>00277 {
|
|
<a name="l00278"></a>00278 TYPE *tmp = p_;
|
|
<a name="l00279"></a>00279 p_ = p;
|
|
<a name="l00280"></a>00280 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00281"></a>00281 }
|
|
<a name="l00282"></a><a class="code" href="classAutoDelete.html#a00be90ea92eedd9b2e03b1bc527a669">00282</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(TYPE *p)
|
|
<a name="l00283"></a>00283 {
|
|
<a name="l00284"></a>00284 <span class="keyword">delete</span> p_;
|
|
<a name="l00285"></a>00285 p_ = p;
|
|
<a name="l00286"></a>00286 }
|
|
<a name="l00287"></a>00287
|
|
<a name="l00288"></a>00288 <span class="keyword">private</span>:
|
|
<a name="l00289"></a>00289 <a class="code" href="classAutoDelete.html#670c852dae170f5c4bea55d3539ba9a8">AutoDelete</a>(<span class="keyword">const</span> <a class="code" href="classAutoDelete.html">AutoDelete<TYPE></a> &);
|
|
<a name="l00290"></a>00290 <a class="code" href="classAutoDelete.html">AutoDelete<TYPE></a> &operator=(<span class="keyword">const</span> <a class="code" href="classAutoDelete.html">AutoDelete<TYPE></a> &);
|
|
<a name="l00291"></a>00291
|
|
<a name="l00292"></a>00292 TYPE *p_;
|
|
<a name="l00293"></a>00293 };
|
|
<a name="l00294"></a>00294
|
|
<a name="l00295"></a>00295 <span class="keyword">template</span><<span class="keyword">class</span> TYPE>
|
|
<a name="l00296"></a><a class="code" href="classAutoDeleteArray.html">00296</a> <span class="keyword">class </span><a class="code" href="classAutoDeleteArray.html">AutoDeleteArray</a>
|
|
<a name="l00297"></a>00297 {
|
|
<a name="l00298"></a>00298 <span class="keyword">public</span>:
|
|
<a name="l00299"></a><a class="code" href="classAutoDeleteArray.html#326eefc335cf22f67e2e83928b6a6245">00299</a> <a class="code" href="classAutoDeleteArray.html#326eefc335cf22f67e2e83928b6a6245">AutoDeleteArray</a>(TYPE *p)
|
|
<a name="l00300"></a>00300 : p_(p) {}
|
|
<a name="l00301"></a><a class="code" href="classAutoDeleteArray.html#7f0f2786183326c4cc09d25b1879df5b">00301</a> <a class="code" href="classAutoDeleteArray.html#7f0f2786183326c4cc09d25b1879df5b">~AutoDeleteArray</a>()
|
|
<a name="l00302"></a>00302 {
|
|
<a name="l00303"></a>00303 <span class="keyword">delete</span> [] p_;
|
|
<a name="l00304"></a>00304 }
|
|
<a name="l00305"></a>00305
|
|
<a name="l00306"></a><a class="code" href="classAutoDeleteArray.html#3319a51ba40ffc33339b011024d4cc5f">00306</a> TYPE &<a class="code" href="classAutoDeleteArray.html#3319a51ba40ffc33339b011024d4cc5f">operator*</a>()<span class="keyword"> const</span>
|
|
<a name="l00307"></a>00307 <span class="keyword"> </span>{
|
|
<a name="l00308"></a>00308 <span class="keywordflow">return</span> *p_;
|
|
<a name="l00309"></a>00309 }
|
|
<a name="l00310"></a><a class="code" href="classAutoDeleteArray.html#4b2e23b6ed81f19975b40ebcd947e813">00310</a> TYPE *<a class="code" href="classAutoDeleteArray.html#4b2e23b6ed81f19975b40ebcd947e813">operator-></a>()<span class="keyword"> const</span>
|
|
<a name="l00311"></a>00311 <span class="keyword"> </span>{
|
|
<a name="l00312"></a>00312 <span class="keywordflow">return</span> p_;
|
|
<a name="l00313"></a>00313 }
|
|
<a name="l00314"></a><a class="code" href="classAutoDeleteArray.html#700a80f1055dfb4cc1d3d1316ea1ef2e">00314</a> <a class="code" href="classAutoDeleteArray.html#700a80f1055dfb4cc1d3d1316ea1ef2e">operator TYPE*</a>()<span class="keyword"> const</span>
|
|
<a name="l00315"></a>00315 <span class="keyword"> </span>{
|
|
<a name="l00316"></a>00316 <span class="keywordflow">return</span> p_;
|
|
<a name="l00317"></a>00317 }
|
|
<a name="l00318"></a><a class="code" href="classAutoDeleteArray.html#03b9331d2c71a2fe29982171e9a5a803">00318</a> TYPE *<span class="keyword">get</span>() <span class="keyword">const</span>
|
|
<a name="l00319"></a>00319 {
|
|
<a name="l00320"></a>00320 <span class="keywordflow">return</span> p_;
|
|
<a name="l00321"></a>00321 }
|
|
<a name="l00322"></a><a class="code" href="classAutoDeleteArray.html#adcd29d03ab17fc8e3ab9856fe18eace">00322</a> TYPE *<a class="code" href="classAutoDeleteArray.html#adcd29d03ab17fc8e3ab9856fe18eace">adopt</a>()
|
|
<a name="l00323"></a>00323 {
|
|
<a name="l00324"></a>00324 TYPE *tmp = p_;
|
|
<a name="l00325"></a>00325 p_ = 0;
|
|
<a name="l00326"></a>00326 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00327"></a>00327 }
|
|
<a name="l00328"></a><a class="code" href="classAutoDeleteArray.html#57ec3c1ed0e042230c5ca7e18ae7c382">00328</a> TYPE *<a class="code" href="classAutoDeleteArray.html#57ec3c1ed0e042230c5ca7e18ae7c382">swap</a>(TYPE *p)
|
|
<a name="l00329"></a>00329 {
|
|
<a name="l00330"></a>00330 TYPE *tmp = p_;
|
|
<a name="l00331"></a>00331 p_ = p;
|
|
<a name="l00332"></a>00332 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00333"></a>00333 }
|
|
<a name="l00334"></a><a class="code" href="classAutoDeleteArray.html#9817f2407fc5ce75839ea01eacd108a6">00334</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(TYPE *p)
|
|
<a name="l00335"></a>00335 {
|
|
<a name="l00336"></a>00336 <span class="keyword">delete</span> [] p_;
|
|
<a name="l00337"></a>00337 p_ = p;
|
|
<a name="l00338"></a>00338 }
|
|
<a name="l00339"></a>00339
|
|
<a name="l00340"></a>00340 <span class="keyword">private</span>:
|
|
<a name="l00341"></a>00341 <a class="code" href="classAutoDeleteArray.html#326eefc335cf22f67e2e83928b6a6245">AutoDeleteArray</a>(<span class="keyword">const</span> <a class="code" href="classAutoDeleteArray.html">AutoDeleteArray<TYPE></a> &);
|
|
<a name="l00342"></a>00342 <a class="code" href="classAutoDeleteArray.html">AutoDeleteArray<TYPE></a> &operator=(<span class="keyword">const</span> <a class="code" href="classAutoDeleteArray.html">AutoDeleteArray<TYPE></a> &);
|
|
<a name="l00343"></a>00343
|
|
<a name="l00344"></a>00344 TYPE *p_;
|
|
<a name="l00345"></a>00345 };
|
|
<a name="l00346"></a>00346
|
|
<a name="l00347"></a>00347 <span class="keyword">template</span><<span class="keyword">class</span> TYPE>
|
|
<a name="l00348"></a><a class="code" href="classAutoDeallocate.html">00348</a> <span class="keyword">class </span><a class="code" href="classAutoDeallocate.html">AutoDeallocate</a>
|
|
<a name="l00349"></a>00349 {
|
|
<a name="l00350"></a>00350 <span class="keyword">public</span>:
|
|
<a name="l00351"></a><a class="code" href="classAutoDeallocate.html#513ce277d04ae90375bffa5353ce2ec2">00351</a> <a class="code" href="classAutoDeallocate.html#513ce277d04ae90375bffa5353ce2ec2">AutoDeallocate</a>(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *mmgr, <span class="keywordtype">size_t</span> size = <span class="keyword">sizeof</span>(TYPE))
|
|
<a name="l00352"></a>00352 : p_(0), mmgr_(mmgr) {
|
|
<a name="l00353"></a>00353 p_ = (TYPE*)mmgr_-><a class="code" href="classxercesc_1_1MemoryManager.html#b6bbb5b604d2159e7ccc4532e4f422af" title="This method allocates requested memory.">allocate</a>(size);
|
|
<a name="l00354"></a>00354 }
|
|
<a name="l00355"></a><a class="code" href="classAutoDeallocate.html#8fad7fbdef93053789fd7382d7e4d4da">00355</a> <a class="code" href="classAutoDeallocate.html#513ce277d04ae90375bffa5353ce2ec2">AutoDeallocate</a>(TYPE *p, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *mmgr)
|
|
<a name="l00356"></a>00356 : p_(p), mmgr_(mmgr) {}
|
|
<a name="l00357"></a><a class="code" href="classAutoDeallocate.html#f244dab4381f4490b00a4f6bbdaf9d73">00357</a> <a class="code" href="classAutoDeallocate.html#f244dab4381f4490b00a4f6bbdaf9d73">~AutoDeallocate</a>()
|
|
<a name="l00358"></a>00358 {
|
|
<a name="l00359"></a>00359 <span class="keywordflow">if</span>(p_ != 0)
|
|
<a name="l00360"></a>00360 mmgr_-><a class="code" href="classxercesc_1_1MemoryManager.html#4fd46b0b3634cf5540170ff3dcdfc414" title="This method deallocates memory.">deallocate</a>((<span class="keywordtype">void</span>*)p_);
|
|
<a name="l00361"></a>00361 }
|
|
<a name="l00362"></a>00362
|
|
<a name="l00363"></a><a class="code" href="classAutoDeallocate.html#2a072d4d603bd2a0f0e8b0fe1ecc52fc">00363</a> TYPE &<a class="code" href="classAutoDeallocate.html#2a072d4d603bd2a0f0e8b0fe1ecc52fc">operator*</a>()<span class="keyword"> const</span>
|
|
<a name="l00364"></a>00364 <span class="keyword"> </span>{
|
|
<a name="l00365"></a>00365 <span class="keywordflow">return</span> *p_;
|
|
<a name="l00366"></a>00366 }
|
|
<a name="l00367"></a><a class="code" href="classAutoDeallocate.html#9300b0c82cd91c75dd878efc5968dbb6">00367</a> TYPE *<a class="code" href="classAutoDeallocate.html#9300b0c82cd91c75dd878efc5968dbb6">operator-></a>()<span class="keyword"> const</span>
|
|
<a name="l00368"></a>00368 <span class="keyword"> </span>{
|
|
<a name="l00369"></a>00369 <span class="keywordflow">return</span> p_;
|
|
<a name="l00370"></a>00370 }
|
|
<a name="l00371"></a><a class="code" href="classAutoDeallocate.html#f379f1dd4a3428b6f72d548483eddefb">00371</a> <a class="code" href="classAutoDeallocate.html#f379f1dd4a3428b6f72d548483eddefb">operator TYPE*</a>()<span class="keyword"> const</span>
|
|
<a name="l00372"></a>00372 <span class="keyword"> </span>{
|
|
<a name="l00373"></a>00373 <span class="keywordflow">return</span> p_;
|
|
<a name="l00374"></a>00374 }
|
|
<a name="l00375"></a><a class="code" href="classAutoDeallocate.html#cd27913a88a0c797c3a781cb6b78478d">00375</a> TYPE *<span class="keyword">get</span>() <span class="keyword">const</span>
|
|
<a name="l00376"></a>00376 {
|
|
<a name="l00377"></a>00377 <span class="keywordflow">return</span> p_;
|
|
<a name="l00378"></a>00378 }
|
|
<a name="l00379"></a><a class="code" href="classAutoDeallocate.html#4dc196c0b9073fc712c34f27a8cd1dd1">00379</a> TYPE *<a class="code" href="classAutoDeallocate.html#4dc196c0b9073fc712c34f27a8cd1dd1">adopt</a>()
|
|
<a name="l00380"></a>00380 {
|
|
<a name="l00381"></a>00381 TYPE *tmp = p_;
|
|
<a name="l00382"></a>00382 p_ = 0;
|
|
<a name="l00383"></a>00383 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00384"></a>00384 }
|
|
<a name="l00385"></a><a class="code" href="classAutoDeallocate.html#ed2758752b4cc2cdb91e6192b6310ef0">00385</a> TYPE *<a class="code" href="classAutoDeallocate.html#ed2758752b4cc2cdb91e6192b6310ef0">swap</a>(TYPE *p)
|
|
<a name="l00386"></a>00386 {
|
|
<a name="l00387"></a>00387 TYPE *tmp = p_;
|
|
<a name="l00388"></a>00388 p_ = p;
|
|
<a name="l00389"></a>00389 <span class="keywordflow">return</span> tmp;
|
|
<a name="l00390"></a>00390 }
|
|
<a name="l00391"></a><a class="code" href="classAutoDeallocate.html#c11b517f7786a4c2066415dbd30b001d">00391</a> <span class="keywordtype">void</span> <span class="keyword">set</span>(TYPE *p)
|
|
<a name="l00392"></a>00392 {
|
|
<a name="l00393"></a>00393 <span class="keywordflow">if</span>(p_ != 0)
|
|
<a name="l00394"></a>00394 mmgr_-><a class="code" href="classxercesc_1_1MemoryManager.html#4fd46b0b3634cf5540170ff3dcdfc414" title="This method deallocates memory.">deallocate</a>((<span class="keywordtype">void</span>*)p_);
|
|
<a name="l00395"></a>00395 p_ = p;
|
|
<a name="l00396"></a>00396 }
|
|
<a name="l00397"></a>00397
|
|
<a name="l00398"></a>00398 <span class="keyword">private</span>:
|
|
<a name="l00399"></a>00399 <a class="code" href="classAutoDeallocate.html#513ce277d04ae90375bffa5353ce2ec2">AutoDeallocate</a>(<span class="keyword">const</span> <a class="code" href="classAutoDeallocate.html">AutoDeallocate<TYPE></a> &);
|
|
<a name="l00400"></a>00400 <a class="code" href="classAutoDeallocate.html">AutoDeallocate<TYPE></a> &operator=(<span class="keyword">const</span> <a class="code" href="classAutoDeallocate.html">AutoDeallocate<TYPE></a> &);
|
|
<a name="l00401"></a>00401
|
|
<a name="l00402"></a>00402 TYPE *p_;
|
|
<a name="l00403"></a>00403 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *mmgr_;
|
|
<a name="l00404"></a>00404 };
|
|
<a name="l00405"></a>00405
|
|
<a name="l00406"></a>00406 <span class="preprocessor">#endif //__XPATH2MEMORYMANAGER_HPP</span>
|
|
<a name="l00407"></a>00407 <span class="preprocessor"></span>
|
|
</pre></div></div>
|
|
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Jan 5 19:53:55 2009 for XQilla Simple API by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
|
</body>
|
|
</html>
|