Sophie

Sophie

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

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: Contact.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>Contact.h</h1><a href="Contact_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 2004-2006 Intel Corporation</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 _CONTACT_H_</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _CONTACT_H_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;oasys/debug/DebugUtils.h&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;oasys/debug/Formatter.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;oasys/serialize/Serialize.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;oasys/util/Ref.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;oasys/util/RefCountedObject.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;oasys/util/Time.h&gt;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">namespace </span>dtn {
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="keyword">class </span>Bundle;
<a name="l00030"></a>00030 <span class="keyword">class </span>ConvergenceLayer;
<a name="l00031"></a>00031 <span class="keyword">class </span>CLInfo;
<a name="l00032"></a><a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e">00032</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1Link.html" title="Abstraction for a DTN link, i.e.">Link</a>;
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="comment">// re-defined from Link.h</span>
<a name="l00035"></a>00035 <span class="keyword">typedef</span> oasys::Ref&lt;Link&gt; <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>;
<a name="l00036"></a>00036 
<a name="l00052"></a><a class="code" href="classdtn_1_1Contact.html">00052</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1Contact.html" title="Encapsulation of an active connection to a next-hop DTN contact.">Contact</a> : <span class="keyword">public</span> oasys::RefCountedObject,
<a name="l00053"></a>00053                 <span class="keyword">public</span> oasys::<a class="code" href="classoasys_1_1Logger.html">Logger</a>,
<a name="l00054"></a>00054                 <span class="keyword">public</span> oasys::SerializableObject
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056 <span class="keyword">public</span>:
<a name="l00060"></a>00060     <a class="code" href="classdtn_1_1Contact.html#787aa7c6618ae6a05646faa17c67163e" title="Constructor.">Contact</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>&amp; <a class="code" href="classdtn_1_1Contact.html#1e6e0ebcb8987ed4209c8276e2fcefb3" title="Accessor to the link.">link</a>);
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="keyword">private</span>:
<a name="l00067"></a>00067     <span class="keyword">virtual</span> <a class="code" href="classdtn_1_1Contact.html#24c18d0e52681de2f2f0ddbd06d6076b" title="Destructor -- private since the class is reference counted and therefore is never...">~Contact</a>();
<a name="l00068"></a><a class="code" href="classdtn_1_1Contact.html#81907604cfc432f1ccd61b5fa23e547f">00068</a>     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdtn_1_1Contact.html#81907604cfc432f1ccd61b5fa23e547f">oasys::RefCountedObject</a>;
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="keyword">public</span>:
<a name="l00074"></a><a class="code" href="classdtn_1_1Contact.html#778c38a37b2a0b0c4de6e43a0b173e5d">00074</a>     <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1Contact.html#778c38a37b2a0b0c4de6e43a0b173e5d" title="Store the convergence layer state associated with the contact.">set_cl_info</a>(<a class="code" href="classdtn_1_1CLInfo.html" title="Abstract base class for convergence layer specific state stored in an interface /...">CLInfo</a>* <a class="code" href="classdtn_1_1Contact.html#2e29bdb4ef3dbf2918037953217d605d" title="Accessor to the convergence layer info.">cl_info</a>)
<a name="l00075"></a>00075     {
<a name="l00076"></a>00076         <a class="code" href="SDNV_8cc.html#ca68c0d4ac8df0838e209fb5300f7be3">ASSERT</a>((<a class="code" href="classdtn_1_1Contact.html#50ddc40ed6b5d04c3791bf6896063f1b" title="convergence layer specific info">cl_info_</a> == NULL &amp;&amp; cl_info != NULL) ||
<a name="l00077"></a>00077                (<a class="code" href="classdtn_1_1Contact.html#50ddc40ed6b5d04c3791bf6896063f1b" title="convergence layer specific info">cl_info_</a> != NULL &amp;&amp; cl_info == NULL));
<a name="l00078"></a>00078         
<a name="l00079"></a>00079         <a class="code" href="classdtn_1_1Contact.html#50ddc40ed6b5d04c3791bf6896063f1b" title="convergence layer specific info">cl_info_</a> = cl_info;
<a name="l00080"></a>00080     }
<a name="l00081"></a>00081     
<a name="l00085"></a><a class="code" href="classdtn_1_1Contact.html#2e29bdb4ef3dbf2918037953217d605d">00085</a>     <a class="code" href="classdtn_1_1CLInfo.html" title="Abstract base class for convergence layer specific state stored in an interface /...">CLInfo</a>* <a class="code" href="classdtn_1_1Contact.html#2e29bdb4ef3dbf2918037953217d605d" title="Accessor to the convergence layer info.">cl_info</a>() { <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1Contact.html#50ddc40ed6b5d04c3791bf6896063f1b" title="convergence layer specific info">cl_info_</a>; }
<a name="l00086"></a>00086     
<a name="l00090"></a><a class="code" href="classdtn_1_1Contact.html#1e6e0ebcb8987ed4209c8276e2fcefb3">00090</a>     <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>&amp; <a class="code" href="classdtn_1_1Contact.html#1e6e0ebcb8987ed4209c8276e2fcefb3" title="Accessor to the link.">link</a>() { <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1Contact.html#7c75c16394d37caba36f3d7e9149abfc" title="Parent link on which this contact exists.">link_</a>; }
<a name="l00091"></a>00091 
<a name="l00095"></a>00095     <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1Contact.html#e68a6f685249409d9ebbca571d1be8d7" title="Virtual from formatter.">format</a>(<span class="keywordtype">char</span>* <a class="code" href="num2sdnv_8c.html#a81cdcc7ff6987bc85c073253e32715f">buf</a>, <span class="keywordtype">size_t</span> sz) <span class="keyword">const</span>;
<a name="l00096"></a>00096 
<a name="l00100"></a>00100     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1Contact.html#39236b92904ca1b46f2a4cfa8bbcdec4" title="Virtual from SerializableObject.">serialize</a>( oasys::SerializeAction *a );
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 
<a name="l00104"></a><a class="code" href="classdtn_1_1Contact.html#91f2bda674d93d4e865b89f28f9d6971">00104</a>     <span class="keyword">const</span> oasys::Time&amp; <a class="code" href="classdtn_1_1Contact.html#91f2bda674d93d4e865b89f28f9d6971" title="Accessors.">start_time</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1Contact.html#6f5215944173a6df62959e0e78a0b2a4" title="Time when the contact begin.">start_time_</a>; }
<a name="l00105"></a><a class="code" href="classdtn_1_1Contact.html#c5041a07665fe159b288f904208308da">00105</a>     u_int32_t          <a class="code" href="classdtn_1_1Contact.html#c5041a07665fe159b288f904208308da" title="Accessors.">duration</a>()<span class="keyword">   const </span>{ <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1Contact.html#6d042513a9871db3faf5a708be5fb83a" title="Contact duration (0 if unknown).">duration_</a>; }
<a name="l00106"></a><a class="code" href="classdtn_1_1Contact.html#ab0c0e35cf176e5859a9bf6a642f8bde">00106</a>     u_int32_t          <a class="code" href="classdtn_1_1Contact.html#ab0c0e35cf176e5859a9bf6a642f8bde" title="Accessors.">bps</a>()<span class="keyword">        const </span>{ <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1Contact.html#b4a2786a81e5323f9173d6c0c35ab5ec" title="Approximate bandwidth.">bps_</a>; }
<a name="l00107"></a><a class="code" href="classdtn_1_1Contact.html#f47f8a779225c422ddc60a321b0aa6ab">00107</a>     u_int32_t          <a class="code" href="classdtn_1_1Contact.html#f47f8a779225c422ddc60a321b0aa6ab" title="Accessors.">latency</a>()<span class="keyword">    const </span>{ <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1Contact.html#329ab3bf20f6f896f791f81db33b585a" title="Approximate latency.">latency_</a>; }
<a name="l00108"></a>00108 
<a name="l00109"></a><a class="code" href="classdtn_1_1Contact.html#b5d3329834b24c65bf140fe303d7f327">00109</a>     <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1Contact.html#b5d3329834b24c65bf140fe303d7f327" title="Accessors.">set_start_time</a>(<span class="keyword">const</span> oasys::Time&amp; t) { <a class="code" href="classdtn_1_1Contact.html#6f5215944173a6df62959e0e78a0b2a4" title="Time when the contact begin.">start_time_</a> = t; }
<a name="l00110"></a><a class="code" href="classdtn_1_1Contact.html#a402dd9b1f7cb319da5aa680672bc458">00110</a>     <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1Contact.html#a402dd9b1f7cb319da5aa680672bc458" title="Accessors.">set_duration</a>(u_int32_t <a class="code" href="classdtn_1_1Contact.html#c5041a07665fe159b288f904208308da" title="Accessors.">duration</a>)     { <a class="code" href="classdtn_1_1Contact.html#6d042513a9871db3faf5a708be5fb83a" title="Contact duration (0 if unknown).">duration_</a> = duration; }
<a name="l00111"></a><a class="code" href="classdtn_1_1Contact.html#8fadd87b07192f5f7c6bb3a732edbcb6">00111</a>     <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1Contact.html#8fadd87b07192f5f7c6bb3a732edbcb6" title="Accessors.">set_bps</a>(u_int32_t <a class="code" href="classdtn_1_1Contact.html#ab0c0e35cf176e5859a9bf6a642f8bde" title="Accessors.">bps</a>)               { <a class="code" href="classdtn_1_1Contact.html#b4a2786a81e5323f9173d6c0c35ab5ec" title="Approximate bandwidth.">bps_</a> = bps; }
<a name="l00112"></a><a class="code" href="classdtn_1_1Contact.html#527395d59d22f3d5f0447a87f5cbf0f2">00112</a>     <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1Contact.html#527395d59d22f3d5f0447a87f5cbf0f2" title="Accessors.">set_latency</a>(u_int32_t <a class="code" href="classdtn_1_1Contact.html#f47f8a779225c422ddc60a321b0aa6ab" title="Accessors.">latency</a>)       { <a class="code" href="classdtn_1_1Contact.html#329ab3bf20f6f896f791f81db33b585a" title="Approximate latency.">latency_</a> = latency; }
<a name="l00114"></a>00114     
<a name="l00115"></a>00115 <span class="keyword">protected</span>:
<a name="l00117"></a><a class="code" href="classdtn_1_1Contact.html#6f5215944173a6df62959e0e78a0b2a4">00117</a>     oasys::Time <a class="code" href="classdtn_1_1Contact.html#6f5215944173a6df62959e0e78a0b2a4" title="Time when the contact begin.">start_time_</a>;
<a name="l00118"></a>00118 
<a name="l00120"></a><a class="code" href="classdtn_1_1Contact.html#6d042513a9871db3faf5a708be5fb83a">00120</a>     u_int32_t <a class="code" href="classdtn_1_1Contact.html#6d042513a9871db3faf5a708be5fb83a" title="Contact duration (0 if unknown).">duration_</a>;
<a name="l00121"></a>00121 
<a name="l00123"></a><a class="code" href="classdtn_1_1Contact.html#b4a2786a81e5323f9173d6c0c35ab5ec">00123</a>     u_int32_t <a class="code" href="classdtn_1_1Contact.html#b4a2786a81e5323f9173d6c0c35ab5ec" title="Approximate bandwidth.">bps_</a>;
<a name="l00124"></a>00124     
<a name="l00126"></a><a class="code" href="classdtn_1_1Contact.html#329ab3bf20f6f896f791f81db33b585a">00126</a>     u_int32_t <a class="code" href="classdtn_1_1Contact.html#329ab3bf20f6f896f791f81db33b585a" title="Approximate latency.">latency_</a>;
<a name="l00127"></a>00127 
<a name="l00128"></a><a class="code" href="classdtn_1_1Contact.html#7c75c16394d37caba36f3d7e9149abfc">00128</a>     <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a> <a class="code" href="classdtn_1_1Contact.html#7c75c16394d37caba36f3d7e9149abfc" title="Parent link on which this contact exists.">link_</a> ;     
<a name="l00129"></a>00129     
<a name="l00130"></a><a class="code" href="classdtn_1_1Contact.html#50ddc40ed6b5d04c3791bf6896063f1b">00130</a>     <a class="code" href="classdtn_1_1CLInfo.html" title="Abstract base class for convergence layer specific state stored in an interface /...">CLInfo</a>* <a class="code" href="classdtn_1_1Contact.html#50ddc40ed6b5d04c3791bf6896063f1b" title="convergence layer specific info">cl_info_</a>;   
<a name="l00131"></a>00131 };
<a name="l00132"></a>00132 
<a name="l00136"></a><a class="code" href="namespacedtn.html#5f869544c85c75b5a85a14d6e90d7ff7">00136</a> <span class="keyword">typedef</span> oasys::Ref&lt;Contact&gt; <a class="code" href="namespacedtn.html#5f869544c85c75b5a85a14d6e90d7ff7" title="Typedef for a reference on a contact.">ContactRef</a>;
<a name="l00137"></a>00137 
<a name="l00138"></a>00138 } <span class="comment">// namespace dtn</span>
<a name="l00139"></a>00139 
<a name="l00140"></a>00140 <span class="preprocessor">#endif </span><span class="comment">/* _CONTACT_H_ */</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:53 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>