Sophie

Sophie

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

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: ProphetBundle.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>ProphetBundle.h</h1><a href="ProphetBundle_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_H_</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _PROPHET_BUNDLE_H_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="bundling_2Bundle_8h.html">bundling/Bundle.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="prophet_2Bundle_8h.html">prophet/Bundle.h</a>"</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="keyword">namespace </span>dtn
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 
<a name="l00030"></a><a class="code" href="classdtn_1_1ProphetBundle.html">00030</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1ProphetBundle.html" title="Unification class that ties together Prophet&amp;#39;s metadata view with DTN&amp;#39;s complete...">ProphetBundle</a> : <span class="keyword">public</span> prophet::<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 <span class="keyword">public</span>:
<a name="l00036"></a><a class="code" href="classdtn_1_1ProphetBundle.html#d89cf4c5a6d2a587d5e4ca750581edf2">00036</a>     <a class="code" href="classdtn_1_1ProphetBundle.html#d89cf4c5a6d2a587d5e4ca750581edf2" title="Constructor.">ProphetBundle</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>&amp; bundle)
<a name="l00037"></a>00037         : <a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a>(<span class="stringliteral">"ProphetBundle"</span>), <a class="code" href="classdtn_1_1ProphetBundle.html#911f36e94db03b6dba58fe6e5deb6687" title="return value for NULL condition">str_</a>(<span class="stringliteral">""</span>)
<a name="l00038"></a>00038     {
<a name="l00039"></a>00039         <a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> = bundle.object();
<a name="l00040"></a>00040     }
<a name="l00041"></a>00041 
<a name="l00045"></a><a class="code" href="classdtn_1_1ProphetBundle.html#643d2e7642fc150f527c5990ab13837b">00045</a>     <a class="code" href="classdtn_1_1ProphetBundle.html#d89cf4c5a6d2a587d5e4ca750581edf2" title="Constructor.">ProphetBundle</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1ProphetBundle.html" title="Unification class that ties together Prophet&amp;#39;s metadata view with DTN&amp;#39;s complete...">ProphetBundle</a>&amp; other)
<a name="l00046"></a>00046         : prophet::<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>(other), <a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a>(other.<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a>) {}
<a name="l00047"></a>00047 
<a name="l00051"></a><a class="code" href="classdtn_1_1ProphetBundle.html#ab53b0aedd3670bb25de134e63c4c5c4">00051</a>     <span class="keyword">virtual</span> <a class="code" href="classdtn_1_1ProphetBundle.html#ab53b0aedd3670bb25de134e63c4c5c4" title="Destructor.">~ProphetBundle</a>()
<a name="l00052"></a>00052     {
<a name="l00053"></a>00053         <a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> = NULL;
<a name="l00054"></a>00054     }
<a name="l00055"></a>00055 
<a name="l00059"></a><a class="code" href="classdtn_1_1ProphetBundle.html#77d01eb7665bc99f4ede7367ad0fce47">00059</a>     <a class="code" href="classdtn_1_1ProphetBundle.html" title="Unification class that ties together Prophet&amp;#39;s metadata view with DTN&amp;#39;s complete...">ProphetBundle</a>&amp; <a class="code" href="classdtn_1_1ProphetBundle.html#77d01eb7665bc99f4ede7367ad0fce47" title="Assignment operator.">operator= </a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1ProphetBundle.html" title="Unification class that ties together Prophet&amp;#39;s metadata view with DTN&amp;#39;s complete...">ProphetBundle</a>&amp; other)
<a name="l00060"></a>00060     {
<a name="l00061"></a>00061         <a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> = other.<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a>;
<a name="l00062"></a>00062         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00063"></a>00063     }
<a name="l00064"></a>00064 
<a name="l00068"></a><a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae">00068</a>     <span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>&amp; <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a>; }
<a name="l00069"></a>00069 
<a name="l00071"></a><a class="code" href="classdtn_1_1ProphetBundle.html#f3e22af0478486330a7201758e353fb0">00071</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classdtn_1_1ProphetBundle.html#f3e22af0478486330a7201758e353fb0" title="Virtual from prophet::Bundle.">destination_id</a>()<span class="keyword"> const</span>
<a name="l00072"></a>00072 <span class="keyword">    </span>{
<a name="l00073"></a>00073         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? <a class="code" href="classdtn_1_1ProphetBundle.html#911f36e94db03b6dba58fe6e5deb6687" title="return value for NULL condition">str_</a> : <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;dest().str();
<a name="l00074"></a>00074     }
<a name="l00075"></a><a class="code" href="classdtn_1_1ProphetBundle.html#81ae6c059ef62cb7971ae28266c83fec">00075</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classdtn_1_1ProphetBundle.html#81ae6c059ef62cb7971ae28266c83fec" title="Virtual from prophet::Bundle.">source_id</a>()<span class="keyword"> const</span>
<a name="l00076"></a>00076 <span class="keyword">    </span>{
<a name="l00077"></a>00077         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? <a class="code" href="classdtn_1_1ProphetBundle.html#911f36e94db03b6dba58fe6e5deb6687" title="return value for NULL condition">str_</a> : <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;source().str();
<a name="l00078"></a>00078     }
<a name="l00079"></a><a class="code" href="classdtn_1_1ProphetBundle.html#49f316082826c2a32b005dd6d644bf76">00079</a>     <span class="keyword">virtual</span> u_int32_t <a class="code" href="classdtn_1_1ProphetBundle.html#49f316082826c2a32b005dd6d644bf76" title="Virtual from prophet::Bundle.">creation_ts</a>()<span class="keyword"> const</span>
<a name="l00080"></a>00080 <span class="keyword">    </span>{
<a name="l00081"></a>00081         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? 0 : <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;creation_ts().seconds_;
<a name="l00082"></a>00082     }
<a name="l00083"></a><a class="code" href="classdtn_1_1ProphetBundle.html#e7d9711468adadb9cd3d7aeee007be65">00083</a>     <span class="keyword">virtual</span> u_int32_t <a class="code" href="classdtn_1_1ProphetBundle.html#e7d9711468adadb9cd3d7aeee007be65" title="Virtual from prophet::Bundle.">sequence_num</a>()<span class="keyword"> const</span>
<a name="l00084"></a>00084 <span class="keyword">    </span>{
<a name="l00085"></a>00085         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? 0 : <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;creation_ts().seqno_;
<a name="l00086"></a>00086     }
<a name="l00087"></a><a class="code" href="classdtn_1_1ProphetBundle.html#7fc0d17e182356fce3f9e0858f7ba5d1">00087</a>     <span class="keyword">virtual</span> u_int32_t <a class="code" href="classdtn_1_1ProphetBundle.html#7fc0d17e182356fce3f9e0858f7ba5d1" title="Virtual from prophet::Bundle.">expiration_ts</a>()<span class="keyword"> const</span>
<a name="l00088"></a>00088 <span class="keyword">    </span>{
<a name="l00089"></a>00089         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? 0 : <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;expiration();
<a name="l00090"></a>00090     }
<a name="l00091"></a><a class="code" href="classdtn_1_1ProphetBundle.html#800ba0cf41ddaf2fe22179e08d36ca02">00091</a>     <span class="keyword">virtual</span> u_int <a class="code" href="classdtn_1_1ProphetBundle.html#800ba0cf41ddaf2fe22179e08d36ca02" title="Virtual from prophet::Bundle.">size</a>()<span class="keyword"> const</span>
<a name="l00092"></a>00092 <span class="keyword">    </span>{
<a name="l00093"></a>00093         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? 0 : <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;payload().length();
<a name="l00094"></a>00094     }
<a name="l00095"></a><a class="code" href="classdtn_1_1ProphetBundle.html#cd221582adedee367c191b4f8d834e1d">00095</a>     <span class="keyword">virtual</span> u_int <a class="code" href="classdtn_1_1ProphetBundle.html#cd221582adedee367c191b4f8d834e1d" title="Virtual from prophet::Bundle.">num_forward</a>()<span class="keyword"> const</span>
<a name="l00096"></a>00096 <span class="keyword">    </span>{
<a name="l00097"></a>00097         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? 0 :
<a name="l00098"></a>00098             <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;fwdlog()-&gt;get_count(<a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad4222cd2abd08c71c5b5387cf23ca6193" title="Successfully transmitted.">ForwardingInfo::TRANSMITTED</a>,
<a name="l00099"></a>00099                 <a class="code" href="classdtn_1_1ForwardingInfo.html#18ec95dc1b1b8a7e9df9873a0d9b594777ba7ba2355d6b87536afc9ef78efeb8" title="Forward a copy of the bundle.">ForwardingInfo::COPY_ACTION</a>);
<a name="l00100"></a>00100     }
<a name="l00101"></a><a class="code" href="classdtn_1_1ProphetBundle.html#d7cce914da83b8f1c872f2d913be84ce">00101</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1ProphetBundle.html#d7cce914da83b8f1c872f2d913be84ce" title="Virtual from prophet::Bundle.">custody_requested</a>()<span class="keyword"> const</span>
<a name="l00102"></a>00102 <span class="keyword">    </span>{
<a name="l00103"></a>00103         <span class="keywordflow">return</span> (<a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a> == NULL) ? <span class="keyword">false</span> : <a class="code" href="classdtn_1_1ProphetBundle.html#5b0b031fc3d221266a6bd202eeb0e2ae" title="Return const ref to BundleRef member.">ref</a>()-&gt;custody_requested();
<a name="l00104"></a>00104     }
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 <span class="keyword">protected</span>:
<a name="l00108"></a>00108 
<a name="l00109"></a><a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c">00109</a>     <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a> <a class="code" href="classdtn_1_1ProphetBundle.html#587538d34fdf69bef337cb88c19f571c" title="DTN bundle object.">ref_</a>; 
<a name="l00110"></a><a class="code" href="classdtn_1_1ProphetBundle.html#911f36e94db03b6dba58fe6e5deb6687">00110</a>     std::string <a class="code" href="classdtn_1_1ProphetBundle.html#911f36e94db03b6dba58fe6e5deb6687" title="return value for NULL condition">str_</a>; 
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 }; <span class="comment">// class ProphetBundle</span>
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 }; <span class="comment">// namespace dtn</span>
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 <span class="preprocessor">#endif // _PROPHET_BUNDLE_H_</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:57 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>