Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 29c369053a983cc5d8c880dc6e0a2237 > files > 32

libdtn-devel-2.6.0-2mdv2009.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>DTN Reference Implementation: AckList.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.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</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="tabs">
    <ul>
      <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>
<h1>AckList.h</h1><a href="AckList_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 2007 Baylor University</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> *    Licensed under the Apache License, Version 2.0 (the "License");</span>
<a name="l00005"></a>00005 <span class="comment"> *    you may not use this file except in compliance with the License.</span>
<a name="l00006"></a>00006 <span class="comment"> *    You may obtain a copy of the License at</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> *        http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> *    Unless required by applicable law or agreed to in writing, software</span>
<a name="l00011"></a>00011 <span class="comment"> *    distributed under the License is distributed on an "AS IS" BASIS,</span>
<a name="l00012"></a>00012 <span class="comment"> *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00013"></a>00013 <span class="comment"> *    See the License for the specific language governing permissions and</span>
<a name="l00014"></a>00014 <span class="comment"> *    limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef _PROPHET_ACK_LIST_H_</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _PROPHET_ACK_LIST_H_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;set&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="Ack_8h.html">Ack.h</a>"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="prophet_2Bundle_8h.html">Bundle.h</a>"</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="PointerList_8h.html">PointerList.h</a>"</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="keyword">namespace </span>prophet
<a name="l00026"></a>00026 {
<a name="l00027"></a>00027 
<a name="l00028"></a><a class="code" href="structprophet_1_1AckComp.html">00028</a> <span class="keyword">struct </span><a class="code" href="structprophet_1_1AckComp.html">AckComp</a> : <span class="keyword">public</span> std::less&lt;Ack*&gt;
<a name="l00029"></a>00029 {
<a name="l00030"></a><a class="code" href="structprophet_1_1AckComp.html#97ac9fe130da3c8703b02f4acad2383e">00030</a>     <span class="keywordtype">bool</span> <a class="code" href="structprophet_1_1AckComp.html#97ac9fe130da3c8703b02f4acad2383e">operator() </a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Ack.html" title="A Prophet ACK signals successful delivery of a Bundle to its final destination within...">Ack</a>* a, <span class="keyword">const</span> <a class="code" href="classprophet_1_1Ack.html" title="A Prophet ACK signals successful delivery of a Bundle to its final destination within...">Ack</a>* b)<span class="keyword"> const</span>
<a name="l00031"></a>00031 <span class="keyword">    </span>{
<a name="l00032"></a>00032         <span class="keywordflow">return</span> *a &lt; *b;
<a name="l00033"></a>00033     }
<a name="l00034"></a>00034 }; <span class="comment">// AckComp</span>
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">// forward declaration</span>
<a name="l00037"></a>00037 <span class="keyword">class </span>BundleCore;
<a name="l00038"></a>00038 
<a name="l00045"></a><a class="code" href="classprophet_1_1AckList.html">00045</a> <span class="keyword">class </span><a class="code" href="classprophet_1_1AckList.html" title="Section 3.5 (p.">AckList</a>
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keyword">public</span>:
<a name="l00051"></a><a class="code" href="classprophet_1_1AckList.html#8e5b2bef9f250a80376e4b3738751d6a">00051</a>     <a class="code" href="classprophet_1_1AckList.html#8e5b2bef9f250a80376e4b3738751d6a" title="Default constructor.">AckList</a>() {}
<a name="l00052"></a>00052 
<a name="l00056"></a><a class="code" href="classprophet_1_1AckList.html#611be1660b91ddbba380446ebf0b5a9c">00056</a>     <a class="code" href="classprophet_1_1AckList.html#8e5b2bef9f250a80376e4b3738751d6a" title="Default constructor.">AckList</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1AckList.html" title="Section 3.5 (p.">AckList</a>&amp; list)
<a name="l00057"></a>00057         : <a class="code" href="classprophet_1_1AckList.html#6180c0f2187b6c5fb36e44b2f2044b9f">acks_</a>(list.<a class="code" href="classprophet_1_1AckList.html#6180c0f2187b6c5fb36e44b2f2044b9f">acks_</a>) {}
<a name="l00058"></a>00058 
<a name="l00062"></a>00062     <a class="code" href="classprophet_1_1AckList.html#441ea7efa90a3f97a16dce26fc27e60b" title="Destructor.">~AckList</a>();
<a name="l00063"></a>00063 
<a name="l00071"></a>00071     <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1AckList.html#fa05576d340ed75b61a4652132410f05" title="Convenience method for inserting Ack into list; return true upon success, else false...">insert</a>(<span class="keyword">const</span> std::string&amp; dest_id, u_int32_t cts,
<a name="l00072"></a>00072                 u_int32_t seq = 0, u_int32_t ets = 0);
<a name="l00073"></a>00073 
<a name="l00078"></a>00078     <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1AckList.html#fa05576d340ed75b61a4652132410f05" title="Convenience method for inserting Ack into list; return true upon success, else false...">insert</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleCore.html" title="Prophet facade&amp;#39;s abstract interface into DTN host&amp;#39;s bundle core.">BundleCore</a>* core);
<a name="l00079"></a>00079 
<a name="l00083"></a>00083     <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1AckList.html#fa05576d340ed75b61a4652132410f05" title="Convenience method for inserting Ack into list; return true upon success, else false...">insert</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Ack.html" title="A Prophet ACK signals successful delivery of a Bundle to its final destination within...">Ack</a>* ack);
<a name="l00084"></a>00084 
<a name="l00089"></a>00089     <span class="keywordtype">size_t</span> <a class="code" href="classprophet_1_1AckList.html#0d8fe683b08216b60c55b03126cad1da" title="Export list of Acks to PointerList&amp;lt;Ack&amp;gt;, return number of elements exported...">clone</a>(<a class="code" href="classprophet_1_1PointerList.html" title="Auto deletes pointers in list destructor This object assumes ownership for member...">PointerList&lt;Ack&gt;</a>&amp; list) <span class="keyword">const</span>;
<a name="l00090"></a>00090 
<a name="l00096"></a>00096     <span class="keywordtype">size_t</span> <a class="code" href="classprophet_1_1AckList.html#616758f72d318b5514d26abb54984864" title="Given a destination ID, return the number of Acks that match (exact match only, no...">fetch</a>(<span class="keyword">const</span> std::string&amp; dest_id, <a class="code" href="classprophet_1_1PointerList.html" title="Auto deletes pointers in list destructor This object assumes ownership for member...">PointerList&lt;Ack&gt;</a>* list) <span class="keyword">const</span>;
<a name="l00097"></a>00097 
<a name="l00102"></a>00102     <span class="keywordtype">size_t</span> <a class="code" href="classprophet_1_1AckList.html#a14d15ee8e5335cf8f5ac8a030cd21ac" title="Visit every ACK in the list, and delete those for which the expiration has passed;...">expire</a>();
<a name="l00103"></a>00103 
<a name="l00107"></a><a class="code" href="classprophet_1_1AckList.html#c831edb32d593355793e848f9cdcbfbe">00107</a>     <span class="keywordtype">size_t</span> <a class="code" href="classprophet_1_1AckList.html#c831edb32d593355793e848f9cdcbfbe" title="Number of elements currently in list.">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1AckList.html#6180c0f2187b6c5fb36e44b2f2044b9f">acks_</a>.size(); }
<a name="l00108"></a>00108     
<a name="l00113"></a>00113     <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1AckList.html#217ee60142873856de9ffb877c95c3fb" title="Convenience function to answer the question of whether this Bundle has been Ack&amp;#39;d...">is_ackd</a>(<span class="keyword">const</span> std::string&amp; dest_id,
<a name="l00114"></a>00114                  u_int32_t cts, u_int32_t seq) <span class="keyword">const</span>;
<a name="l00115"></a>00115 
<a name="l00119"></a><a class="code" href="classprophet_1_1AckList.html#5da5cea0a9c6b9791c204d708b3c9944">00119</a>     <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1AckList.html#5da5cea0a9c6b9791c204d708b3c9944" title="Accessor.">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1AckList.html#6180c0f2187b6c5fb36e44b2f2044b9f">acks_</a>.empty(); }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 <span class="keyword">protected</span>:
<a name="l00122"></a><a class="code" href="classprophet_1_1AckList.html#0610bb57af56cf0d96a831f8e613f7b5">00122</a>     <span class="keyword">typedef</span> std::set&lt;Ack*,AckComp&gt; <a class="code" href="classprophet_1_1AckList.html#0610bb57af56cf0d96a831f8e613f7b5">palist</a>;
<a name="l00123"></a><a class="code" href="classprophet_1_1AckList.html#6180c0f2187b6c5fb36e44b2f2044b9f">00123</a>     <a class="code" href="classprophet_1_1AckList.html#0610bb57af56cf0d96a831f8e613f7b5">palist</a> <a class="code" href="classprophet_1_1AckList.html#6180c0f2187b6c5fb36e44b2f2044b9f">acks_</a>;
<a name="l00124"></a>00124 
<a name="l00125"></a>00125 }; <span class="comment">// AckList</span>
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 }; <span class="comment">// namespace prophet</span>
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 <span class="preprocessor">#endif // _PROPHET_ACK_LIST_H_</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:52 2009 for DTN Reference Implementation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>