Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > ffa1e6f5ad04360808fe8840fe3ba036 > files > 274

vrq-devel-1.0.88-1.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>vrq: /net/fileserver/nas/home/mdh/vrq/src/cuint.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
   <tr>
    <td width="180"><a href="index.html"><img src="vrq.png" width="150" height="100" border="0" alt="vrq"></a></td>
    <td background="top_bg.png" align="right" width="100%">
      <img src="glyth.png" width="500" height="100" border="0" alt="">
    </td>
   </tr>
   <tr>
    <td background="#FFFFFF" align="right" width="50" height="4"></td>
   </tr>
  </table>
</head><body>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>/net/fileserver/nas/home/mdh/vrq/src/cuint.h</h1>  </div>
</div>
<div class="contents">
<a href="cuint_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) 1997-2007, Mark Hummel</span>
<a name="l00003"></a>00003 <span class="comment"> * This file is part of Vrq.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Vrq is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public</span>
<a name="l00007"></a>00007 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> * version 2 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Vrq is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00013"></a>00013 <span class="comment"> * General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public</span>
<a name="l00016"></a>00016 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, </span>
<a name="l00018"></a>00018 <span class="comment"> * Boston, MA  02110-1301  USA</span>
<a name="l00019"></a>00019 <span class="comment"> *****************************************************************************</span>
<a name="l00020"></a>00020 <span class="comment"> */</span>
<a name="l00021"></a>00021 <span class="comment">/*******************************************************************</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> *      cuint.hpp       </span>
<a name="l00024"></a>00024 <span class="comment"> *              - header file for cuint.hpp </span>
<a name="l00025"></a>00025 <span class="comment"> *                </span>
<a name="l00026"></a>00026 <span class="comment"> *</span>
<a name="l00027"></a>00027 <span class="comment"> *******************************************************************</span>
<a name="l00028"></a>00028 <span class="comment"> */</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef CUINT_HPP</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define CUINT_HPP</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="glue_8h.html">glue.h</a>&quot;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &quot;<a class="code" href="cobstack_8h.html">cobstack.h</a>&quot;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="preprocessor">#ifndef MAX</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define MAX(a,b)        ((a)&lt;(b)?(b):(a))</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#endif // MAX</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span>
<a name="l00044"></a>00044 <span class="preprocessor">#define CUINT_DEFAULT_SIZE      (4)     // size in 32 bit words</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span>
<a name="l00050"></a><a class="code" href="classCUInt.html">00050</a> <span class="keyword">class   </span><a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> {
<a name="l00051"></a>00051 <span class="keyword">private</span>:
<a name="l00052"></a>00052     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>        defaultData[CUINT_DEFAULT_SIZE];
<a name="l00053"></a>00053     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>        *data;                          
<a name="l00054"></a>00054     <span class="keywordtype">int</span>         allocatedSize;                  
<a name="l00055"></a>00055     <span class="keywordtype">int</span>         size;                           
<a name="l00056"></a>00056     <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>*   heap;                           
<a name="l00057"></a>00057 <span class="keyword">public</span>:
<a name="l00058"></a>00058 
<a name="l00062"></a><a class="code" href="classCUInt.html#a7a8631eae7b1fa121fdd117edf9fa5d8">00062</a>     <a class="code" href="classCUInt.html#a7a8631eae7b1fa121fdd117edf9fa5d8" title="Create a unsigned integer object.">CUInt</a>( <span class="keywordtype">void</span> ) 
<a name="l00063"></a>00063     {
<a name="l00064"></a>00064         heap = NULL;
<a name="l00065"></a>00065         allocatedSize = CUINT_DEFAULT_SIZE;
<a name="l00066"></a>00066         data = defaultData;
<a name="l00067"></a>00067         size = 1;
<a name="l00068"></a>00068         data[0] = 0;
<a name="l00069"></a>00069     };          
<a name="l00070"></a>00070     
<a name="l00075"></a><a class="code" href="classCUInt.html#a13663279f0ae7ce3e9e94a56c5e51bcb">00075</a>     <a class="code" href="classCUInt.html#a7a8631eae7b1fa121fdd117edf9fa5d8" title="Create a unsigned integer object.">CUInt</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> aValue ) 
<a name="l00076"></a>00076     {
<a name="l00077"></a>00077         heap = NULL;
<a name="l00078"></a>00078         allocatedSize = CUINT_DEFAULT_SIZE;
<a name="l00079"></a>00079         data = defaultData;
<a name="l00080"></a>00080         size = 1;
<a name="l00081"></a>00081         data[0] = aValue;
<a name="l00082"></a>00082     };          
<a name="l00083"></a>00083     
<a name="l00084"></a>00084     
<a name="l00089"></a><a class="code" href="classCUInt.html#afb9102643ccf84d819b8dd0cd8a767af">00089</a>     <a class="code" href="classCUInt.html#a7a8631eae7b1fa121fdd117edf9fa5d8" title="Create a unsigned integer object.">CUInt</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp;aValue ) 
<a name="l00090"></a>00090     {
<a name="l00091"></a>00091         <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a>   i;
<a name="l00092"></a>00092         
<a name="l00093"></a>00093         heap = NULL;
<a name="l00094"></a>00094         allocatedSize = CUINT_DEFAULT_SIZE;
<a name="l00095"></a>00095         data = defaultData;
<a name="l00096"></a>00096         size = 1;
<a name="l00097"></a>00097         grow( aValue.size );
<a name="l00098"></a>00098         <span class="keywordflow">for</span>( i = 0; i &lt; size; i++ ) {
<a name="l00099"></a>00099                 data[i] = aValue.data[i];
<a name="l00100"></a>00100         }
<a name="l00101"></a>00101     };          
<a name="l00102"></a>00102     
<a name="l00106"></a><a class="code" href="classCUInt.html#a3efc757c352a0d27d7365f770adc62a7">00106</a>     <span class="keyword">virtual</span> <a class="code" href="classCUInt.html#a3efc757c352a0d27d7365f770adc62a7" title="Destory object and free any storage.">~CUInt</a>()    
<a name="l00107"></a>00107     {
<a name="l00108"></a>00108         <span class="keywordflow">if</span>( heap == NULL &amp;&amp; data != defaultData ) {
<a name="l00109"></a>00109                 <a class="code" href="main_8cc.html#a75b14974d5279e0e072d3b157dc996a4">shell_xfree</a>( data, size );
<a name="l00110"></a>00110                 data = NULL;
<a name="l00111"></a>00111         }
<a name="l00112"></a>00112     } ;
<a name="l00113"></a>00113     
<a name="l00114"></a>00114     
<a name="l00119"></a><a class="code" href="classCUInt.html#ab083c4b8adab570a54e9930289435212">00119</a>     <span class="keywordtype">void</span> <a class="code" href="classCUInt.html#ab083c4b8adab570a54e9930289435212" title="Set heap to be used for storage allocation.">SetHeap</a>( <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* aHeap )
<a name="l00120"></a>00120     {
<a name="l00121"></a>00121         heap = aHeap;
<a name="l00122"></a>00122     }
<a name="l00123"></a>00123     
<a name="l00126"></a><a class="code" href="classCUInt.html#a0136237fb93e7947d11e744469d45cb1">00126</a>     <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp;<a class="code" href="classCUInt.html#a0136237fb93e7947d11e744469d45cb1">operator=</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp;aValue )        
<a name="l00127"></a>00127     {
<a name="l00128"></a>00128         <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a>   i;
<a name="l00129"></a>00129         
<a name="l00130"></a>00130         grow( aValue.size );
<a name="l00131"></a>00131         <span class="keywordflow">for</span>( i = 0; i &lt; size; i++ ) {
<a name="l00132"></a>00132                 data[i] = aValue.data[i];
<a name="l00133"></a>00133         }
<a name="l00134"></a>00134         <span class="keywordflow">return</span>( aValue );
<a name="l00135"></a>00135     };
<a name="l00136"></a>00136     
<a name="l00137"></a><a class="code" href="classCUInt.html#a3f419334b6dfb9433b9252a521e06ac6">00137</a>     <span class="keyword">const</span> <a class="code" href="glue_8h.html#a57be03562867144161c1bfee95ca8f7c" title="Short cut for unsigned 64 bit integer.">UINT64</a> <a class="code" href="classCUInt.html#a0136237fb93e7947d11e744469d45cb1">operator=</a>( <span class="keyword">const</span> <a class="code" href="glue_8h.html#a57be03562867144161c1bfee95ca8f7c" title="Short cut for unsigned 64 bit integer.">UINT64</a> aValue )        
<a name="l00138"></a>00138     {
<a name="l00139"></a>00139         <span class="keywordflow">if</span>( aValue&gt;&gt;32 != 0 ) {
<a name="l00140"></a>00140                 grow( 2 );
<a name="l00141"></a>00141                 data[0] = aValue;
<a name="l00142"></a>00142                 data[1] = aValue&gt;&gt;32;
<a name="l00143"></a>00143         } <span class="keywordflow">else</span> {
<a name="l00144"></a>00144                 grow( 1 );
<a name="l00145"></a>00145                 data[0] = aValue;
<a name="l00146"></a>00146         }
<a name="l00147"></a>00147         <span class="keywordflow">return</span>( aValue );
<a name="l00148"></a>00148     };
<a name="l00150"></a>00150     
<a name="l00157"></a><a class="code" href="classCUInt.html#af50c3bc8358f8d5c415357e91f6a8024">00157</a>     <span class="keywordtype">void</span>        <a class="code" href="classCUInt.html#af50c3bc8358f8d5c415357e91f6a8024" title="Change size of unsigned integer.">Truncate</a>( <span class="keywordtype">int</span> newSize )
<a name="l00158"></a>00158     {
<a name="l00159"></a>00159         grow( newSize );
<a name="l00160"></a>00160     };
<a name="l00161"></a>00161 
<a name="l00164"></a>00164     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a2511ded1ce6f4b60f4cf84afecc54e82">operator~</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span>;
<a name="l00166"></a>00166     
<a name="l00169"></a>00169     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a94338e783eb9d62a0e84fc4229508d64">operator+</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00170"></a>00170     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a94338e783eb9d62a0e84fc4229508d64">operator+</a>( <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00171"></a>00171     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a88c233a314436d678de301fe800b8462">operator-</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00172"></a>00172     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a88c233a314436d678de301fe800b8462">operator-</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00173"></a>00173     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#ae90a94dc82b2991dd679f98ecb731d49">operator*</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00174"></a>00174     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#ae90a94dc82b2991dd679f98ecb731d49">operator*</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00175"></a>00175     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a519d7b237bb3df055471c5152ad9f154">operator/</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00176"></a>00176     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a519d7b237bb3df055471c5152ad9f154">operator/</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00177"></a>00177     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#aa0f01a3ed16a3d7a9021a00cd442e6a9">operator%</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00178"></a>00178     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#aa0f01a3ed16a3d7a9021a00cd442e6a9">operator%</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00179"></a>00179     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#ac0a17eaabfbb10eda193b098e0e43943">operator&gt;&gt;</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00180"></a>00180     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#ac0a17eaabfbb10eda193b098e0e43943">operator&gt;&gt;</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00181"></a>00181     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a1871fbf0bca5ececd1b86e9c08eb4706">operator&lt;&lt;</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00182"></a>00182     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a1871fbf0bca5ececd1b86e9c08eb4706">operator&lt;&lt;</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00183"></a>00183     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a4c6741983063429d7eeed622bf534c6f">operator&amp;</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00184"></a>00184     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a4c6741983063429d7eeed622bf534c6f">operator&amp;</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00185"></a>00185     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a92a42d41e0a9a7f6fd774cafd5d74a53">operator|</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00186"></a>00186     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#a92a42d41e0a9a7f6fd774cafd5d74a53">operator|</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00187"></a>00187     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#ae15a12954cda5a8a84ae61654cd52243">operator^</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00188"></a>00188     <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> <a class="code" href="classCUInt.html#ae15a12954cda5a8a84ae61654cd52243">operator^</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00190"></a>00190     
<a name="l00193"></a>00193     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#ae62d9e4e32dd44973abea909e5d633c2">operator&lt;</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00194"></a>00194     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#ae62d9e4e32dd44973abea909e5d633c2">operator&lt;</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00195"></a>00195     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#a336be0767fbd6f44ef5ee63f747b0289">operator&lt;=</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00196"></a>00196     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#a336be0767fbd6f44ef5ee63f747b0289">operator&lt;=</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00197"></a>00197     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#af49e8889f29f5a358325648c601bf21b">operator&gt;</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00198"></a>00198     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#af49e8889f29f5a358325648c601bf21b">operator&gt;</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00199"></a>00199     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#a6c04327c7333dccdb0dd0c0efc3fa38b">operator&gt;=</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00200"></a>00200     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#a6c04327c7333dccdb0dd0c0efc3fa38b">operator&gt;=</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00201"></a>00201     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#a0442cc982017e5526ca5bad62f4563c1">operator==</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00202"></a>00202     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#a0442cc982017e5526ca5bad62f4563c1">operator==</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00203"></a>00203     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#ae936edcd74c92d6a7af6c531f31a889e">operator!=</a>( <span class="keyword">const</span> <a class="code" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a> &amp; ) <span class="keyword">const</span>;
<a name="l00204"></a>00204     <span class="keywordtype">int</span> <a class="code" href="classCUInt.html#ae936edcd74c92d6a7af6c531f31a889e">operator!=</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ) <span class="keyword">const</span>;
<a name="l00206"></a>00206     
<a name="l00209"></a>00209     <a class="code" href="glue_8h.html#a0b39d6d754cb24c708b0f2bdbe88130e" title="Short cut for unsigned 32 bit integer.">UINT32</a> <a class="code" href="classCUInt.html#ad95d4c9243babb4991f864ef26890906">GetUINT32</a>() <span class="keyword">const</span>; 
<a name="l00210"></a>00210     <a class="code" href="glue_8h.html#a57be03562867144161c1bfee95ca8f7c" title="Short cut for unsigned 64 bit integer.">UINT64</a> <a class="code" href="classCUInt.html#ad512e0339d84716cf16f5f128b168adb">GetUINT64</a>() <span class="keyword">const</span>;
<a name="l00212"></a>00212     
<a name="l00217"></a>00217     <a class="code" href="glue_8h.html#a0b39d6d754cb24c708b0f2bdbe88130e" title="Short cut for unsigned 32 bit integer.">UINT32</a> <a class="code" href="classCUInt.html#a2a3b2253cffde274486f944a6f455115" title="Calculate the number of non-zero significant bits.">Size</a>();
<a name="l00218"></a>00218     
<a name="l00222"></a>00222 <span class="keyword">private</span>:
<a name="l00223"></a>00223     <span class="keywordtype">void</span> calibrate( <span class="keywordtype">void</span> )
<a name="l00224"></a>00224     {
<a name="l00225"></a>00225         <span class="keywordtype">int</span>     i;
<a name="l00226"></a>00226         <span class="keywordflow">for</span>( i=size-1; i&gt;0; i-- ) {
<a name="l00227"></a>00227             <span class="keywordflow">if</span>( data[i] != 0 ) {
<a name="l00228"></a>00228                 <span class="keywordflow">break</span>;
<a name="l00229"></a>00229             }
<a name="l00230"></a>00230         }       
<a name="l00231"></a>00231         size = i+1;
<a name="l00232"></a>00232         <span class="keywordflow">return</span>;
<a name="l00233"></a>00233     };
<a name="l00234"></a>00234     <span class="keywordtype">void</span> grow( <span class="keywordtype">int</span> aSize )
<a name="l00235"></a>00235     {
<a name="l00236"></a>00236         <span class="keywordtype">int</span> i;
<a name="l00237"></a>00237     
<a name="l00238"></a>00238         <span class="keywordflow">if</span>( aSize &lt;= size ) {
<a name="l00239"></a>00239             size = aSize;
<a name="l00240"></a>00240             <span class="keywordflow">return</span>;
<a name="l00241"></a>00241         }
<a name="l00242"></a>00242         <span class="keywordflow">if</span>( allocatedSize &lt; aSize ) {
<a name="l00243"></a>00243             <span class="keywordflow">if</span>( heap == NULL ) {
<a name="l00244"></a>00244                 <span class="keywordflow">if</span>( data != defaultData ) {
<a name="l00245"></a>00245                     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>* newData;
<a name="l00246"></a>00246                     newData = (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>*)<a class="code" href="main_8cc.html#acec925771872e73156971d2a58a67a3f">shell_xmalloc</a>( aSize*4);
<a name="l00247"></a>00247                     memcpy( newData, data, size*4 );
<a name="l00248"></a>00248                     <a class="code" href="main_8cc.html#a75b14974d5279e0e072d3b157dc996a4">shell_xfree</a>( data, allocatedSize*4 );
<a name="l00249"></a>00249                     data = newData;
<a name="l00250"></a>00250                 } <span class="keywordflow">else</span> {
<a name="l00251"></a>00251                     data = (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>*)<a class="code" href="main_8cc.html#acec925771872e73156971d2a58a67a3f">shell_xmalloc</a>( aSize*4 );
<a name="l00252"></a>00252                     memcpy( data, defaultData, size*4 );
<a name="l00253"></a>00253                 }
<a name="l00254"></a>00254             } <span class="keywordflow">else</span> {
<a name="l00255"></a>00255                 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>*   newData;
<a name="l00256"></a>00256                 newData = (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>*)heap-&gt;<a class="code" href="classCObstack.html#a5a34d5a2800a901ed15366c11bf269ef" title="Allocate block of storage with given size.">Alloc</a>( aSize*4 );
<a name="l00257"></a>00257                 memcpy( newData, data, size*4 );
<a name="l00258"></a>00258                 data = newData;
<a name="l00259"></a>00259             }
<a name="l00260"></a>00260             allocatedSize = aSize;
<a name="l00261"></a>00261         }
<a name="l00262"></a>00262         <span class="keywordflow">for</span>( i=size; i &lt; aSize; i++ ) {
<a name="l00263"></a>00263             data[i] = 0;
<a name="l00264"></a>00264         }
<a name="l00265"></a>00265         size = aSize;
<a name="l00266"></a>00266     };  
<a name="l00270"></a>00270 };
<a name="l00271"></a>00271 
<a name="l00272"></a>00272 
<a name="l00273"></a>00273 
<a name="l00274"></a>00274 
<a name="l00275"></a>00275 <span class="preprocessor">#endif // CUINT_HPP</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>