Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 5e43f5d92fadaa0a1cc4664249b615d0 > files > 25

xalan-c-doc-1.1-8mdk.i586.rpm

<HTML><HEAD><TITLE>Xalan-C++ API Documentation</TITLE></HEAD>
<BODY>
<h2 align="center">Xalan-C++ API Documentation</h2>
<h3 align="center">The Xalan C++ XSL Transformer Version 1.1</h3>
</BODY>
<!-- Generated by Doxygen 1.2.0 on Thu Feb 15 10:43:49 2001 -->
<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>ArenaBlock.hpp</h1><a href="ArenaBlock.hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*
</font>00002 <font class="comment"> * The Apache Software License, Version 1.1
</font>00003 <font class="comment"> *
</font>00004 <font class="comment"> *
</font>00005 <font class="comment"> * Copyright (c) 2000 The Apache Software Foundation.  All rights 
</font>00006 <font class="comment"> * reserved.
</font>00007 <font class="comment"> *
</font>00008 <font class="comment"> * Redistribution and use in source and binary forms, with or without
</font>00009 <font class="comment"> * modification, are permitted provided that the following conditions
</font>00010 <font class="comment"> * are met:
</font>00011 <font class="comment"> *
</font>00012 <font class="comment"> * 1. Redistributions of source code must retain the above copyright
</font>00013 <font class="comment"> *    notice, this list of conditions and the following disclaimer. 
</font>00014 <font class="comment"> *
</font>00015 <font class="comment"> * 2. Redistributions in binary form must reproduce the above copyright
</font>00016 <font class="comment"> *    notice, this list of conditions and the following disclaimer in
</font>00017 <font class="comment"> *    the documentation and/or other materials provided with the
</font>00018 <font class="comment"> *    distribution.
</font>00019 <font class="comment"> *
</font>00020 <font class="comment"> * 3. The end-user documentation included with the redistribution,
</font>00021 <font class="comment"> *    if any, must include the following acknowledgment:  
</font>00022 <font class="comment"> *       "This product includes software developed by the
</font>00023 <font class="comment"> *        Apache Software Foundation (http://www.apache.org/)."
</font>00024 <font class="comment"> *    Alternately, this acknowledgment may appear in the software itself,
</font>00025 <font class="comment"> *    if and wherever such third-party acknowledgments normally appear.
</font>00026 <font class="comment"> *
</font>00027 <font class="comment"> * 4. The names "Xalan" and "Apache Software Foundation" must
</font>00028 <font class="comment"> *    not be used to endorse or promote products derived from this
</font>00029 <font class="comment"> *    software without prior written permission. For written 
</font>00030 <font class="comment"> *    permission, please contact apache@apache.org.
</font>00031 <font class="comment"> *
</font>00032 <font class="comment"> * 5. Products derived from this software may not be called "Apache",
</font>00033 <font class="comment"> *    nor may "Apache" appear in their name, without prior written
</font>00034 <font class="comment"> *    permission of the Apache Software Foundation.
</font>00035 <font class="comment"> *
</font>00036 <font class="comment"> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
</font>00037 <font class="comment"> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
</font>00038 <font class="comment"> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
</font>00039 <font class="comment"> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
</font>00040 <font class="comment"> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
</font>00041 <font class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
</font>00042 <font class="comment"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
</font>00043 <font class="comment"> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
</font>00044 <font class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
</font>00045 <font class="comment"> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
</font>00046 <font class="comment"> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
</font>00047 <font class="comment"> * SUCH DAMAGE.
</font>00048 <font class="comment"> * ====================================================================
</font>00049 <font class="comment"> *
</font>00050 <font class="comment"> * This software consists of voluntary contributions made by many
</font>00051 <font class="comment"> * individuals on behalf of the Apache Software Foundation and was
</font>00052 <font class="comment"> * originally based on software copyright (c) 1999, International
</font>00053 <font class="comment"> * Business Machines, Inc., http://www.ibm.com.  For more
</font>00054 <font class="comment"> * information on the Apache Software Foundation, please see
</font>00055 <font class="comment"> * &lt;http://www.apache.org/&gt;.
</font>00056 <font class="comment"> */</font>
00057 
00058 <font class="preprocessor">#if !defined(ARENABLOCK_INCLUDE_GUARD_1357924680)
</font><a name="l00059"></a><a class="code" href="ArenaBlock.hpp.html#a0">00059</a> <font class="preprocessor"></font><font class="preprocessor">#define ARENABLOCK_INCLUDE_GUARD_1357924680
</font>00060 <font class="preprocessor"></font>
00061 
00062 
00063 <font class="preprocessor">#include &lt;algorithm&gt;</font>
00064 <font class="preprocessor">#include &lt;cassert&gt;</font>
00065 <font class="preprocessor">#include &lt;set&gt;</font>
00066 <font class="preprocessor">#include &lt;memory&gt;</font>
00067 
00068 
00069 
00070 <font class="preprocessor">#if defined(XALAN_NO_STD_ALLOCATORS) &amp;&amp; !defined(XALAN_NO_SELECTIVE_TEMPLATE_INSTANTIATION)
</font>00071 <font class="preprocessor"></font><font class="preprocessor">#include &lt;<a class="code" href="XalanAllocator.hpp.html">PlatformSupport/XalanAllocator.hpp</a>&gt;</font>
00072 <font class="preprocessor">#endif
</font>00073 <font class="preprocessor"></font>
00074 
00075 
00076 <font class="preprocessor">#if defined(XALAN_NO_SELECTIVE_TEMPLATE_INSTANTIATION)
</font>00077 <font class="preprocessor"></font>
00078 <font class="keyword">template</font> &lt;<font class="keyword">class </font>Type&gt;
00079 <font class="keyword">class </font>ArenaBlockAllocator
00080 {
00081 <font class="keyword">public</font>:
00082 
00083     <font class="keyword">typedef</font> size_t          size_type;
00084     <font class="keyword">typedef</font> ptrdiff_t       difference_type;
00085     <font class="keyword">typedef</font> Type*           pointer;
00086     <font class="keyword">typedef</font> <font class="keyword">const</font> Type*     const_pointer;
00087     <font class="keyword">typedef</font> Type&amp;           reference;
00088     <font class="keyword">typedef</font> <font class="keyword">const</font> Type&amp;     const_reference;
00089     <font class="keyword">typedef</font> Type            value_type;
00090 
00091     ArenaBlockAllocator()<font class="keyword">
</font>00092 <font class="keyword">    </font>{
00093     }
00094 
00095     ArenaBlockAllocator(<font class="keyword">const</font> ArenaBlockAllocator&lt;Type&gt;&amp;)<font class="keyword">
</font>00096 <font class="keyword">    </font>{
00097     };
00098 
00099     ~ArenaBlockAllocator()<font class="keyword">
</font>00100 <font class="keyword">    </font>{
00101     }
00102 
00103     pointer
00104     allocate(
00105             size_type       size,
00106             <font class="keyword">const</font> <font class="keywordtype">void</font>*     <font class="comment">/* hint */</font> = 0)<font class="keyword">
</font>00107 <font class="keyword">    </font>{
00108         <font class="keywordflow">return</font> (pointer)operator new(size * <font class="keyword">sizeof</font>(Type));
00109     }
00110 
00111     <font class="keywordtype">void</font>
00112     deallocate(
00113                 pointer     p,
00114                 size_type   <font class="comment">/* n */</font>)<font class="keyword">
</font>00115 <font class="keyword">    </font>{
00116         operator delete(p);
00117     }
00118 };
00119 <font class="preprocessor">#endif
</font>00120 <font class="preprocessor"></font>
00121 
00122 
00123 <font class="keyword">template</font>&lt;<font class="keyword">class </font><a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;
<a name="l00124"></a><a class="code" href="class_arenablockdestroy.html">00124</a> <font class="keyword">class </font><a class="code" href="class_arenablockdestroy.html">ArenaBlockDestroy</a>
00125 {
00126 <font class="keyword">public</font>:
00127 
00128     <font class="keywordtype">void</font>
<a name="l00129"></a><a class="code" href="class_arenablockdestroy.html#a0">00129</a>     <a class="code" href="class_arenablockdestroy.html#a0">operator()</a>(<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&amp;  theObject)<font class="keyword"> const
</font>00130 <font class="keyword">    </font>{
00131         theObject.ObjectType::~ObjectType();
00132     }
00133 };
00134 
00135 
00136 
00137 <font class="keyword">template</font>&lt;<font class="keyword">class </font><a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;
<a name="l00138"></a><a class="code" href="class_arenablock.html">00138</a> <font class="keyword">class </font><a class="code" href="class_arenablock.html">ArenaBlock</a>
00139 {
00140 <font class="keyword">public</font>:
00141 
00142 <font class="preprocessor">#if defined(XALAN_NO_SELECTIVE_TEMPLATE_INSTANTIATION)
</font>00143 <font class="preprocessor"></font>    <font class="keyword">typedef</font> ArenaBlockAllocator&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;     AllocatorType;
00144 <font class="preprocessor">#elif defined(XALAN_NO_STD_ALLOCATORS)
</font>00145 <font class="preprocessor"></font>    <font class="keyword">typedef</font> <a class="code" href="class_xalanallocator.html">XalanAllocator</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;          AllocatorType;
00146 <font class="preprocessor">#else
</font><a name="l00147"></a><a class="code" href="class_arenablock.html#s0">00147</a> <font class="preprocessor"></font>    <font class="keyword">typedef</font> std::allocator&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;          AllocatorType;
00148 <font class="preprocessor">#endif
</font>00149 <font class="preprocessor"></font>
<a name="l00150"></a><a class="code" href="class_arenablock.html#s1">00150</a>     <font class="keyword">typedef</font> <a class="code" href="class_arenablockdestroy.html">ArenaBlockDestroy</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;       <a class="code" href="class_arenablockdestroy.html">DestroyFunctionType</a>;
00151 
<a name="l00152"></a><a class="code" href="class_arenablock.html#s2">00152</a>     <font class="keyword">typedef</font> <font class="keyword">typename</font> AllocatorType::size_type   size_type;
00153 
00154     <font class="comment">/*
</font>00155 <font class="comment">     * Construct an ArenaBlock of the specified size
</font>00156 <font class="comment">     * of objects.
</font>00157 <font class="comment">     *
</font>00158 <font class="comment">     * @param theBlockSize The size of the block (the number of objects it can contain).
</font>00159 <font class="comment">     */</font>
<a name="l00160"></a><a class="code" href="class_arenablock.html#a0">00160</a>     <a class="code" href="class_arenablock.html#a0">ArenaBlock</a>(size_type    theBlockSize) :
00161         m_destroyFunction(<a class="code" href="class_arenablockdestroy.html">DestroyFunctionType</a>()),
00162         m_objectCount(0),
00163         m_blockSize(theBlockSize),
00164         m_objectBlock(0),
00165         m_allocator()
00166     {
00167         assert(theBlockSize &gt; 0);
00168     }
00169 
00170     <font class="keyword">virtual</font> 
<a name="l00171"></a><a class="code" href="class_arenablock.html#a1">00171</a>     <a class="code" href="class_arenablock.html#a1">~ArenaBlock</a>()<font class="keyword">
</font>00172 <font class="keyword">    </font>{
00173         <a class="code" href="class_arenablock.html#a9">destroyAll</a>();
00174 
00175         <font class="comment">// Release the memory...</font>
00176         m_allocator.deallocate(m_objectBlock, 0);
00177     }
00178 
00179     <font class="comment">/*
</font>00180 <font class="comment">     * Allocate a block.  Once the object is constructed, you must call
</font>00181 <font class="comment">     * commitAllocation().
</font>00182 <font class="comment">     *
</font>00183 <font class="comment">     * @return a pointer to the new block.
</font>00184 <font class="comment">     */</font>
00185     <font class="keyword">virtual</font> <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*
<a name="l00186"></a><a class="code" href="class_arenablock.html#a2">00186</a>     <a class="code" href="class_arenablock.html#a2">allocateBlock</a>()<font class="keyword">
</font>00187 <font class="keyword">    </font>{
00188         <font class="comment">// Any space left?</font>
00189         <font class="keywordflow">if</font> (m_objectCount == m_blockSize)
00190         {
00191             <font class="keywordflow">return</font> 0;
00192         }
00193         <font class="keywordflow">else</font>
00194         {
00195             <font class="comment">// If no memory has yet been allocated, then allocate it...</font>
00196             <font class="keywordflow">if</font> (m_objectBlock == 0)
00197             {
00198                 m_objectBlock = m_allocator.allocate(m_blockSize, 0);
00199             }
00200             assert(m_objectBlock != 0);
00201 
00202             <font class="keywordflow">return</font> m_objectBlock + m_objectCount;
00203         }
00204     }
00205 
00206     <font class="comment">/*
</font>00207 <font class="comment">     * Commit the previous allocation.
</font>00208 <font class="comment">     *
</font>00209 <font class="comment">     * @param theBlock the address that was returned by allocateBlock()
</font>00210 <font class="comment">     */</font>
00211     <font class="keyword">virtual</font> <font class="keywordtype">void</font>
00212 <font class="preprocessor">#if defined (NDEBUG)
</font>00213 <font class="preprocessor"></font>    <a class="code" href="class_arenablock.html#a3">commitAllocation</a>(<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*    <font class="comment">/* theBlock */</font>)
00214 <font class="preprocessor">#else
</font><a name="l00215"></a><a class="code" href="class_arenablock.html#a3">00215</a> <font class="preprocessor"></font>    <a class="code" href="class_arenablock.html#a3">commitAllocation</a>(<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*    theBlock)
00216 <font class="preprocessor">#endif
</font>00217 <font class="preprocessor"></font>    {
00218         assert(theBlock == m_objectBlock + m_objectCount);
00219         assert(m_objectCount &lt; m_blockSize);
00220 
00221         m_objectCount++;
00222     }
00223 
00224     <font class="comment">/*
</font>00225 <font class="comment">     * Find out if there is a block available.
</font>00226 <font class="comment">     *
</font>00227 <font class="comment">     * @return true if one is available, false if not.
</font>00228 <font class="comment">     */</font>
00229     <font class="keyword">virtual</font> <font class="keywordtype">bool</font>
<a name="l00230"></a><a class="code" href="class_arenablock.html#a4">00230</a>     <a class="code" href="class_arenablock.html#a4">blockAvailable</a>()<font class="keyword"> const
</font>00231 <font class="keyword">    </font>{
00232         <font class="keywordflow">return</font> m_objectCount &lt; m_blockSize ? <font class="keyword">true</font> : <font class="keyword">false</font>;
00233     }
00234 
00235     <font class="comment">/*
</font>00236 <font class="comment">     * Get the number of objects currently allocated in the
</font>00237 <font class="comment">     * block.
</font>00238 <font class="comment">     *
</font>00239 <font class="comment">     * @return The number of objects allocated.
</font>00240 <font class="comment">     */</font>
00241     <font class="keyword">virtual</font> size_type
<a name="l00242"></a><a class="code" href="class_arenablock.html#a5">00242</a>     <a class="code" href="class_arenablock.html#a5">getCountAllocated</a>()<font class="keyword"> const
</font>00243 <font class="keyword">    </font>{
00244         <font class="keywordflow">return</font> m_objectCount;
00245     }
00246 
00247     <font class="comment">/*
</font>00248 <font class="comment">     * Get the block size, that is, the number
</font>00249 <font class="comment">     * of objects in each block.
</font>00250 <font class="comment">     *
</font>00251 <font class="comment">     * @return The size of the block
</font>00252 <font class="comment">     */</font>
00253     size_type
<a name="l00254"></a><a class="code" href="class_arenablock.html#a6">00254</a>     <a class="code" href="class_arenablock.html#a6">getBlockSize</a>()<font class="keyword"> const
</font>00255 <font class="keyword">    </font>{
00256         <font class="keywordflow">return</font> m_blockSize;
00257     }
00258 
00259     <font class="comment">/*
</font>00260 <font class="comment">     * Determine if this block owns the specified object.  Note
</font>00261 <font class="comment">     * that even if the object address is within our block, this
</font>00262 <font class="comment">     * call will return false if no object currently occupies the
</font>00263 <font class="comment">     * block.  See also ownsBlock().
</font>00264 <font class="comment">     *
</font>00265 <font class="comment">     * @param theObject the address of the object.
</font>00266 <font class="comment">     * @return true if we own the object, false if not.
</font>00267 <font class="comment">     */</font>
00268     <font class="keyword">virtual</font> <font class="keywordtype">bool</font>
<a name="l00269"></a><a class="code" href="class_arenablock.html#a7">00269</a>     <a class="code" href="class_arenablock.html#a7">ownsObject</a>(<font class="keyword">const</font> <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*    theObject)<font class="keyword"> const
</font>00270 <font class="keyword">    </font>{
00271 <font class="preprocessor">#if !defined(XALAN_NO_NAMESPACES)
</font>00272 <font class="preprocessor"></font>        <font class="keyword">using</font> std::less;
00273 <font class="preprocessor">#endif
</font>00274 <font class="preprocessor"></font>
00275         <font class="comment">// Use less&lt;&gt;, since it's guaranteed to do pointer</font>
00276         <font class="comment">// comparisons correctly...</font>
00277         less&lt;<font class="keyword">const</font> <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*&gt;     functor;
00278 
00279         <font class="keywordflow">if</font> (functor(theObject, m_objectBlock) == <font class="keyword">false</font> &amp;&amp;
00280             functor(theObject, m_objectBlock + m_objectCount) == <font class="keyword">true</font>)
00281         {
00282             <font class="keywordflow">return</font> <font class="keyword">true</font>;
00283         }
00284         <font class="keywordflow">else</font>
00285         {
00286             <font class="keywordflow">return</font> <font class="keyword">false</font>;
00287         }
00288     }
00289 
00290     <font class="comment">/*
</font>00291 <font class="comment">     * Determine if this block owns the specified object block.
</font>00292 <font class="comment">     * Note that, unlike ownsObject(), there does not need to
</font>00293 <font class="comment">     * be an object at the address.
</font>00294 <font class="comment">     *
</font>00295 <font class="comment">     * @param theObject the address of the object
</font>00296 <font class="comment">     * @return true if we own the object block, false if not.
</font>00297 <font class="comment">     */</font>
00298     <font class="keywordtype">bool</font>
<a name="l00299"></a><a class="code" href="class_arenablock.html#a8">00299</a>     <a class="code" href="class_arenablock.html#a8">ownsBlock</a>(<font class="keyword">const</font> <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*     theObject)<font class="keyword"> const
</font>00300 <font class="keyword">    </font>{
00301 <font class="preprocessor">#if !defined(XALAN_NO_NAMESPACES)
</font>00302 <font class="preprocessor"></font>        <font class="keyword">using</font> std::less;
00303 <font class="preprocessor">#endif
</font>00304 <font class="preprocessor"></font>
00305         <font class="comment">// Use less&lt;&gt;, since it's guaranteed to do pointer</font>
00306         <font class="comment">// comparisons correctly...</font>
00307         less&lt;<font class="keyword">const</font> <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*&gt;     functor;
00308 
00309         <font class="keywordflow">if</font> (functor(theObject, m_objectBlock) == <font class="keyword">false</font> &amp;&amp;
00310             functor(theObject, m_objectBlock + m_blockSize) == <font class="keyword">true</font>)
00311         {
00312             <font class="keywordflow">return</font> <font class="keyword">true</font>;
00313         }
00314         <font class="keywordflow">else</font>
00315         {
00316             <font class="keywordflow">return</font> <font class="keyword">false</font>;
00317         }
00318     }
00319 
00320     <font class="comment">/*
</font>00321 <font class="comment">     * Destroy all objects in the block.  You can then reuse the
</font>00322 <font class="comment">     * block.
</font>00323 <font class="comment">     */</font>
00324     <font class="keywordtype">void</font>
<a name="l00325"></a><a class="code" href="class_arenablock.html#a9">00325</a>     <a class="code" href="class_arenablock.html#a9">destroyAll</a>()<font class="keyword">
</font>00326 <font class="keyword">    </font>{
00327 <font class="preprocessor">#if !defined(XALAN_NO_NAMESPACES)
</font>00328 <font class="preprocessor"></font>        <font class="keyword">using</font> std::for_each;
00329 <font class="preprocessor">#endif
</font>00330 <font class="preprocessor"></font>
00331         <font class="comment">// Destroy all existing objects...</font>
00332         for_each(m_objectBlock,
00333                  m_objectBlock + m_objectCount,
00334                  <a class="code" href="class_arenablock.html#l0">DeleteFunctor</a>(*<font class="keyword">this</font>, m_destroyFunction));
00335 
00336         m_objectCount = 0;
00337     }
00338 
00339 <font class="keyword">protected</font>:
00340 
00341     <font class="comment">/*
</font>00342 <font class="comment">     * Determine if the block should be destroyed.  Called by
</font>00343 <font class="comment">     * an instance of DeleteFunctor, this function is for
</font>00344 <font class="comment">     * deriving classes that might want to control the destruction
</font>00345 <font class="comment">     * of things.
</font>00346 <font class="comment">     *
</font>00347 <font class="comment">     * @param theObject the address of the object
</font>00348 <font class="comment">     * @return true if block should be destroyed, false if not.
</font>00349 <font class="comment">     */</font>
00350     <font class="keyword">virtual</font> <font class="keywordtype">bool</font>
<a name="l00351"></a><a class="code" href="class_arenablock.html#b0">00351</a>     <a class="code" href="class_arenablock.html#b0">shouldDestroyBlock</a>(<font class="keyword">const</font> <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*    <font class="comment">/* theObject */</font>)<font class="keyword"> const
</font>00352 <font class="keyword">    </font>{
00353         <font class="keywordflow">return</font> <font class="keyword">true</font>;
00354     }
00355 
00356     <font class="comment">/*
</font>00357 <font class="comment">     * Determine the offset into the block for the given address.
</font>00358 <font class="comment">     * Behavior is undefined if the address is not within our
</font>00359 <font class="comment">     * block
</font>00360 <font class="comment">     *
</font>00361 <font class="comment">     * @param theObject the address of the object
</font>00362 <font class="comment">     * @return the offset
</font>00363 <font class="comment">     */</font>
00364     size_type
<a name="l00365"></a><a class="code" href="class_arenablock.html#b1">00365</a>     <a class="code" href="class_arenablock.html#b1">getBlockOffset</a>(<font class="keyword">const</font> <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*    theObject)<font class="keyword"> const
</font>00366 <font class="keyword">    </font>{
00367         assert(<a class="code" href="class_arenablock.html#s2">size_type</a>(theObject - m_objectBlock) &lt; m_blockSize);
00368 
00369         <font class="keywordflow">return</font> theObject - m_objectBlock;
00370     }
00371 
00372     <font class="comment">/*
</font>00373 <font class="comment">     * Determine the address within our block of the object
</font>00374 <font class="comment">     * at the specified offset.
</font>00375 <font class="comment">     * Behavior is undefined if the offset is greater than the
</font>00376 <font class="comment">     * block size.
</font>00377 <font class="comment">     *
</font>00378 <font class="comment">     * @param theObject the address of the object
</font>00379 <font class="comment">     * @return the offset
</font>00380 <font class="comment">     */</font>
00381     <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*
<a name="l00382"></a><a class="code" href="class_arenablock.html#b2">00382</a>     <a class="code" href="class_arenablock.html#b2">getBlockAddress</a>(size_type   theOffset)<font class="keyword"> const
</font>00383 <font class="keyword">    </font>{
00384         assert(theOffset &lt; m_blockSize);
00385 
00386         <font class="keywordflow">return</font> m_objectBlock + theOffset;
00387     }
00388 
<a name="l00389"></a><a class="code" href="class_arenablock__deletefunctor.html">00389</a>     <font class="keyword">struct </font><a class="code" href="class_deletefunctor.html">DeleteFunctor</a>
00390     {
<a name="l00391"></a><a class="code" href="class_arenablock__deletefunctor.html#a0">00391</a>         DeleteFunctor(
00392                 <font class="keyword">const</font> <a class="code" href="class_arenablock.html">ArenaBlock</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;&amp;   theArenaBlock,
00393                 <font class="keyword">const</font> <a class="code" href="class_arenablockdestroy.html">DestroyFunctionType</a>&amp;      theDestroyFunction) :
00394             m_arenaBlock(theArenaBlock),
00395             m_destroyFunction(theDestroyFunction)
00396         {
00397         }
00398 
00399         <font class="keywordtype">void</font>
<a name="l00400"></a><a class="code" href="class_arenablock__deletefunctor.html#a1">00400</a>         <a class="code" href="class_deletefunctor.html#a0">operator()</a>(<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&amp;  theObject)<font class="keyword"> const
</font>00401 <font class="keyword">        </font>{
00402             <font class="keywordflow">if</font> (m_arenaBlock.shouldDestroyBlock(&amp;theObject) == <font class="keyword">true</font>)
00403             {
00404                 m_destroyFunction(theObject);
00405             }
00406         }
00407 
00408     <font class="keyword">private</font>:
00409 
00410         <font class="keyword">const</font> <a class="code" href="class_arenablock.html">ArenaBlock</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;&amp;   m_arenaBlock;
00411         <font class="keyword">const</font> <a class="code" href="class_arenablockdestroy.html">DestroyFunctionType</a>&amp;      m_destroyFunction;
00412     };
00413 
<a name="l00414"></a><a class="code" href="class_arenablock.html#l0">00414</a>     <font class="keyword">friend</font> <font class="keyword">struct </font><a class="code" href="class_deletefunctor.html">DeleteFunctor</a>;
00415 
<a name="l00416"></a><a class="code" href="class_arenablock.html#n0">00416</a>     <font class="keyword">const</font> <a class="code" href="class_arenablockdestroy.html">DestroyFunctionType</a>   m_destroyFunction;
00417 
00418 <font class="keyword">private</font>:
00419 
00420     <font class="comment">// Not implemented...</font>
00421     ArenaBlock(<font class="keyword">const</font> <a class="code" href="class_arenablock.html">ArenaBlock</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;&amp;);
00422 
00423     <a class="code" href="class_arenablock.html">ArenaBlock</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;&amp;
00424     operator=(<font class="keyword">const</font> <a class="code" href="class_arenablock.html">ArenaBlock</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;&amp;);
00425 
00426     <font class="keywordtype">bool</font>
00427     operator==(<font class="keyword">const</font> <a class="code" href="class_arenablock.html">ArenaBlock</a>&lt;<a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>&gt;&amp;) <font class="keyword">const</font>;
00428 
00429 
00430     <font class="comment">// data members...</font>
00431     size_type           m_objectCount;
00432 
00433     <font class="keyword">const</font> size_type     m_blockSize;
00434 
00435     <a class="code" href="class_xalansourcetreeattr.html">ObjectType</a>*         m_objectBlock;
00436 
00437     AllocatorType       m_allocator;
00438 };
00439 
00440 
00441 
00442 <font class="preprocessor">#endif  // !defined(ARENABLOCK_INCLUDE_GUARD_1357924680)
</font></div></pre><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="images/dot.gif" width="1"></TD></TR></TABLE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%">
	<TR>
		<TD WIDTH="80%" VALIGN="TOP">
			<P ALIGN="CENTER"><B>Xalan-C++ XSL Transformer Version 1.1</B><BR>
			Copyright &copy; 2000, 2001 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">
		</TD>
	</TR>
</TABLE>