Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 47

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Crystal Space 1.2.1: csutil/bitarray.h Source File (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</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="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>csutil/bitarray.h</h1><a href="bitarray_8h.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) 2000 by Andrew Kirmse</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">    This library is free software; you can redistribute it and/or</span>
<a name="l00005"></a>00005 <span class="comment">    modify it under the terms of the GNU Library General Public</span>
<a name="l00006"></a>00006 <span class="comment">    License as published by the Free Software Foundation; either</span>
<a name="l00007"></a>00007 <span class="comment">    version 2 of the License, or (at your option) any later version.</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment">    This library is distributed in the hope that it will be useful,</span>
<a name="l00010"></a>00010 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00011"></a>00011 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00012"></a>00012 <span class="comment">    Library General Public License for more details.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">    You should have received a copy of the GNU Library General Public</span>
<a name="l00015"></a>00015 <span class="comment">    License along with this library; if not, write to the Free</span>
<a name="l00016"></a>00016 <span class="comment">    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="comment">// A one-dimensional array of bits, similar to STL bitset.</span>
<a name="l00020"></a>00020 <span class="comment">//</span>
<a name="l00021"></a>00021 <span class="comment">// Copyright 2000 Andrew Kirmse.  All rights reserved.</span>
<a name="l00022"></a>00022 <span class="comment">//</span>
<a name="l00023"></a>00023 <span class="comment">// Permission is granted to use this code for any purpose, as long as this</span>
<a name="l00024"></a>00024 <span class="comment">// copyright message remains intact.</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef __CS_BITARRAY_H__</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define __CS_BITARRAY_H__</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "csextern.h"</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="allocator_8h.html" title="Basic allocator classes.">allocator.h</a>"</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include "bitops.h"</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="comparator_8h.html" title="Template providing various comparison and ordering functions.">comparator.h</a>"</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="hash_8h.html" title="A generic hash table.">hash.h</a>"</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="preprocessor">#if defined(CS_COMPILER_MSVC) &amp;&amp; (CS_PROCESSOR_SIZE == 64)</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="comment">/* long is 32 bit even on 64-bit MSVC, so use uint64 to utilize a storage in</span>
<a name="l00041"></a>00041 <span class="comment"> * 64 bit units.</span>
<a name="l00042"></a>00042 <span class="comment"> */</span>
<a name="l00043"></a>00043 <span class="keyword">typedef</span> <a class="code" href="group__util.html#g058a7c8f752204f23318dc1dcab45b1c" title="unsigned 64-bit integer">uint64</a> <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>;
<a name="l00044"></a>00044 <span class="preprocessor">#else</span>
<a name="l00046"></a><a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3">00046</a> <span class="preprocessor">typedef unsigned long csBitArrayStorageType;</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00048"></a><a class="code" href="bitarray_8h.html#c9580ed7b60cb9b846b75399182a674c">00048</a> <span class="preprocessor"></span><span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code" href="bitarray_8h.html#c9580ed7b60cb9b846b75399182a674c">csBitArrayDefaultInlineBits</a> = 
<a name="l00049"></a>00049   <span class="keyword">sizeof</span> (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>) * 8;
<a name="l00050"></a>00050   
<a name="l00051"></a>00051   
<a name="l00053"></a>00053 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> BitArray&gt;
<a name="l00054"></a><a class="code" href="classcsComparatorBitArray.html">00054</a> <span class="keyword">class </span><a class="code" href="classcsComparatorBitArray.html" title="Base comparator for bit arrays.">csComparatorBitArray</a>
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056 <span class="keyword">public</span>:
<a name="l00057"></a><a class="code" href="classcsComparatorBitArray.html#d1271ccc227682f51cf98bef2d6b20f9">00057</a>   <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classcsComparatorBitArray.html#d1271ccc227682f51cf98bef2d6b20f9">Compare</a> (BitArray <span class="keyword">const</span>&amp; key1, BitArray <span class="keyword">const</span>&amp; key2)
<a name="l00058"></a>00058   {
<a name="l00059"></a>00059     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p0 = key1.GetStore();
<a name="l00060"></a>00060     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p1 = key2.GetStore();
<a name="l00061"></a>00061     <span class="keywordtype">size_t</span> compareNum = MIN (key1.mLength, key2.mLength);
<a name="l00062"></a>00062     <span class="keywordtype">size_t</span> i = 0;
<a name="l00063"></a>00063     <span class="keywordflow">for</span> (; i &lt; compareNum; i++)
<a name="l00064"></a>00064       <span class="keywordflow">if</span> (p0[i] != p1[i])
<a name="l00065"></a>00065         <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)p0[i] - (int)p1[i];
<a name="l00066"></a>00066     <span class="keywordflow">if</span> (key1.mLength &gt; key2.mLength)
<a name="l00067"></a>00067     {
<a name="l00068"></a>00068       <span class="keywordflow">for</span> (; i &lt; key1.mLength; i++)
<a name="l00069"></a>00069         <span class="keywordflow">if</span> (p0[i] != 0)
<a name="l00070"></a>00070           <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)p0[i];
<a name="l00071"></a>00071     }
<a name="l00072"></a>00072     <span class="keywordflow">else</span>
<a name="l00073"></a>00073     {
<a name="l00074"></a>00074       <span class="keywordflow">for</span> (; i &lt; key2.mLength; i++)
<a name="l00075"></a>00075         <span class="keywordflow">if</span> (p1[i] != 0)
<a name="l00076"></a>00076           <span class="keywordflow">return</span> -((int)p1[i]);
<a name="l00077"></a>00077     }
<a name="l00078"></a>00078     <span class="keywordflow">return</span> 0;
<a name="l00079"></a>00079   }
<a name="l00080"></a>00080 };
<a name="l00081"></a>00081 
<a name="l00082"></a>00082   
<a name="l00084"></a>00084 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> BitArray&gt;
<a name="l00085"></a><a class="code" href="classcsHashComputerBitArray.html">00085</a> <span class="keyword">class </span><a class="code" href="classcsHashComputerBitArray.html" title="Base hash computer for bit arrays.">csHashComputerBitArray</a>
<a name="l00086"></a>00086 {
<a name="l00087"></a>00087 <span class="keyword">public</span>:
<a name="l00088"></a><a class="code" href="classcsHashComputerBitArray.html#927e1d6605d91b7cf9a9e7ae2529cf03">00088</a>   <span class="keyword">static</span> <a class="code" href="group__util.html#g91ad9478d81a7aaf2593e8d9c3d06a14" title="Shortcut for default unsigned int.">uint</a> <a class="code" href="classcsHashComputerBitArray.html#927e1d6605d91b7cf9a9e7ae2529cf03">ComputeHash</a> (BitArray <span class="keyword">const</span>&amp; key)
<a name="l00089"></a>00089   {
<a name="l00090"></a>00090     <span class="keyword">const</span> <span class="keywordtype">size_t</span> uintCount = <span class="keyword">sizeof</span> (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>) / <span class="keyword">sizeof</span> (<a class="code" href="group__util.html#g91ad9478d81a7aaf2593e8d9c3d06a14" title="Shortcut for default unsigned int.">uint</a>);
<a name="l00091"></a>00091     <a class="code" href="group__util.html#g91ad9478d81a7aaf2593e8d9c3d06a14" title="Shortcut for default unsigned int.">uint</a> ui[uintCount];
<a name="l00092"></a>00092     <a class="code" href="group__util.html#g91ad9478d81a7aaf2593e8d9c3d06a14" title="Shortcut for default unsigned int.">uint</a> hash = 0;
<a name="l00093"></a>00093     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p = key.GetStore();
<a name="l00094"></a>00094     <span class="comment">// \todo Not very good. Find a better hash function; however, it should</span>
<a name="l00095"></a>00095     <span class="comment">// return the same hash for two bit arrays that are the same except for</span>
<a name="l00096"></a>00096     <span class="comment">// the amount of trailing zeros. (e.g. f(10010110) == f(100101100000...))</span>
<a name="l00097"></a>00097     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; key.mLength; i++)
<a name="l00098"></a>00098     {
<a name="l00099"></a>00099       memcpy (ui, &amp;p[i], <span class="keyword">sizeof</span> (ui));
<a name="l00100"></a>00100       <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j &lt; uintCount; j++)
<a name="l00101"></a>00101         hash += ui[j];
<a name="l00102"></a>00102     }
<a name="l00103"></a>00103     <span class="keywordflow">return</span> hash;
<a name="l00104"></a>00104   }
<a name="l00105"></a>00105 };
<a name="l00106"></a>00106 
<a name="l00126"></a>00126 <span class="keyword">template</span>&lt;<span class="keywordtype">int</span> InlinedBits = <a class="code" href="bitarray_8h.html#c9580ed7b60cb9b846b75399182a674c">csBitArrayDefaultInlineBits</a>,
<a name="l00127"></a>00127   <span class="keyword">typename</span> Allocator = <a class="code" href="classCS_1_1Memory_1_1AllocatorMalloc.html" title="A default memory allocator that allocates with cs_malloc().">CS::Memory::AllocatorMalloc</a>&gt;
<a name="l00128"></a><a class="code" href="classcsBitArrayTweakable.html">00128</a> <span class="keyword">class </span><a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130 <span class="keyword">public</span>:
<a name="l00131"></a><a class="code" href="classcsBitArrayTweakable.html#2a9668683039bad69d89b38ad48af96a">00131</a>   <span class="keyword">typedef</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable&lt;InlinedBits, Allocator&gt;</a> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">ThisType</a>;
<a name="l00132"></a><a class="code" href="classcsBitArrayTweakable.html#2bf3c44e1401d45596a0bd9d11228ace">00132</a>   <span class="keyword">typedef</span> Allocator <a class="code" href="classCS_1_1Memory_1_1AllocatorMalloc.html" title="A default memory allocator that allocates with cs_malloc().">AllocatorType</a>;
<a name="l00133"></a>00133 
<a name="l00134"></a>00134 <span class="keyword">private</span>:
<a name="l00135"></a><a class="code" href="classcsBitArrayTweakable.html#2f7d62307e069e4d860f34fe79a1baee">00135</a>   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> BitArray&gt; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsComparatorBitArray.html" title="Base comparator for bit arrays.">csComparatorBitArray</a>;
<a name="l00136"></a><a class="code" href="classcsBitArrayTweakable.html#8222785daa12622e6ecd7394bcab47e0">00136</a>   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> BitArray&gt; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsHashComputerBitArray.html" title="Base hash computer for bit arrays.">csHashComputerBitArray</a>;
<a name="l00137"></a>00137 
<a name="l00138"></a>00138   <span class="keyword">enum</span>
<a name="l00139"></a>00139   {
<a name="l00140"></a>00140     cellSize    = <a class="code" href="bitarray_8h.html#c9580ed7b60cb9b846b75399182a674c">csBitArrayDefaultInlineBits</a>,
<a name="l00141"></a>00141     cellCount   = (InlinedBits + (cellSize-1)) / cellSize
<a name="l00142"></a>00142   };
<a name="l00143"></a>00143 
<a name="l00144"></a>00144   <span class="keyword">struct </span>Storage : <span class="keyword">public</span> Allocator
<a name="l00145"></a>00145   {
<a name="l00146"></a>00146     <span class="keyword">union</span>
<a name="l00147"></a>00147     {
<a name="l00148"></a>00148       <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* heapStore;
<a name="l00149"></a>00149       <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> inlineStore[cellCount];
<a name="l00150"></a>00150     };
<a name="l00151"></a>00151     Storage()
<a name="l00152"></a>00152     {
<a name="l00153"></a>00153       memset (&amp;inlineStore, 0, 
<a name="l00154"></a>00154         MAX(<span class="keyword">sizeof</span> (heapStore), <span class="keyword">sizeof</span> (inlineStore)));
<a name="l00155"></a>00155     }
<a name="l00156"></a>00156   };
<a name="l00157"></a>00157   Storage storage;
<a name="l00159"></a>00159   <span class="keywordtype">size_t</span> mLength;          
<a name="l00160"></a>00160   <span class="keywordtype">size_t</span> mNumBits;
<a name="l00161"></a>00161 
<a name="l00163"></a>00163   <span class="keyword">static</span> <span class="keywordtype">size_t</span> GetIndex (<span class="keywordtype">size_t</span> bit_num)
<a name="l00164"></a>00164   {
<a name="l00165"></a>00165     <span class="keywordflow">return</span> bit_num / cellSize;
<a name="l00166"></a>00166   }
<a name="l00167"></a>00167 
<a name="l00169"></a>00169   <span class="keyword">static</span> <span class="keywordtype">size_t</span> GetOffset (<span class="keywordtype">size_t</span> bit_num)
<a name="l00170"></a>00170   {
<a name="l00171"></a>00171     <span class="keywordflow">return</span> bit_num % cellSize;
<a name="l00172"></a>00172   }
<a name="l00173"></a>00173 
<a name="l00175"></a>00175   <span class="keywordtype">bool</span> UseInlineStore ()<span class="keyword"> const</span>
<a name="l00176"></a>00176 <span class="keyword">  </span>{
<a name="l00177"></a>00177     <span class="keywordflow">return</span> mLength &lt;= cellCount;
<a name="l00178"></a>00178   }
<a name="l00179"></a>00179 
<a name="l00184"></a>00184   <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* GetStore()<span class="keyword"> const</span>
<a name="l00185"></a>00185 <span class="keyword">  </span>{
<a name="l00186"></a>00186     <span class="keywordflow">return</span> UseInlineStore () ? storage.inlineStore : storage.heapStore;
<a name="l00187"></a>00187   }
<a name="l00188"></a>00188 
<a name="l00193"></a>00193   <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* GetStore()
<a name="l00194"></a>00194   {
<a name="l00195"></a>00195     <span class="keywordflow">return</span> UseInlineStore () ? storage.inlineStore : storage.heapStore;
<a name="l00196"></a>00196   }
<a name="l00197"></a>00197 
<a name="l00199"></a>00199   <span class="keywordtype">void</span> Trim()
<a name="l00200"></a>00200   {
<a name="l00201"></a>00201     <span class="keywordtype">size_t</span> extra_bits = mNumBits % cellSize;
<a name="l00202"></a>00202     <span class="keywordflow">if</span> (mLength &gt; 0 &amp;&amp; extra_bits != 0)
<a name="l00203"></a>00203       GetStore()[mLength - 1] &amp;= ~((~(<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>)0) &lt;&lt; extra_bits);
<a name="l00204"></a>00204   }
<a name="l00205"></a>00205 
<a name="l00206"></a>00206 <span class="keyword">public</span>:
<a name="l00210"></a><a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html">00210</a>   <span class="keyword">class </span><a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html">BitProxy</a>
<a name="l00211"></a>00211   {
<a name="l00212"></a>00212   <span class="keyword">private</span>:
<a name="l00213"></a>00213     <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; mArray;
<a name="l00214"></a>00214     <span class="keywordtype">size_t</span> mPos;
<a name="l00215"></a>00215   <span class="keyword">public</span>:
<a name="l00217"></a><a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#49090c062dfe4461be876c428eec1781">00217</a>     <a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#49090c062dfe4461be876c428eec1781" title="Constructor.">BitProxy</a> (<a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; array, <span class="keywordtype">size_t</span> pos): mArray(array), mPos(pos)
<a name="l00218"></a>00218     {}
<a name="l00219"></a>00219 
<a name="l00221"></a><a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#79ead8f756255a7b88e93faf149ba435">00221</a>     <a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html">BitProxy</a> &amp;<a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#79ead8f756255a7b88e93faf149ba435" title="Boolean assignment.">operator= </a>(<span class="keywordtype">bool</span> value)
<a name="l00222"></a>00222     {
<a name="l00223"></a>00223       mArray.<a class="code" href="classcsBitArrayTweakable.html#a50b928e221ee91e073ed651bf04e430" title="Set the bit at position pos to the given value.">Set</a> (mPos, value);
<a name="l00224"></a>00224       <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00225"></a>00225     }
<a name="l00226"></a>00226 
<a name="l00228"></a><a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#6ceb42c3524516f0f8801c62d2e56782">00228</a>     <a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html">BitProxy</a> &amp;<a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#79ead8f756255a7b88e93faf149ba435" title="Boolean assignment.">operator= </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html">BitProxy</a> &amp;that)
<a name="l00229"></a>00229     {
<a name="l00230"></a>00230       mArray.<a class="code" href="classcsBitArrayTweakable.html#a50b928e221ee91e073ed651bf04e430" title="Set the bit at position pos to the given value.">Set</a> (mPos, that.<a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#8b09530e735dbf1e7f9294c1ff9c56a2">mArray</a>.<a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5" title="Returns true if the bit at position pos is true.">IsBitSet</a> (that.<a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#51d770082327c6398c0e68516fee56f5">mPos</a>));
<a name="l00231"></a>00231       <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00232"></a>00232     }
<a name="l00233"></a>00233 
<a name="l00235"></a><a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#173cf5fdafc9cfa9bc8f2f09b9530d9e">00235</a>     <a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#173cf5fdafc9cfa9bc8f2f09b9530d9e" title="Boolean accessor.">operator bool</a>()<span class="keyword"> const</span>
<a name="l00236"></a>00236 <span class="keyword">    </span>{
<a name="l00237"></a>00237       <span class="keywordflow">return</span> mArray.<a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5" title="Returns true if the bit at position pos is true.">IsBitSet</a> (mPos);
<a name="l00238"></a>00238     }
<a name="l00239"></a>00239 
<a name="l00244"></a><a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#da358f6558e3afd86eae9f67027f9f55">00244</a>     <span class="keywordtype">bool</span> <a class="code" href="classcsBitArrayTweakable_1_1BitProxy.html#da358f6558e3afd86eae9f67027f9f55" title="Flip state of this bit.">Flip</a>()
<a name="l00245"></a>00245     {
<a name="l00246"></a>00246       mArray.<a class="code" href="classcsBitArrayTweakable.html#4cf5c01d6809c98519a5150ad1a966e7" title="Toggle the bit at position pos.">FlipBit</a> (mPos);
<a name="l00247"></a>00247       <span class="keywordflow">return</span> mArray.<a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5" title="Returns true if the bit at position pos is true.">IsBitSet</a> (mPos);
<a name="l00248"></a>00248     }
<a name="l00249"></a>00249   };
<a name="l00250"></a><a class="code" href="classcsBitArrayTweakable.html#d6beb8432ed0c48a2bce4a01384ce5cb">00250</a>   <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsBitArrayTweakable.html#d6beb8432ed0c48a2bce4a01384ce5cb">BitProxy</a>;
<a name="l00251"></a>00251 
<a name="l00255"></a><a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341">00255</a>   <a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341" title="Default constructor.">csBitArrayTweakable</a> () : mLength(0), mNumBits(0)
<a name="l00256"></a>00256   {
<a name="l00257"></a>00257     <a class="code" href="classcsBitArrayTweakable.html#f28fa356cfb8e93cdba60ad5b67788bd" title="Set the number of stored bits.">SetSize</a> (0);
<a name="l00258"></a>00258   }
<a name="l00259"></a>00259 
<a name="l00263"></a><a class="code" href="classcsBitArrayTweakable.html#2d46e6972b9bec7492004c29987921f4">00263</a>   <span class="keyword">explicit</span> <a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341" title="Default constructor.">csBitArrayTweakable</a> (<span class="keywordtype">size_t</span> size) : mLength(0), mNumBits(0)
<a name="l00264"></a>00264   {
<a name="l00265"></a>00265     <a class="code" href="classcsBitArrayTweakable.html#f28fa356cfb8e93cdba60ad5b67788bd" title="Set the number of stored bits.">SetSize</a> (size);
<a name="l00266"></a>00266   }
<a name="l00267"></a>00267 
<a name="l00271"></a><a class="code" href="classcsBitArrayTweakable.html#efd66d9d1d2efa83d7c03489882dc717">00271</a>   <a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341" title="Default constructor.">csBitArrayTweakable</a> (<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; that) : mLength(0), mNumBits(0)
<a name="l00272"></a>00272   {
<a name="l00273"></a>00273     *<span class="keyword">this</span> = that; <span class="comment">// Invokes this-&gt;operator=().</span>
<a name="l00274"></a>00274   }
<a name="l00275"></a>00275 
<a name="l00277"></a><a class="code" href="classcsBitArrayTweakable.html#8d7ec76aa4f3c5746177e02f11dad4a5">00277</a>   <a class="code" href="classcsBitArrayTweakable.html#8d7ec76aa4f3c5746177e02f11dad4a5" title="Destructor.">~csBitArrayTweakable</a>()
<a name="l00278"></a>00278   {
<a name="l00279"></a>00279     <span class="keywordflow">if</span> (!UseInlineStore ())
<a name="l00280"></a>00280       storage.Free (storage.heapStore);
<a name="l00281"></a>00281   }
<a name="l00282"></a>00282 
<a name="l00284"></a><a class="code" href="classcsBitArrayTweakable.html#0ad8b92f5ea6b9fa13933d8493adbca7">00284</a>   <span class="keywordtype">size_t</span> <a class="code" href="classcsBitArrayTweakable.html#0ad8b92f5ea6b9fa13933d8493adbca7" title="Return the number of stored bits.">GetSize</a>()<span class="keyword"> const</span>
<a name="l00285"></a>00285 <span class="keyword">  </span>{
<a name="l00286"></a>00286     <span class="keywordflow">return</span> mNumBits;
<a name="l00287"></a>00287   }
<a name="l00288"></a>00288 
<a name="l00293"></a>00293   <span class="comment">/*CS_DEPRECATED_METHOD_MSG("Use GetSize() instead.")*/</span>
<a name="l00294"></a><a class="code" href="classcsBitArrayTweakable.html#128d57333239991578c7154bcab0d2a7">00294</a>   <span class="keywordtype">size_t</span> <a class="code" href="classcsBitArrayTweakable.html#128d57333239991578c7154bcab0d2a7" title="Return the number of stored bits.">Length</a> ()<span class="keyword"> const</span>
<a name="l00295"></a>00295 <span class="keyword">  </span>{
<a name="l00296"></a>00296     <span class="keywordflow">return</span> <a class="code" href="classcsBitArrayTweakable.html#0ad8b92f5ea6b9fa13933d8493adbca7" title="Return the number of stored bits.">GetSize</a>();
<a name="l00297"></a>00297   }
<a name="l00298"></a>00298 
<a name="l00303"></a>00303   <span class="comment">/*CS_DEPRECATED_METHOD_MSG("Use SetSize() instead.")*/</span>
<a name="l00304"></a><a class="code" href="classcsBitArrayTweakable.html#df7388eb0fefff7e097faa2ce3be68e8">00304</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#df7388eb0fefff7e097faa2ce3be68e8" title="Set the number of stored bits.">SetLength</a> (<span class="keywordtype">size_t</span> newSize)
<a name="l00305"></a>00305   {
<a name="l00306"></a>00306     <a class="code" href="classcsBitArrayTweakable.html#f28fa356cfb8e93cdba60ad5b67788bd" title="Set the number of stored bits.">SetSize</a> (newSize);
<a name="l00307"></a>00307   }
<a name="l00308"></a>00308 
<a name="l00314"></a><a class="code" href="classcsBitArrayTweakable.html#f28fa356cfb8e93cdba60ad5b67788bd">00314</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#f28fa356cfb8e93cdba60ad5b67788bd" title="Set the number of stored bits.">SetSize</a> (<span class="keywordtype">size_t</span> newSize)
<a name="l00315"></a>00315   {
<a name="l00316"></a>00316     <span class="keywordtype">size_t</span> newLength;
<a name="l00317"></a>00317     <span class="keywordflow">if</span> (newSize == 0)
<a name="l00318"></a>00318       newLength = 0;
<a name="l00319"></a>00319     <span class="keywordflow">else</span>
<a name="l00320"></a>00320       newLength = 1 + GetIndex (newSize - 1);
<a name="l00321"></a>00321 
<a name="l00322"></a>00322     <span class="keywordflow">if</span> (newLength != mLength)
<a name="l00323"></a>00323     {
<a name="l00324"></a>00324       <span class="comment">// Avoid allocation if length is 1 (common case)</span>
<a name="l00325"></a>00325       <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* newStore;
<a name="l00326"></a>00326       <span class="keywordflow">if</span> (newLength &lt;= cellCount)
<a name="l00327"></a>00327         newStore = storage.inlineStore;
<a name="l00328"></a>00328       <span class="keywordflow">else</span>
<a name="l00329"></a>00329         newStore = (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>*)storage.Alloc (
<a name="l00330"></a>00330           newLength * sizeof (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>));
<a name="l00331"></a>00331 
<a name="l00332"></a>00332       <span class="keywordflow">if</span> (newLength &gt; 0)
<a name="l00333"></a>00333       {
<a name="l00334"></a>00334         <span class="keywordflow">if</span> (mLength &gt; 0)
<a name="l00335"></a>00335         {
<a name="l00336"></a>00336           <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* oldStore = GetStore();
<a name="l00337"></a>00337           <span class="keywordflow">if</span> (newStore != oldStore)
<a name="l00338"></a>00338           {
<a name="l00339"></a>00339             memcpy (newStore, oldStore, 
<a name="l00340"></a>00340               (MIN (mLength, newLength)) * <span class="keyword">sizeof</span> (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>));
<a name="l00341"></a>00341             <span class="keywordflow">if</span> (newLength &gt; mLength)
<a name="l00342"></a>00342               memset(newStore + mLength, 0,
<a name="l00343"></a>00343                      (newLength - mLength) * <span class="keyword">sizeof</span> (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>));
<a name="l00344"></a>00344             <span class="keywordflow">if</span> (!UseInlineStore ())
<a name="l00345"></a>00345               storage.Free (oldStore);
<a name="l00346"></a>00346           }
<a name="l00347"></a>00347         }
<a name="l00348"></a>00348         <span class="keywordflow">else</span>
<a name="l00349"></a>00349           memset (newStore, 0, newLength * <span class="keyword">sizeof</span> (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>));
<a name="l00350"></a>00350       }
<a name="l00351"></a>00351       mLength = newLength;
<a name="l00352"></a>00352       <span class="keywordflow">if</span> (!UseInlineStore()) storage.heapStore = newStore;
<a name="l00353"></a>00353     }
<a name="l00354"></a>00354 
<a name="l00355"></a>00355     mNumBits = newSize;
<a name="l00356"></a>00356     Trim();
<a name="l00357"></a>00357   }
<a name="l00358"></a>00358 
<a name="l00359"></a>00359   <span class="comment">//</span>
<a name="l00360"></a>00360   <span class="comment">// Operators</span>
<a name="l00361"></a>00361   <span class="comment">//</span>
<a name="l00362"></a>00362 
<a name="l00364"></a><a class="code" href="classcsBitArrayTweakable.html#41e662fcd4af86014d40b7e41f8dc3a3">00364</a>   <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; <a class="code" href="classcsBitArrayTweakable.html#41e662fcd4af86014d40b7e41f8dc3a3" title="Copy from other array.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; that)
<a name="l00365"></a>00365   {
<a name="l00366"></a>00366     <span class="keywordflow">if</span> (<span class="keyword">this</span> != &amp;that)
<a name="l00367"></a>00367     {
<a name="l00368"></a>00368       <a class="code" href="classcsBitArrayTweakable.html#f28fa356cfb8e93cdba60ad5b67788bd" title="Set the number of stored bits.">SetSize</a> (that.<a class="code" href="classcsBitArrayTweakable.html#b4d2bb42dac5de1f202fde6b3fd5319c">mNumBits</a>);
<a name="l00369"></a>00369       memcpy (GetStore(), that.<a class="code" href="classcsBitArrayTweakable.html#6f7c7e2bc0f593507d3f91812f7aaeed" title="Get a constant pointer to bit store, which may be internal mSingleWord or heap-allocated...">GetStore</a>(), 
<a name="l00370"></a>00370         mLength * <span class="keyword">sizeof</span> (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>));
<a name="l00371"></a>00371     }
<a name="l00372"></a>00372     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00373"></a>00373   }
<a name="l00374"></a>00374 
<a name="l00376"></a><a class="code" href="classcsBitArrayTweakable.html#5594686969b53c07096be1518539063b">00376</a>   <a class="code" href="classcsBitArrayTweakable.html#d6beb8432ed0c48a2bce4a01384ce5cb">BitProxy</a> <a class="code" href="classcsBitArrayTweakable.html#5594686969b53c07096be1518539063b" title="Return bit at position pos.">operator[] </a>(<span class="keywordtype">size_t</span> pos)
<a name="l00377"></a>00377   {
<a name="l00378"></a>00378     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (pos &lt; mNumBits);
<a name="l00379"></a>00379     <span class="keywordflow">return</span> <a class="code" href="classcsBitArrayTweakable.html#d6beb8432ed0c48a2bce4a01384ce5cb">BitProxy</a>(*<span class="keyword">this</span>, pos);
<a name="l00380"></a>00380   }
<a name="l00381"></a>00381 
<a name="l00383"></a><a class="code" href="classcsBitArrayTweakable.html#84374333155be95c346b78af1863873c">00383</a>   <span class="keywordtype">bool</span> <a class="code" href="classcsBitArrayTweakable.html#5594686969b53c07096be1518539063b" title="Return bit at position pos.">operator[] </a>(<span class="keywordtype">size_t</span> pos)<span class="keyword"> const</span>
<a name="l00384"></a>00384 <span class="keyword">  </span>{
<a name="l00385"></a>00385     <span class="keywordflow">return</span> <a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5" title="Returns true if the bit at position pos is true.">IsBitSet</a>(pos);
<a name="l00386"></a>00386   }
<a name="l00387"></a>00387 
<a name="l00389"></a><a class="code" href="classcsBitArrayTweakable.html#4881c018fc4d6414f3fc7020c1f20c03">00389</a>   <span class="keywordtype">bool</span> <a class="code" href="classcsBitArrayTweakable.html#4881c018fc4d6414f3fc7020c1f20c03" title="Equal to other array?">operator==</a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; that)<span class="keyword"> const</span>
<a name="l00390"></a>00390 <span class="keyword">  </span>{
<a name="l00391"></a>00391     <span class="keywordflow">if</span> (mNumBits != that.<a class="code" href="classcsBitArrayTweakable.html#b4d2bb42dac5de1f202fde6b3fd5319c">mNumBits</a>)
<a name="l00392"></a>00392       <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00393"></a>00393 
<a name="l00394"></a>00394     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p0 = GetStore();
<a name="l00395"></a>00395     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p1 = that.<a class="code" href="classcsBitArrayTweakable.html#6f7c7e2bc0f593507d3f91812f7aaeed" title="Get a constant pointer to bit store, which may be internal mSingleWord or heap-allocated...">GetStore</a>();
<a name="l00396"></a>00396     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i &lt; mLength; i++)
<a name="l00397"></a>00397       <span class="keywordflow">if</span> (p0[i] != p1[i])
<a name="l00398"></a>00398         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00399"></a>00399     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00400"></a>00400   }
<a name="l00401"></a>00401 
<a name="l00403"></a><a class="code" href="classcsBitArrayTweakable.html#00555f336ebf6dbf5a3d1fb759770ce1">00403</a>   <span class="keywordtype">bool</span> <a class="code" href="classcsBitArrayTweakable.html#00555f336ebf6dbf5a3d1fb759770ce1" title="Not equal to other array?">operator != </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; that)<span class="keyword"> const</span>
<a name="l00404"></a>00404 <span class="keyword">  </span>{
<a name="l00405"></a>00405     <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == that);
<a name="l00406"></a>00406   }
<a name="l00407"></a>00407 
<a name="l00409"></a><a class="code" href="classcsBitArrayTweakable.html#cb0b96d63bdb01ffcf83f212d577201b">00409</a>   <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; <a class="code" href="classcsBitArrayTweakable.html#cb0b96d63bdb01ffcf83f212d577201b" title="Bit-wise `and&amp;#39;. The arrays must be the same length.">operator &amp;= </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> &amp;that)
<a name="l00410"></a>00410   {
<a name="l00411"></a>00411     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (mNumBits == that.<a class="code" href="classcsBitArrayTweakable.html#b4d2bb42dac5de1f202fde6b3fd5319c">mNumBits</a>);
<a name="l00412"></a>00412     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* p0 = GetStore();
<a name="l00413"></a>00413     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p1 = that.<a class="code" href="classcsBitArrayTweakable.html#6f7c7e2bc0f593507d3f91812f7aaeed" title="Get a constant pointer to bit store, which may be internal mSingleWord or heap-allocated...">GetStore</a>();
<a name="l00414"></a>00414     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; mLength; i++)
<a name="l00415"></a>00415       p0[i] &amp;= p1[i];
<a name="l00416"></a>00416     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00417"></a>00417   }
<a name="l00418"></a>00418 
<a name="l00420"></a><a class="code" href="classcsBitArrayTweakable.html#b071304df036ccdb7664371f9c4b3e17">00420</a>   <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> <a class="code" href="classcsBitArrayTweakable.html#b071304df036ccdb7664371f9c4b3e17" title="Bit-wise `or&amp;#39;. The arrays must be the same length.">operator |= </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; that)
<a name="l00421"></a>00421   {
<a name="l00422"></a>00422     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (mNumBits == that.<a class="code" href="classcsBitArrayTweakable.html#b4d2bb42dac5de1f202fde6b3fd5319c">mNumBits</a>);
<a name="l00423"></a>00423     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* p0 = GetStore();
<a name="l00424"></a>00424     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p1 = that.<a class="code" href="classcsBitArrayTweakable.html#6f7c7e2bc0f593507d3f91812f7aaeed" title="Get a constant pointer to bit store, which may be internal mSingleWord or heap-allocated...">GetStore</a>();
<a name="l00425"></a>00425     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; mLength; i++)
<a name="l00426"></a>00426       p0[i] |= p1[i];
<a name="l00427"></a>00427     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00428"></a>00428   }
<a name="l00429"></a>00429 
<a name="l00431"></a><a class="code" href="classcsBitArrayTweakable.html#d6ec827e0e46b656d28a1b6c09a34d1a">00431</a>   <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> <a class="code" href="classcsBitArrayTweakable.html#d6ec827e0e46b656d28a1b6c09a34d1a" title="Bit-wise `xor&amp;#39;. The arrays must be the same length.">operator ^= </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; that)
<a name="l00432"></a>00432   {
<a name="l00433"></a>00433     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (mNumBits == that.<a class="code" href="classcsBitArrayTweakable.html#b4d2bb42dac5de1f202fde6b3fd5319c">mNumBits</a>);
<a name="l00434"></a>00434     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* p0 = GetStore();
<a name="l00435"></a>00435     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p1 = that.<a class="code" href="classcsBitArrayTweakable.html#6f7c7e2bc0f593507d3f91812f7aaeed" title="Get a constant pointer to bit store, which may be internal mSingleWord or heap-allocated...">GetStore</a>();
<a name="l00436"></a>00436     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; mLength; i++)
<a name="l00437"></a>00437       p0[i] ^= p1[i];
<a name="l00438"></a>00438     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00439"></a>00439   }
<a name="l00440"></a>00440 
<a name="l00442"></a><a class="code" href="classcsBitArrayTweakable.html#475a4f3d836b8a99d547058444232ca4">00442</a>   <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> <a class="code" href="classcsBitArrayTweakable.html#475a4f3d836b8a99d547058444232ca4" title="Return complement bit array in which all bits are flipped from this one.">operator~</a>()<span class="keyword"> const</span>
<a name="l00443"></a>00443 <span class="keyword">  </span>{
<a name="l00444"></a>00444     <span class="keywordflow">return</span> <a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341" title="Default constructor.">csBitArrayTweakable</a>(*this).FlipAllBits();
<a name="l00445"></a>00445   }
<a name="l00446"></a>00446 
<a name="l00448"></a><a class="code" href="classcsBitArrayTweakable.html#071a12fedf7e3bf7520c1e12fe257b13">00448</a>   <span class="keyword">friend</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> <a class="code" href="classcsBitArrayTweakable.html#071a12fedf7e3bf7520c1e12fe257b13" title="Bit-wise `and&amp;#39;. The arrays must be the same length.">operator&amp; </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; a1, 
<a name="l00449"></a>00449     <span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; a2)
<a name="l00450"></a>00450   {
<a name="l00451"></a>00451     <span class="keywordflow">return</span> <a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341" title="Default constructor.">csBitArrayTweakable</a> (a1) &amp;= a2;
<a name="l00452"></a>00452   }
<a name="l00453"></a>00453 
<a name="l00455"></a><a class="code" href="classcsBitArrayTweakable.html#36595db59014ff0667390c17cff5c2d3">00455</a>   <span class="keyword">friend</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> <a class="code" href="classcsBitArrayTweakable.html#36595db59014ff0667390c17cff5c2d3" title="Bit-wise `or&amp;#39;. The arrays must be the same length.">operator | </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; a1, 
<a name="l00456"></a>00456     <span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; a2)
<a name="l00457"></a>00457   {
<a name="l00458"></a>00458     <span class="keywordflow">return</span> <a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341" title="Default constructor.">csBitArrayTweakable</a> (a1) |= a2;
<a name="l00459"></a>00459   }
<a name="l00460"></a>00460 
<a name="l00462"></a><a class="code" href="classcsBitArrayTweakable.html#f297d7d29f13de0ff15b6872b0fe1b77">00462</a>   <span class="keyword">friend</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> <a class="code" href="classcsBitArrayTweakable.html#f297d7d29f13de0ff15b6872b0fe1b77" title="Bit-wise `xor&amp;#39;. The arrays must be the same length.">operator ^ </a>(<span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; a1, 
<a name="l00463"></a>00463     <span class="keyword">const</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; a2)
<a name="l00464"></a>00464   {
<a name="l00465"></a>00465     <span class="keywordflow">return</span> <a class="code" href="classcsBitArrayTweakable.html#f04b099991a8b5d71b76b4d6f3f8e341" title="Default constructor.">csBitArrayTweakable</a> (a1) ^= a2;
<a name="l00466"></a>00466   }
<a name="l00467"></a>00467 
<a name="l00468"></a>00468   <span class="comment">//</span>
<a name="l00469"></a>00469   <span class="comment">// Plain English interface</span>
<a name="l00470"></a>00470   <span class="comment">//</span>
<a name="l00471"></a>00471 
<a name="l00473"></a><a class="code" href="classcsBitArrayTweakable.html#883d8d49f4eefe77928a6e2bc349890c">00473</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#883d8d49f4eefe77928a6e2bc349890c" title="Set all bits to false.">Clear</a>()
<a name="l00474"></a>00474   {
<a name="l00475"></a>00475     memset (GetStore(), 0, mLength * <span class="keyword">sizeof</span>(<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>));
<a name="l00476"></a>00476   }
<a name="l00477"></a>00477 
<a name="l00479"></a><a class="code" href="classcsBitArrayTweakable.html#6aeffd755ca99af6daab5d0b0d564fdc">00479</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#6aeffd755ca99af6daab5d0b0d564fdc" title="Set the bit at position pos to true.">SetBit</a> (<span class="keywordtype">size_t</span> pos)
<a name="l00480"></a>00480   {
<a name="l00481"></a>00481     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (pos &lt; mNumBits);
<a name="l00482"></a>00482     GetStore()[GetIndex(pos)] |= ((<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>)1) &lt;&lt; GetOffset(pos);
<a name="l00483"></a>00483   }
<a name="l00484"></a>00484 
<a name="l00486"></a><a class="code" href="classcsBitArrayTweakable.html#e4d3e322e75b3497ac23d418b54fb464">00486</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#e4d3e322e75b3497ac23d418b54fb464" title="Set the bit at position pos to false.">ClearBit</a> (<span class="keywordtype">size_t</span> pos)
<a name="l00487"></a>00487   {
<a name="l00488"></a>00488     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (pos &lt; mNumBits);
<a name="l00489"></a>00489     GetStore()[GetIndex(pos)] &amp;= ~(((<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>)1) &lt;&lt; GetOffset(pos));
<a name="l00490"></a>00490   }
<a name="l00491"></a>00491 
<a name="l00493"></a><a class="code" href="classcsBitArrayTweakable.html#4cf5c01d6809c98519a5150ad1a966e7">00493</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#4cf5c01d6809c98519a5150ad1a966e7" title="Toggle the bit at position pos.">FlipBit</a> (<span class="keywordtype">size_t</span> pos)
<a name="l00494"></a>00494   {
<a name="l00495"></a>00495     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (pos &lt; mNumBits);
<a name="l00496"></a>00496     GetStore()[GetIndex(pos)] ^= ((<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>)1) &lt;&lt; GetOffset(pos);
<a name="l00497"></a>00497   }
<a name="l00498"></a>00498 
<a name="l00500"></a><a class="code" href="classcsBitArrayTweakable.html#a50b928e221ee91e073ed651bf04e430">00500</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#a50b928e221ee91e073ed651bf04e430" title="Set the bit at position pos to the given value.">Set</a> (<span class="keywordtype">size_t</span> pos, <span class="keywordtype">bool</span> val = <span class="keyword">true</span>)
<a name="l00501"></a>00501   {
<a name="l00502"></a>00502     <span class="keywordflow">if</span> (val)
<a name="l00503"></a>00503       <a class="code" href="classcsBitArrayTweakable.html#6aeffd755ca99af6daab5d0b0d564fdc" title="Set the bit at position pos to true.">SetBit</a>(pos);
<a name="l00504"></a>00504     <span class="keywordflow">else</span>
<a name="l00505"></a>00505       <a class="code" href="classcsBitArrayTweakable.html#e4d3e322e75b3497ac23d418b54fb464" title="Set the bit at position pos to false.">ClearBit</a>(pos);
<a name="l00506"></a>00506   }
<a name="l00507"></a>00507 
<a name="l00509"></a><a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5">00509</a>   <span class="keywordtype">bool</span> <a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5" title="Returns true if the bit at position pos is true.">IsBitSet</a> (<span class="keywordtype">size_t</span> pos)<span class="keyword"> const</span>
<a name="l00510"></a>00510 <span class="keyword">  </span>{
<a name="l00511"></a>00511     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (pos &lt; mNumBits);
<a name="l00512"></a>00512     <span class="keywordflow">return</span> (GetStore()[GetIndex(pos)] 
<a name="l00513"></a>00513       &amp; (((<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>)1) &lt;&lt; GetOffset(pos))) != 0;
<a name="l00514"></a>00514   }
<a name="l00515"></a>00515 
<a name="l00517"></a><a class="code" href="classcsBitArrayTweakable.html#404f5ba789cecf357bc9003f796aa853">00517</a>   <span class="keywordtype">bool</span> <a class="code" href="classcsBitArrayTweakable.html#404f5ba789cecf357bc9003f796aa853" title="Checks whether at least one of count bits is set starting at pos.">AreSomeBitsSet</a> (<span class="keywordtype">size_t</span> pos, <span class="keywordtype">size_t</span> count)<span class="keyword"> const</span>
<a name="l00518"></a>00518 <span class="keyword">  </span>{
<a name="l00519"></a>00519     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (pos + count &lt;= mNumBits);
<a name="l00520"></a>00520     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p = GetStore();
<a name="l00521"></a>00521     <span class="keywordflow">while</span> (count &gt; 0)
<a name="l00522"></a>00522     {
<a name="l00523"></a>00523       <span class="keywordtype">size_t</span> index = GetIndex (pos);
<a name="l00524"></a>00524       <span class="keywordtype">size_t</span> offset = GetOffset (pos);
<a name="l00525"></a>00525       <span class="keywordtype">size_t</span> checkCount = MIN(count, cellSize - offset);
<a name="l00526"></a>00526       <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> mask = ((checkCount == cellSize) 
<a name="l00527"></a>00527         ? ~(<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>)0 
<a name="l00528"></a>00528         : ((((<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>)1) &lt;&lt; checkCount) - 1)) &lt;&lt; offset;
<a name="l00529"></a>00529       <span class="keywordflow">if</span> (p[index] &amp; mask)
<a name="l00530"></a>00530         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00531"></a>00531       pos += checkCount;
<a name="l00532"></a>00532       count -= checkCount;
<a name="l00533"></a>00533     }
<a name="l00534"></a>00534     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00535"></a>00535   }
<a name="l00536"></a>00536   
<a name="l00538"></a><a class="code" href="classcsBitArrayTweakable.html#66987f3ce43af4de58852b6671654dbd">00538</a>   <span class="keywordtype">bool</span> <a class="code" href="classcsBitArrayTweakable.html#66987f3ce43af4de58852b6671654dbd" title="Returns true if all bits are false.">AllBitsFalse</a>()<span class="keyword"> const</span>
<a name="l00539"></a>00539 <span class="keyword">  </span>{
<a name="l00540"></a>00540     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> <span class="keyword">const</span>* p = GetStore();
<a name="l00541"></a>00541     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; mLength; i++)
<a name="l00542"></a>00542       <span class="keywordflow">if</span> (p[i] != 0)
<a name="l00543"></a>00543         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00544"></a>00544     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00545"></a>00545   }
<a name="l00546"></a>00546 
<a name="l00548"></a><a class="code" href="classcsBitArrayTweakable.html#837beaac57a9180922ed6ff8c552264a">00548</a>   <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&amp; <a class="code" href="classcsBitArrayTweakable.html#837beaac57a9180922ed6ff8c552264a" title="Change value of all bits.">FlipAllBits</a>()
<a name="l00549"></a>00549   {
<a name="l00550"></a>00550     <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* p = GetStore();
<a name="l00551"></a>00551     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; mLength; i++)
<a name="l00552"></a>00552       p[i] = ~p[i];
<a name="l00553"></a>00553     Trim();
<a name="l00554"></a>00554     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00555"></a>00555   }
<a name="l00556"></a>00556   
<a name="l00558"></a><a class="code" href="classcsBitArrayTweakable.html#de2f25942d23de35a96c35ca52df6c4f">00558</a>   <span class="keywordtype">size_t</span> <a class="code" href="classcsBitArrayTweakable.html#de2f25942d23de35a96c35ca52df6c4f" title="Count the number of bits that are set.">NumBitsSet</a>()<span class="keyword"> const</span>
<a name="l00559"></a>00559 <span class="keyword">  </span>{
<a name="l00560"></a>00560     <span class="keyword">const</span> <span class="keywordtype">size_t</span> ui32perStorage = 
<a name="l00561"></a>00561       <span class="keyword">sizeof</span> (<a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>) / <span class="keyword">sizeof</span> (<a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a>);
<a name="l00562"></a>00562 
<a name="l00563"></a>00563     <span class="keyword">union</span>
<a name="l00564"></a>00564     {
<a name="l00565"></a>00565       <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a> s;
<a name="l00566"></a>00566       <a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a> ui32[ui32perStorage];
<a name="l00567"></a>00567     } v;
<a name="l00568"></a>00568 
<a name="l00569"></a>00569     <span class="keyword">const</span> <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* p = GetStore();
<a name="l00570"></a>00570     <span class="keywordtype">size_t</span> num = 0;
<a name="l00571"></a>00571     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; mLength; i++)
<a name="l00572"></a>00572     {
<a name="l00573"></a>00573       v.s = p[i];
<a name="l00574"></a>00574       <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j &lt; ui32perStorage; j++)
<a name="l00575"></a>00575         num += <a class="code" href="namespaceCS_1_1Utility_1_1BitOps.html#b402e32a94727a62254c3e0aadc55865" title="Compute number of bits set in given number.">CS::Utility::BitOps::ComputeBitsSet</a> (v.ui32[j]);
<a name="l00576"></a>00576     }
<a name="l00577"></a>00577 
<a name="l00578"></a>00578     <span class="keywordflow">return</span> num;
<a name="l00579"></a>00579   }
<a name="l00580"></a>00580 
<a name="l00585"></a><a class="code" href="classcsBitArrayTweakable.html#fd7ee919a37d5bac355d5034dbe52605">00585</a>   <span class="keywordtype">void</span> <a class="code" href="classcsBitArrayTweakable.html#fd7ee919a37d5bac355d5034dbe52605" title="Delete from the array count bits starting at pos, making the array shorter.">Delete</a>(<span class="keywordtype">size_t</span> pos, <span class="keywordtype">size_t</span> count)
<a name="l00586"></a>00586   {
<a name="l00587"></a>00587     <span class="keywordflow">if</span> (count &gt; 0)
<a name="l00588"></a>00588     {
<a name="l00589"></a>00589       <span class="keywordtype">size_t</span> dst = pos;
<a name="l00590"></a>00590       <span class="keywordtype">size_t</span> src = pos + count;
<a name="l00591"></a>00591       <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a>(src &lt;= mNumBits);
<a name="l00592"></a>00592       <span class="keywordtype">size_t</span> ntail = mNumBits - src;
<a name="l00593"></a>00593       <span class="keywordflow">while</span> (ntail-- &gt; 0)
<a name="l00594"></a>00594         <a class="code" href="classcsBitArrayTweakable.html#a50b928e221ee91e073ed651bf04e430" title="Set the bit at position pos to the given value.">Set</a>(dst++, <a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5" title="Returns true if the bit at position pos is true.">IsBitSet</a>(src++));
<a name="l00595"></a>00595       <a class="code" href="classcsBitArrayTweakable.html#f28fa356cfb8e93cdba60ad5b67788bd" title="Set the number of stored bits.">SetSize</a>(mNumBits - count);
<a name="l00596"></a>00596     }
<a name="l00597"></a>00597   }
<a name="l00598"></a>00598 
<a name="l00603"></a><a class="code" href="classcsBitArrayTweakable.html#8210ab6f828f2dd5bcd002c2ddeb8f86">00603</a>   <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> <a class="code" href="classcsBitArrayTweakable.html#8210ab6f828f2dd5bcd002c2ddeb8f86" title="Return a new bit array containing a slice count bits in length from this array starting...">Slice</a>(<span class="keywordtype">size_t</span> pos, <span class="keywordtype">size_t</span> count)<span class="keyword"> const</span>
<a name="l00604"></a>00604 <span class="keyword">  </span>{
<a name="l00605"></a>00605     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a>(pos + count &lt;= mNumBits);
<a name="l00606"></a>00606     <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a> a (count);
<a name="l00607"></a>00607     <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = pos, o = 0; i &lt; pos + count; i++)
<a name="l00608"></a>00608       <span class="keywordflow">if</span> (<a class="code" href="classcsBitArrayTweakable.html#19e077803aeb46a70b7fe038b7d596c5" title="Returns true if the bit at position pos is true.">IsBitSet</a>(i))
<a name="l00609"></a>00609         a.<a class="code" href="classcsBitArrayTweakable.html#6aeffd755ca99af6daab5d0b0d564fdc" title="Set the bit at position pos to true.">SetBit</a>(o++);
<a name="l00610"></a>00610     <span class="keywordflow">return</span> a;
<a name="l00611"></a>00611   }
<a name="l00612"></a>00612 
<a name="l00614"></a><a class="code" href="classcsBitArrayTweakable.html#4e89ab7e6e23497f446b796806557bc6">00614</a>   <a class="code" href="bitarray_8h.html#120ae28d188bbcd016668c0243d283a3" title="Storage type utilized by csBitArray to store the bits.">csBitArrayStorageType</a>* <a class="code" href="classcsBitArrayTweakable.html#4e89ab7e6e23497f446b796806557bc6" title="Return the full backing-store.">GetArrayBits</a>()
<a name="l00615"></a>00615   {
<a name="l00616"></a>00616     <span class="keywordflow">return</span> GetStore();
<a name="l00617"></a>00617   }
<a name="l00618"></a>00618 };
<a name="l00619"></a>00619 
<a name="l00624"></a><a class="code" href="classcsBitArray.html">00624</a> <span class="keyword">class </span><a class="code" href="classcsBitArray.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArray</a> : <span class="keyword">public</span> <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&lt;&gt;
<a name="l00625"></a>00625 {
<a name="l00626"></a>00626 <span class="keyword">public</span>:
<a name="l00628"></a><a class="code" href="classcsBitArray.html#f7b87d7012a20cd280fbcd259aedad65">00628</a>   <a class="code" href="classcsBitArray.html#f7b87d7012a20cd280fbcd259aedad65" title="Default constructor.">csBitArray</a> () { }
<a name="l00630"></a><a class="code" href="classcsBitArray.html#4de089702f550532a653f322ed334953">00630</a>   <span class="keyword">explicit</span> <a class="code" href="classcsBitArray.html#f7b87d7012a20cd280fbcd259aedad65" title="Default constructor.">csBitArray</a> (<span class="keywordtype">size_t</span> size) : <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&lt;&gt; (size) { }
<a name="l00632"></a><a class="code" href="classcsBitArray.html#73757c72c5c29412a6dd3b27e5c6f560">00632</a>   <a class="code" href="classcsBitArray.html#f7b87d7012a20cd280fbcd259aedad65" title="Default constructor.">csBitArray</a> (<span class="keyword">const</span> <a class="code" href="classcsBitArray.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArray</a>&amp; that) : <a class="code" href="classcsBitArrayTweakable.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArrayTweakable</a>&lt;&gt; (that) { }
<a name="l00633"></a>00633 };
<a name="l00634"></a>00634 
<a name="l00635"></a>00635 
<a name="l00640"></a>00640 <span class="keyword">template</span>&lt;&gt;
<a name="l00641"></a><a class="code" href="classcsComparator_3_01csBitArray_00_01csBitArray_01_4.html">00641</a> <span class="keyword">class </span><a class="code" href="classcsComparator.html" title="A template providing various comparison and ordering functions.">csComparator</a>&lt;<a class="code" href="classcsBitArray.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArray</a>, <a class="code" href="classcsBitArray.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArray</a>&gt; : 
<a name="l00642"></a>00642   <span class="keyword">public</span> <a class="code" href="classcsComparatorBitArray.html" title="Base comparator for bit arrays.">csComparatorBitArray</a>&lt;csBitArray&gt; { };
<a name="l00643"></a>00643 
<a name="l00644"></a>00644 
<a name="l00649"></a>00649 <span class="keyword">template</span>&lt;&gt;
<a name="l00650"></a><a class="code" href="classcsHashComputer_3_01csBitArray_01_4.html">00650</a> <span class="keyword">class </span><a class="code" href="classcsHashComputer.html" title="Template for hash value computing.">csHashComputer</a>&lt;<a class="code" href="classcsBitArray.html" title="A one-dimensional array of bits, similar to STL bitset.">csBitArray</a>&gt; : 
<a name="l00651"></a>00651   <span class="keyword">public</span> <a class="code" href="classcsHashComputerBitArray.html" title="Base hash computer for bit arrays.">csHashComputerBitArray</a>&lt;csBitArray&gt; { };
<a name="l00652"></a>00652 
<a name="l00653"></a>00653 
<a name="l00654"></a>00654 <span class="preprocessor">#endif // __CS_BITARRAY_H__</span>
</pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>