Sophie

Sophie

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

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: BundleOffer.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>BundleOffer.h</h1><a href="BundleOffer_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_BUNDLE_OFFER_H_</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _PROPHET_BUNDLE_OFFER_H_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="prophet_2Bundle_8h.html">Bundle.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="prophet_2BundleList_8h.html">BundleList.h</a>"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="AckList_8h.html">AckList.h</a>"</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="BundleTLVEntryList_8h.html">BundleTLVEntryList.h</a>"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="FwdStrategy_8h.html">FwdStrategy.h</a>"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="Decider_8h.html">Decider.h</a>"</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;list&gt;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="keyword">namespace </span>prophet
<a name="l00030"></a>00030 {
<a name="l00031"></a>00031 
<a name="l00037"></a><a class="code" href="classprophet_1_1BundleOffer.html">00037</a> <span class="keyword">class </span><a class="code" href="classprophet_1_1BundleOffer.html" title="BundleOffer is the executor of forwarding strategy.">BundleOffer</a>
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <span class="keyword">public</span>:
<a name="l00044"></a>00044     <a class="code" href="classprophet_1_1BundleOffer.html#ec865e54158f06fcf7545ce9b376bc11" title="Constructor.">BundleOffer</a>(<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="l00045"></a>00045                 <span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleList.html" title="List of Prophet&amp;#39;s Bundle facade objects.">BundleList</a>&amp; bundles,
<a name="l00046"></a>00046                 <a class="code" href="classprophet_1_1FwdStrategyComp.html" title="Prophet forwarding strategy is laid out in Prophet I-D March 2006 Section 3.6, and...">FwdStrategyComp</a>* comp,
<a name="l00047"></a>00047                 Decider* decider);
<a name="l00048"></a>00048 
<a name="l00052"></a>00052     <a class="code" href="classprophet_1_1BundleOffer.html#944260608a980bccbf3d210acca6413b" title="Destructor.">~BundleOffer</a>();
<a name="l00053"></a>00053 
<a name="l00059"></a>00059     <span class="keywordtype">void</span> <a class="code" href="classprophet_1_1BundleOffer.html#6536e0dc107f053ee37836a7d76e941c" title="Add Bundle to offer.">add_bundle</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);
<a name="l00060"></a>00060  
<a name="l00064"></a><a class="code" href="classprophet_1_1BundleOffer.html#0bb141ba3b17fae38ad94fb8e4a553d2">00064</a>     <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleOffer.html#0bb141ba3b17fae38ad94fb8e4a553d2" title="Return whether Bundle offer is empty.">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleOffer.html#c01e865b8bbdf3282088da776d7dc3a8" title="bundles to offer to remote peer">list_</a>.empty(); }
<a name="l00065"></a>00065 
<a name="l00069"></a><a class="code" href="classprophet_1_1BundleOffer.html#3f17c5a8559fef5a9f5b7f5e44df9e88">00069</a>     <span class="keywordtype">size_t</span> <a class="code" href="classprophet_1_1BundleOffer.html#3f17c5a8559fef5a9f5b7f5e44df9e88" title="Return number of elements in Bundle offer.">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleOffer.html#c01e865b8bbdf3282088da776d7dc3a8" title="bundles to offer to remote peer">list_</a>.size(); }
<a name="l00070"></a>00070 
<a name="l00075"></a>00075     <span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleOfferList.html" title="In-memory representation of list of bundle offer entries from a Bundle TLV sent by...">BundleOfferList</a>&amp; <a class="code" href="classprophet_1_1BundleOffer.html#4f792eacaedfe588fc2f41e40ea94a6d" title="Convenience method to return const ref to sorted BundleOfferList.">get_bundle_offer</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Dictionary.html" title="Utility class to facilitate converting to and from routing string (endpoint ID) and...">Dictionary</a>&amp; ribd,
<a name="l00076"></a>00076                                             <span class="keyword">const</span> <a class="code" href="classprophet_1_1AckList.html" title="Section 3.5 (p.">AckList</a>* acks);
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="keyword">protected</span>:
<a name="l00079"></a><a class="code" href="classprophet_1_1BundleOffer.html#d085f30a3eaba9d4a34d6788d2664f4d">00079</a>     <span class="keyword">typedef</span> std::list&lt;const Bundle*&gt; <a class="code" href="classprophet_1_1BundleOffer.html#d085f30a3eaba9d4a34d6788d2664f4d">List</a>;
<a name="l00080"></a>00080 
<a name="l00081"></a><a class="code" href="classprophet_1_1BundleOffer.html#24ea30b5ecde77a759e815fa13187bfa">00081</a>     <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>* <span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleOffer.html#24ea30b5ecde77a759e815fa13187bfa" title="BundleCore instance.">core_</a>; 
<a name="l00082"></a><a class="code" href="classprophet_1_1BundleOffer.html#c01e865b8bbdf3282088da776d7dc3a8">00082</a>     <a class="code" href="classprophet_1_1BundleOffer.html#d085f30a3eaba9d4a34d6788d2664f4d">List</a> <a class="code" href="classprophet_1_1BundleOffer.html#c01e865b8bbdf3282088da776d7dc3a8" title="bundles to offer to remote peer">list_</a>; 
<a name="l00083"></a><a class="code" href="classprophet_1_1BundleOffer.html#f36f6fd96c33c4b45f1d77d082816bdb">00083</a>     <a class="code" href="classprophet_1_1BundleOfferList.html" title="In-memory representation of list of bundle offer entries from a Bundle TLV sent by...">BundleOfferList</a> <a class="code" href="classprophet_1_1BundleOffer.html#f36f6fd96c33c4b45f1d77d082816bdb" title="TLV-ready bundle offer list.">bolist_</a>; 
<a name="l00084"></a><a class="code" href="classprophet_1_1BundleOffer.html#b6d0dbd1615cc04aaf549b080b45b789">00084</a>     <a class="code" href="classprophet_1_1FwdStrategyComp.html" title="Prophet forwarding strategy is laid out in Prophet I-D March 2006 Section 3.6, and...">FwdStrategyComp</a>* <a class="code" href="classprophet_1_1BundleOffer.html#b6d0dbd1615cc04aaf549b080b45b789" title="comparator for ordering Bundle Offer TLV">comp_</a>; 
<a name="l00085"></a><a class="code" href="classprophet_1_1BundleOffer.html#1736498f020b1940670b4148323de61b">00085</a>     Decider* <a class="code" href="classprophet_1_1BundleOffer.html#1736498f020b1940670b4148323de61b" title="forwarding decision per Bundle">decider_</a>; 
<a name="l00086"></a>00086 }; <span class="comment">// class BundleOffer</span>
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 }; <span class="comment">// namespace prophet</span>
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 <span class="preprocessor">#endif // _PROPHET_BUNDLE_OFFER_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>