<!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: ForwardingLog.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 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>ForwardingLog.h</h1><a href="ForwardingLog_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 2005-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 _FORWARDINGLOG_H_</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _FORWARDINGLOG_H_</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include <vector></span> <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="preprocessor">#include <oasys/serialize/SerializableVector.h></span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="ForwardingInfo_8h.html">ForwardingInfo.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="contacts_2Link_8h.html">contacts/Link.h</a>"</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">namespace </span>oasys { <a name="l00027"></a>00027 <span class="keyword">class </span>SpinLock; <a name="l00028"></a>00028 <span class="keyword">class </span>StringBuffer; <a name="l00029"></a>00029 } <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="keyword">namespace </span>dtn { <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="keyword">class </span>ForwardingLog; <a name="l00034"></a>00034 <span class="keyword">class </span>Registration; <a name="l00035"></a>00035 <a name="l00052"></a><a class="code" href="classdtn_1_1ForwardingLog.html">00052</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1ForwardingLog.html" title="Class to maintain a log of informational records as to where and when a bundle has...">ForwardingLog</a> : <span class="keyword">public</span> oasys::SerializableVector<ForwardingInfo> { <a name="l00053"></a>00053 <span class="keyword">public</span>: <a name="l00054"></a><a class="code" href="classdtn_1_1ForwardingLog.html#1f320f5f6060d1b8ccc591ac6da60bf3">00054</a> <span class="keyword">typedef</span> <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">ForwardingInfo::state_t</a> <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a>; <a name="l00055"></a>00055 <a name="l00060"></a>00060 <a class="code" href="classdtn_1_1ForwardingLog.html#90235ae807fe9a60182a1908c526697f" title="Constructor that takes a pointer to the relevant Bundle&#39;s lock, used when querying...">ForwardingLog</a>(oasys::SpinLock* lock); <a name="l00061"></a>00061 <a name="l00065"></a>00065 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1ForwardingLog.html#57192cc969b46bc646ae411a8d7c27ee" title="Get the most recent entry for the given link from the log.">get_latest_entry</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link, <a class="code" href="classdtn_1_1ForwardingInfo.html" title="Class to encapsulate bundle forwarding information.">ForwardingInfo</a>* <a class="code" href="dtncat_8c.html#71f51a2e8cbe9a53031fa72596edc09f">info</a>) <span class="keyword">const</span>; <a name="l00066"></a>00066 <a name="l00070"></a>00070 <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> <a class="code" href="classdtn_1_1ForwardingLog.html#57192cc969b46bc646ae411a8d7c27ee" title="Get the most recent entry for the given link from the log.">get_latest_entry</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link) <span class="keyword">const</span>; <a name="l00071"></a>00071 <a name="l00075"></a>00075 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1ForwardingLog.html#57192cc969b46bc646ae411a8d7c27ee" title="Get the most recent entry for the given link from the log.">get_latest_entry</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Registration.html" title="Class used to represent an &quot;application&quot; registration, loosely defined...">Registration</a>* reg, <a class="code" href="classdtn_1_1ForwardingInfo.html" title="Class to encapsulate bundle forwarding information.">ForwardingInfo</a>* <a class="code" href="dtncat_8c.html#71f51a2e8cbe9a53031fa72596edc09f">info</a>) <span class="keyword">const</span>; <a name="l00076"></a>00076 <a name="l00080"></a>00080 <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> <a class="code" href="classdtn_1_1ForwardingLog.html#57192cc969b46bc646ae411a8d7c27ee" title="Get the most recent entry for the given link from the log.">get_latest_entry</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Registration.html" title="Class used to represent an &quot;application&quot; registration, loosely defined...">Registration</a>* reg) <span class="keyword">const</span>; <a name="l00081"></a>00081 <a name="l00085"></a>00085 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1ForwardingLog.html#57192cc969b46bc646ae411a8d7c27ee" title="Get the most recent entry for the given link from the log.">get_latest_entry</a>(<a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> state, <a class="code" href="classdtn_1_1ForwardingInfo.html" title="Class to encapsulate bundle forwarding information.">ForwardingInfo</a>* <a class="code" href="dtncat_8c.html#71f51a2e8cbe9a53031fa72596edc09f">info</a>) <span class="keyword">const</span>; <a name="l00086"></a>00086 <a name="l00092"></a>00092 <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1ForwardingLog.html#afa0e50bb2cd435df9f883db9f8e2f20" title="Return the count of matching entries.">get_count</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> states = <a class="code" href="classdtn_1_1ForwardingInfo.html#ce16a51e63363419dd5aa97e858199b9" title="Convenience flag to specify any forwarding state for use in searching the log.">ForwardingInfo::ANY_STATE</a>, <a name="l00093"></a>00093 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> actions = <a class="code" href="classdtn_1_1ForwardingInfo.html#59d23bb431328004d2c90a42e2b336d3" title="Convenience flag to specify any forwarding action for use in searching the log.">ForwardingInfo::ANY_ACTION</a>) <span class="keyword">const</span>; <a name="l00094"></a>00094 <a name="l00101"></a>00101 <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1ForwardingLog.html#afa0e50bb2cd435df9f883db9f8e2f20" title="Return the count of matching entries.">get_count</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>& eid, <a name="l00102"></a>00102 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> states = <a class="code" href="classdtn_1_1ForwardingInfo.html#ce16a51e63363419dd5aa97e858199b9" title="Convenience flag to specify any forwarding state for use in searching the log.">ForwardingInfo::ANY_STATE</a>, <a name="l00103"></a>00103 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> actions = <a class="code" href="classdtn_1_1ForwardingInfo.html#59d23bb431328004d2c90a42e2b336d3" title="Convenience flag to specify any forwarding action for use in searching the log.">ForwardingInfo::ANY_ACTION</a>) <span class="keyword">const</span>; <a name="l00104"></a>00104 <a name="l00108"></a>00108 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1ForwardingLog.html#3a0080cfb70b95af31a780bf71910004" title="Add a new forwarding info entry for the given link.">add_entry</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link, <a name="l00109"></a>00109 <a class="code" href="classdtn_1_1ForwardingInfo.html#18ec95dc1b1b8a7e9df9873a0d9b5947" title="The forwarding action type codes.">ForwardingInfo::action_t</a> action, <a name="l00110"></a>00110 <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> state, <a name="l00111"></a>00111 <span class="keyword">const</span> <a class="code" href="classdtn_1_1CustodyTimerSpec.html" title="Utility class to abstract out various parameters that can be used to calculate custody...">CustodyTimerSpec</a>& custody_timer); <a name="l00112"></a>00112 <a name="l00118"></a>00118 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1ForwardingLog.html#3a0080cfb70b95af31a780bf71910004" title="Add a new forwarding info entry for the given link.">add_entry</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link, <a name="l00119"></a>00119 <a class="code" href="classdtn_1_1ForwardingInfo.html#18ec95dc1b1b8a7e9df9873a0d9b5947" title="The forwarding action type codes.">ForwardingInfo::action_t</a> action, <a name="l00120"></a>00120 <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> state); <a name="l00121"></a>00121 <a name="l00125"></a>00125 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1ForwardingLog.html#3a0080cfb70b95af31a780bf71910004" title="Add a new forwarding info entry for the given link.">add_entry</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Registration.html" title="Class used to represent an &quot;application&quot; registration, loosely defined...">Registration</a>* reg, <a name="l00126"></a>00126 <a class="code" href="classdtn_1_1ForwardingInfo.html#18ec95dc1b1b8a7e9df9873a0d9b5947" title="The forwarding action type codes.">ForwardingInfo::action_t</a> action, <a name="l00127"></a>00127 <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> state); <a name="l00128"></a>00128 <a name="l00137"></a>00137 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1ForwardingLog.html#3a0080cfb70b95af31a780bf71910004" title="Add a new forwarding info entry for the given link.">add_entry</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>& eid, <a name="l00138"></a>00138 <a class="code" href="classdtn_1_1ForwardingInfo.html#18ec95dc1b1b8a7e9df9873a0d9b5947" title="The forwarding action type codes.">ForwardingInfo::action_t</a> action, <a name="l00139"></a>00139 <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> state); <a name="l00140"></a>00140 <a name="l00147"></a>00147 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1ForwardingLog.html#a6d756d62a3007192f415a35607e5f38" title="Update the state for the latest forwarding info entry for the given link.">update</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link, <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> state); <a name="l00148"></a>00148 <a name="l00152"></a>00152 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1ForwardingLog.html#02c95cd6a61ec05da7758e009e8c4568" title="Update all entries in the given state to the new state.">update_all</a>(<a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> old_state, <a class="code" href="classdtn_1_1ForwardingInfo.html#acf01ca8a774e80f6f7bf56c2b099fad" title="The forwarding log state codes.">state_t</a> new_state); <a name="l00153"></a>00153 <a name="l00157"></a>00157 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1ForwardingLog.html#43e4efb3eeb1a479bf2afefdfe1def4f" title="Dump a string representation of the log.">dump</a>(oasys::StringBuffer* <a class="code" href="num2sdnv_8c.html#a81cdcc7ff6987bc85c073253e32715f">buf</a>) <span class="keyword">const</span>; <a name="l00158"></a>00158 <a name="l00162"></a>00162 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1ForwardingLog.html#4b9314a35670b255d8045146e5754e17" title="Clear the log (used for testing).">clear</a>(); <a name="l00163"></a>00163 <a name="l00167"></a><a class="code" href="classdtn_1_1ForwardingLog.html#beba9d565089d44d6e72ff30b17fb157">00167</a> <span class="keyword">typedef</span> std::vector<ForwardingInfo> <a class="code" href="classdtn_1_1ForwardingLog.html#beba9d565089d44d6e72ff30b17fb157" title="Typedef for the log itself.">Log</a>; <a name="l00168"></a>00168 <a name="l00169"></a>00169 <span class="keyword">protected</span>: <a name="l00170"></a><a class="code" href="classdtn_1_1ForwardingLog.html#1069c4e9432020d63b9bee9204fb0ed5">00170</a> <a class="code" href="classdtn_1_1ForwardingLog.html#beba9d565089d44d6e72ff30b17fb157" title="Typedef for the log itself.">Log</a> <a class="code" href="classdtn_1_1ForwardingLog.html#1069c4e9432020d63b9bee9204fb0ed5" title="The actual log.">log_</a>; <a name="l00171"></a><a class="code" href="classdtn_1_1ForwardingLog.html#2fdcd9399f07eb815d308526c60f98d8">00171</a> oasys::SpinLock* <a class="code" href="classdtn_1_1ForwardingLog.html#2fdcd9399f07eb815d308526c60f98d8" title="Copy of the bundle&#39;s lock.">lock_</a>; <a name="l00172"></a>00172 }; <a name="l00173"></a>00173 <a name="l00174"></a>00174 } <span class="comment">// namespace dtn</span> <a name="l00175"></a>00175 <a name="l00176"></a>00176 <a name="l00177"></a>00177 <span class="preprocessor">#endif </span><span class="comment">/* _FORWARDINGLOG_H_ */</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:56 2009 for DTN Reference Implementation by <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>