<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>ucommon: ucommon/bitmap.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <h1>ucommon/bitmap.h</h1><a href="a00179.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2006-2010 David Sugar, Tycho Softworks.</span> <a name="l00002"></a>00002 <span class="comment">//</span> <a name="l00003"></a>00003 <span class="comment">// This file is part of GNU uCommon C++.</span> <a name="l00004"></a>00004 <span class="comment">//</span> <a name="l00005"></a>00005 <span class="comment">// GNU uCommon C++ is free software: you can redistribute it and/or modify</span> <a name="l00006"></a>00006 <span class="comment">// it under the terms of the GNU Lesser General Public License as published</span> <a name="l00007"></a>00007 <span class="comment">// by the Free Software Foundation, either version 3 of the License, or</span> <a name="l00008"></a>00008 <span class="comment">// (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment">//</span> <a name="l00010"></a>00010 <span class="comment">// GNU uCommon C++ 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</span> <a name="l00013"></a>00013 <span class="comment">// GNU Lesser 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 Lesser General Public License</span> <a name="l00016"></a>00016 <span class="comment">// along with GNU uCommon C++. If not, see <http://www.gnu.org/licenses/>.</span> <a name="l00017"></a>00017 <a name="l00026"></a>00026 <span class="preprocessor">#ifndef _UCOMMON_BITMAP_H_</span> <a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define _UCOMMON_BITMAP_H_</span> <a name="l00028"></a>00028 <span class="preprocessor"></span> <a name="l00029"></a>00029 <span class="preprocessor">#ifndef _UCOMMON_CONFIG_H_</span> <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#include <<a class="code" href="a00194.html" title="Various miscellaneous platform specific headers and defines.">ucommon/platform.h</a>></span> <a name="l00031"></a>00031 <span class="preprocessor">#endif</span> <a name="l00032"></a>00032 <span class="preprocessor"></span> <a name="l00033"></a>00033 NAMESPACE_UCOMMON <a name="l00034"></a>00034 <a name="l00051"></a><a class="code" href="a00025.html">00051</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00025.html" title="A class to access bit fields in external bitmaps.">bitmap</a> <a name="l00052"></a>00052 { <a name="l00053"></a>00053 <span class="keyword">protected</span>: <a name="l00054"></a>00054 <span class="keywordtype">size_t</span> size; <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keyword">typedef</span> <span class="keyword">union</span> <a name="l00057"></a>00057 { <a name="l00058"></a>00058 <span class="keywordtype">void</span> *a; <a name="l00059"></a>00059 uint8_t *b; <a name="l00060"></a>00060 uint16_t *w; <a name="l00061"></a>00061 uint32_t *l; <a name="l00062"></a>00062 uint64_t *d; <a name="l00063"></a>00063 } addr_t; <a name="l00064"></a>00064 <a name="l00065"></a>00065 addr_t <a class="code" href="a00208.html#a460b5a6386de45c6263462b541a9c357" title="A convenience function to convert a socket address list into a socket address.">addr</a>; <a name="l00066"></a>00066 <a name="l00067"></a>00067 <span class="keyword">public</span>: <a name="l00071"></a><a class="code" href="a00025.html#a9a3baa2ca27008d3cfd82867452d56c8">00071</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00072"></a><a class="code" href="a00025.html#a9a3baa2ca27008d3cfd82867452d56c8ade83ef019bcf5949716339712fc7d67d">00072</a> BMALLOC, <a name="l00073"></a><a class="code" href="a00025.html#a9a3baa2ca27008d3cfd82867452d56c8a12f02531b40ba91ffba04cb836a94dcb">00073</a> B8, <a name="l00074"></a><a class="code" href="a00025.html#a9a3baa2ca27008d3cfd82867452d56c8a4cfbda02d1f055881630c1c059878533">00074</a> B16, <a name="l00075"></a><a class="code" href="a00025.html#a9a3baa2ca27008d3cfd82867452d56c8a4f9bbf2ce46b0fdf6ebe4ad8dde64dc1">00075</a> B32, <a name="l00076"></a><a class="code" href="a00025.html#a9a3baa2ca27008d3cfd82867452d56c8a0dbf2e396ca56d6961826c92ffb82a35">00076</a> B64, <a name="l00077"></a>00077 BMIN = BMALLOC, <a name="l00078"></a>00078 BMAX = B64 <a name="l00079"></a>00079 } bus_t; <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="keyword">protected</span>: <a name="l00082"></a>00082 bus_t bus; <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="keywordtype">unsigned</span> memsize(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="keyword">public</span>: <a name="l00093"></a>00093 <a class="code" href="a00025.html" title="A class to access bit fields in external bitmaps.">bitmap</a>(<span class="keywordtype">void</span> *<a class="code" href="a00208.html#a460b5a6386de45c6263462b541a9c357" title="A convenience function to convert a socket address list into a socket address.">addr</a>, <span class="keywordtype">size_t</span> length, bus_t size = B8); <a name="l00094"></a>00094 <a name="l00100"></a>00100 <a class="code" href="a00025.html" title="A class to access bit fields in external bitmaps.">bitmap</a>(<span class="keywordtype">size_t</span> length); <a name="l00101"></a>00101 <a name="l00107"></a>00107 ~<a class="code" href="a00025.html" title="A class to access bit fields in external bitmaps.">bitmap</a>(); <a name="l00108"></a>00108 <a name="l00112"></a>00112 <span class="keywordtype">void</span> clear(<span class="keywordtype">void</span>); <a name="l00113"></a>00113 <a name="l00119"></a>00119 <span class="keywordtype">bool</span> <span class="keyword">get</span>(<span class="keywordtype">size_t</span> offset) <span class="keyword">const</span>; <a name="l00120"></a>00120 <a name="l00126"></a>00126 <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">size_t</span> offset, <span class="keywordtype">bool</span> value); <a name="l00127"></a>00127 }; <a name="l00128"></a>00128 <a name="l00129"></a>00129 END_NAMESPACE <a name="l00130"></a>00130 <a name="l00131"></a>00131 <span class="preprocessor">#endif</span> </pre></div></div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 16:38:56 2011 for ucommon by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>