Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 6cf965f950ffd2b12d0d99b7be60e5af > files > 30

libp2p0-devel-1.0-10mdv2008.1.i586.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>CP2PListLibrary: ip.hpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.4 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<h1>ip.hpp</h1><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) 2004-2005 Cory Nelson</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">   This software is provided 'as-is', without any express or implied</span>
<a name="l00005"></a>00005 <span class="comment">   warranty.  In no event will the authors be held liable for any damages</span>
<a name="l00006"></a>00006 <span class="comment">   arising from the use of this software.</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">   Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00009"></a>00009 <span class="comment">   including commercial applications, and to alter it and redistribute it</span>
<a name="l00010"></a>00010 <span class="comment">   freely, subject to the following restrictions:</span>
<a name="l00011"></a>00011 <span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment">   1. The origin of this software must not be misrepresented; you must not</span>
<a name="l00013"></a>00013 <span class="comment">      claim that you wrote the original software. If you use this software</span>
<a name="l00014"></a>00014 <span class="comment">      in a product, an acknowledgment in the product documentation would be</span>
<a name="l00015"></a>00015 <span class="comment">      appreciated but is not required.</span>
<a name="l00016"></a>00016 <span class="comment">   2. Altered source versions must be plainly marked as such, and must not be</span>
<a name="l00017"></a>00017 <span class="comment">      misrepresented as being the original software.</span>
<a name="l00018"></a>00018 <span class="comment">   3. This notice may not be removed or altered from any source distribution.</span>
<a name="l00019"></a>00019 <span class="comment">   </span>
<a name="l00020"></a>00020 <span class="comment">   CVS Info :</span>
<a name="l00021"></a>00021 <span class="comment">      $Author: phrostbyte $</span>
<a name="l00022"></a>00022 <span class="comment">      $Date: 2005/06/30 18:26:00 $</span>
<a name="l00023"></a>00023 <span class="comment">      $Revision: 1.5 $</span>
<a name="l00024"></a>00024 <span class="comment">*/</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef __P2P_IP_HPP__</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define __P2P_IP_HPP__</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;ostream&gt;</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="keyword">namespace </span>p2p {
<a name="l00032"></a>00032    <span class="keyword">struct </span>ip {
<a name="l00033"></a>00033       <span class="keyword">union </span>{
<a name="l00034"></a>00034          <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ipl;
<a name="l00035"></a>00035          <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ipb[4];
<a name="l00036"></a>00036       };
<a name="l00037"></a>00037 
<a name="l00038"></a>00038       ip() : ipl(0) {}
<a name="l00039"></a>00039       ip(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ip) : ipl(ip) {}
<a name="l00040"></a>00040       <span class="keywordtype">bool</span> operator&lt;(<span class="keyword">const</span> ip &amp;ip)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl&lt;ip.ipl; }
<a name="l00041"></a>00041       <span class="keywordtype">bool</span> operator&gt;(<span class="keyword">const</span> ip &amp;ip)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl&gt;ip.ipl; }
<a name="l00042"></a>00042       <span class="keywordtype">bool</span> operator&lt;=(<span class="keyword">const</span> ip &amp;ip)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl&lt;=ip.ipl; }
<a name="l00043"></a>00043       <span class="keywordtype">bool</span> operator&gt;=(<span class="keyword">const</span> ip &amp;ip)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl&gt;=ip.ipl; }
<a name="l00044"></a>00044       <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> ip &amp;ip)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl==ip.ipl; }
<a name="l00045"></a>00045       <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> ip &amp;ip)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl!=ip.ipl; }
<a name="l00046"></a>00046 
<a name="l00047"></a>00047       ip operator+(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl+i; }
<a name="l00048"></a>00048       ip operator-(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;ipl-i; }
<a name="l00049"></a>00049    };
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Nov 2 16:10:05 2007 for CP2PListLibrary by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>
</body>
</html>