Sophie

Sophie

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

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: Node.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>Node.h</h1><a href="sim_2Node_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 _NODE_H_</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _NODE_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/Log.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;oasys/storage/DurableStore.h&gt;</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="SimEventHandler_8h.html">SimEventHandler.h</a>"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="BundleDaemon_8h.html">bundling/BundleDaemon.h</a>"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="DTNStorageConfig_8h.html">storage/DTNStorageConfig.h</a>"</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="BundleStore_8h.html">storage/BundleStore.h</a>"</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="LinkStore_8h.html">storage/LinkStore.h</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="GlobalStore_8h.html">storage/GlobalStore.h</a>"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="ProphetStore_8h.html">storage/ProphetStore.h</a>"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="RegistrationStore_8h.html">storage/RegistrationStore.h</a>"</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="keyword">using namespace </span>dtn;
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">namespace </span>dtn {
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="keyword">class </span><a class="code" href="classdtn_1_1ContactManager.html" title="A contact manager class.">ContactManager</a>;
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 }
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="keyword">namespace </span>dtnsim {
<a name="l00042"></a>00042 
<a name="l00051"></a><a class="code" href="classdtnsim_1_1Node.html">00051</a> <span class="keyword">class </span><a class="code" href="classdtnsim_1_1Node.html" title="Class representing a node in the simulator (i.e.">Node</a> : <span class="keyword">public</span> <a class="code" href="classdtnsim_1_1SimEventHandler.html" title="Interface implemented by all objects that handle simulator events.">SimEventHandler</a>, <span class="keyword">public</span> <a class="code" href="classdtn_1_1BundleDaemon.html" title="Class that handles the basic event / action mechanism.">BundleDaemon</a> {
<a name="l00052"></a>00052 <span class="keyword">public</span>:
<a name="l00056"></a>00056     <a class="code" href="classdtnsim_1_1Node.html#074e93c9bad5de54eb57ddffff72ef75" title="Constructor.">Node</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classdtnsim_1_1Node.html#cac8ab04c1d7117e0dea6b3ad74f70de" title="Accessor for name.">name</a>);
<a name="l00057"></a>00057 
<a name="l00061"></a>00061     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#4414744591be052f32086caab4c4ebde" title="Virtual initialization function.">do_init</a>();
<a name="l00062"></a>00062 
<a name="l00067"></a><a class="code" href="classdtnsim_1_1Node.html#e793c18bbb49d25686b237e0ac174ab8">00067</a>     <span class="keywordtype">size_t</span> <a class="code" href="classdtnsim_1_1Node.html#e793c18bbb49d25686b237e0ac174ab8" title="Override of BundleDaemon::event_queue_size since eventq_ is shadowed to be a simple...">event_queue_size</a>()
<a name="l00068"></a>00068     {
<a name="l00069"></a>00069         <span class="keywordflow">return</span> <a class="code" href="classdtnsim_1_1Node.html#68523cb4ac21974e55273049f4a90c7e" title="The event queue.">eventq_</a>-&gt;size();
<a name="l00070"></a>00070     }
<a name="l00071"></a>00071     
<a name="l00076"></a>00076     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#ce2bf5e05e9fa6890f42fa921deadaba" title="Second pass at initialization, called by the simulator once the whole config has...">configure</a>();
<a name="l00077"></a>00077 
<a name="l00081"></a><a class="code" href="classdtnsim_1_1Node.html#c39136984ee2a88cc58f3f1e930ee8e6">00081</a>     <span class="keyword">virtual</span> <a class="code" href="classdtnsim_1_1Node.html#c39136984ee2a88cc58f3f1e930ee8e6" title="Destructor.">~Node</a>() {}
<a name="l00082"></a>00082         
<a name="l00087"></a>00087     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#0986c0f6d3eeec3fba7779a3d6d38513" title="Virtual post function, overridden in the simulator to use the modified event queue...">post_event</a>(<a class="code" href="classdtn_1_1BundleEvent.html" title="Event base class.">BundleEvent</a>* event, <span class="keywordtype">bool</span> at_back = <span class="keyword">true</span>);
<a name="l00088"></a>00088     
<a name="l00092"></a>00092     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#5e28e4d8b0ae960002aec66a189b2c05" title="Virtual function from SimEventHandler.">process</a>(<a class="code" href="classdtnsim_1_1SimEvent.html">SimEvent</a> *e);
<a name="l00093"></a>00093 
<a name="l00097"></a>00097     <span class="keywordtype">bool</span> <a class="code" href="classdtnsim_1_1Node.html#ec11501277a101b0e58382de65dad675" title="Drain and process a bundle event from the queue, if one exists.">process_one_bundle_event</a>();
<a name="l00098"></a>00098 
<a name="l00102"></a>00102     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#bf0a05a33ba6ad52d63bc4083b03f8a4" title="Run the given event immediately.">run_one_event_now</a>(<a class="code" href="classdtn_1_1BundleEvent.html" title="Event base class.">BundleEvent</a>* event);
<a name="l00103"></a>00103 
<a name="l00107"></a>00107     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#2a573065ddac7d2f9523546659bc55ca" title="Overridden event handlers from BundleDaemon.">handle_bundle_delivered</a>(<a class="code" href="classdtn_1_1BundleDeliveredEvent.html" title="Event class for local bundle delivery.">BundleDeliveredEvent</a>* event);
<a name="l00108"></a>00108     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#a50d612c8e5c31110fb6000f4e46d5e2" title="Event type specific handlers.">handle_bundle_received</a>(<a class="code" href="classdtn_1_1BundleReceivedEvent.html" title="Event class for new bundle arrivals.">BundleReceivedEvent</a>* event);
<a name="l00109"></a>00109     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#f37ddd1f3a80a3d4a42526bece7f470f" title="Event type specific handlers.">handle_bundle_transmitted</a>(<a class="code" href="classdtn_1_1BundleTransmittedEvent.html" title="Event class for bundle or fragment transmission.">BundleTransmittedEvent</a>* event);
<a name="l00110"></a>00110     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#f4577b4131d52ea9f225e33d900307f7" title="Event type specific handlers.">handle_bundle_expired</a>(<a class="code" href="classdtn_1_1BundleExpiredEvent.html" title="Event class for bundle expiration.">BundleExpiredEvent</a>* event);
<a name="l00111"></a>00111     
<a name="l00115"></a><a class="code" href="classdtnsim_1_1Node.html#cac8ab04c1d7117e0dea6b3ad74f70de">00115</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classdtnsim_1_1Node.html#cac8ab04c1d7117e0dea6b3ad74f70de" title="Accessor for name.">name</a>() { <span class="keywordflow">return</span> <a class="code" href="classdtnsim_1_1Node.html#e08954a873c45b5778c2250b3bd7ce30">name_</a>.c_str(); }
<a name="l00116"></a>00116     
<a name="l00120"></a><a class="code" href="classdtnsim_1_1Node.html#06e2a2c87639bf97afde8d4bdaa2edb9">00120</a>     <a class="code" href="classdtn_1_1BundleRouter.html" title="The BundleRouter is the main decision maker for all routing decisions related to...">BundleRouter</a>* <a class="code" href="classdtnsim_1_1Node.html#06e2a2c87639bf97afde8d4bdaa2edb9" title="Accessor for router.">router</a>() { <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1BundleDaemon.html#a5c8a244aad225987f9359ee1c2a1101" title="The active bundle router.">router_</a>; }
<a name="l00121"></a>00121 
<a name="l00130"></a>00130     <span class="keywordtype">void</span> <a class="code" href="classdtnsim_1_1Node.html#5f8ad70a765bbb1b8d8e8d07ef502036" title="Set the node as the &amp;quot;active&amp;quot; node in the simulation.">set_active</a>();
<a name="l00131"></a>00131 
<a name="l00135"></a><a class="code" href="classdtnsim_1_1Node.html#0092d41cdd29927ede0833a8164885e9">00135</a>     <span class="keyword">static</span> <a class="code" href="classdtnsim_1_1Node.html" title="Class representing a node in the simulator (i.e.">Node</a>* <a class="code" href="classdtnsim_1_1Node.html#0092d41cdd29927ede0833a8164885e9" title="Return the current active node.">active_node</a>()
<a name="l00136"></a>00136     {
<a name="l00137"></a>00137         <span class="keywordflow">return</span> (<a class="code" href="classdtnsim_1_1Node.html" title="Class representing a node in the simulator (i.e.">Node</a>*)instance_;
<a name="l00138"></a>00138     }
<a name="l00139"></a>00139 
<a name="l00143"></a><a class="code" href="classdtnsim_1_1Node.html#e2d0efe5c73211e6b8387b05555b18b3">00143</a>     <a class="code" href="classdtn_1_1DTNStorageConfig.html" title="Subclass of the basic oasys storage config to add dtn-specific configuration variables...">DTNStorageConfig</a>* <a class="code" href="classdtnsim_1_1Node.html#e2d0efe5c73211e6b8387b05555b18b3" title="Accessor for the storage config at this node.">storage_config</a>() { <span class="keywordflow">return</span> &amp;<a class="code" href="classdtnsim_1_1Node.html#d9b58bb48d37ea621beb559338291ea3" title="Fake-Durable storage.">storage_config_</a>; }
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 <span class="keyword">protected</span>:
<a name="l00146"></a><a class="code" href="classdtnsim_1_1Node.html#e08954a873c45b5778c2250b3bd7ce30">00146</a>     <span class="keyword">const</span> std::string   <a class="code" href="classdtnsim_1_1Node.html#e08954a873c45b5778c2250b3bd7ce30">name_</a>;
<a name="l00147"></a><a class="code" href="classdtnsim_1_1Node.html#163ecac5eecee2ffdf18da81e3ee4d9a">00147</a>     u_int32_t           <a class="code" href="classdtnsim_1_1Node.html#163ecac5eecee2ffdf18da81e3ee4d9a">next_bundleid_</a>;
<a name="l00148"></a><a class="code" href="classdtnsim_1_1Node.html#47976f809566c89319d8a066b19d907b">00148</a>     u_int32_t           <a class="code" href="classdtnsim_1_1Node.html#47976f809566c89319d8a066b19d907b">next_regid_</a>;
<a name="l00149"></a><a class="code" href="classdtnsim_1_1Node.html#68523cb4ac21974e55273049f4a90c7e">00149</a>     std::queue&lt;BundleEvent*&gt;* <a class="code" href="classdtnsim_1_1Node.html#68523cb4ac21974e55273049f4a90c7e" title="The event queue.">eventq_</a>;
<a name="l00150"></a><a class="code" href="classdtnsim_1_1Node.html#ebf1cc7d563fac70eeddcf450ec9b9ea">00150</a>     oasys::TimerSystem* <a class="code" href="classdtnsim_1_1Node.html#ebf1cc7d563fac70eeddcf450ec9b9ea">timersys_</a>;
<a name="l00151"></a>00151 
<a name="l00153"></a><a class="code" href="classdtnsim_1_1Node.html#d9b58bb48d37ea621beb559338291ea3">00153</a>     <a class="code" href="classdtn_1_1DTNStorageConfig.html" title="Subclass of the basic oasys storage config to add dtn-specific configuration variables...">DTNStorageConfig</a>     <a class="code" href="classdtnsim_1_1Node.html#d9b58bb48d37ea621beb559338291ea3" title="Fake-Durable storage.">storage_config_</a>;
<a name="l00154"></a><a class="code" href="classdtnsim_1_1Node.html#0cbd475b36f5f23d1eabab80e59be58d">00154</a>     oasys::DurableStore* <a class="code" href="classdtnsim_1_1Node.html#0cbd475b36f5f23d1eabab80e59be58d" title="Fake-Durable storage.">store_</a>;
<a name="l00155"></a><a class="code" href="classdtnsim_1_1Node.html#70a9ca590a1dd34edc510a32cc321ac7">00155</a>     <a class="code" href="classdtn_1_1BundleStore.html" title="The class for bundle storage is an instantiation of an oasys durable table to store...">BundleStore</a>*         <a class="code" href="classdtnsim_1_1Node.html#70a9ca590a1dd34edc510a32cc321ac7" title="Fake-Durable storage.">bundle_store_</a>;
<a name="l00156"></a><a class="code" href="classdtnsim_1_1Node.html#df5cdf590d56fc1e6d0b26543f757058">00156</a>     <a class="code" href="classdtn_1_1ProphetStore.html">ProphetStore</a>*        <a class="code" href="classdtnsim_1_1Node.html#df5cdf590d56fc1e6d0b26543f757058" title="Fake-Durable storage.">prophet_store_</a>;
<a name="l00157"></a><a class="code" href="classdtnsim_1_1Node.html#235f8e658986689890ebe8d945c99e3d">00157</a>     <a class="code" href="classdtn_1_1LinkStore.html" title="The class for link storage.">LinkStore</a>*           <a class="code" href="classdtnsim_1_1Node.html#235f8e658986689890ebe8d945c99e3d" title="Fake-Durable storage.">link_store_</a>;
<a name="l00158"></a><a class="code" href="classdtnsim_1_1Node.html#ace72cb87ffc528a9fa15ef65d087bc4">00158</a>     <a class="code" href="classdtn_1_1RegistrationStore.html" title="The class for registration storage is simply an instantiation of the generic oasys...">RegistrationStore</a>*   <a class="code" href="classdtnsim_1_1Node.html#ace72cb87ffc528a9fa15ef65d087bc4" title="Fake-Durable storage.">reg_store_</a>;
<a name="l00160"></a>00160 };
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 } <span class="comment">// namespace dtnsim</span>
<a name="l00163"></a>00163 
<a name="l00164"></a>00164 <span class="preprocessor">#endif </span><span class="comment">/* _NODE_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>