<!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: dtn::CustodyTimerSpec Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <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 class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespacedtn.html">dtn</a>::<a class="el" href="classdtn_1_1CustodyTimerSpec.html">CustodyTimerSpec</a> </div> </div> <div class="contents"> <h1>dtn::CustodyTimerSpec Class Reference</h1><!-- doxytag: class="dtn::CustodyTimerSpec" --><code>#include <<a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>></code> <p> <p> <a href="classdtn_1_1CustodyTimerSpec-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2> Utility class to abstract out various parameters that can be used to calculate custody retransmission timers. <p> This means that future extensions that take into account other parameters or factors can simply extend this class and modify the <a class="el" href="classdtn_1_1CustodyTimerSpec.html#594012538951c0ddb74c19052aea505a" title="Calculate the appropriate timeout for the given bundle.">calculate_timeout()</a> function to add new features.<p> The current basic scheme calculates the timer as: <code> timer = min((min_ + (lifetime_pct_ * bundle->lifetime_ / 100)), max_) </code><p> In other words, this class allows a retransmisison to be specified according to a minimum timer (min_), a multiplying factor based on the bundle's lifetime (lifetime_pct_), and a maximum bound (max_). All values are in seconds. <p>Definition at line <a class="el" href="CustodyTimer_8h-source.html#l00047">47</a> of file <a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>.</p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#37fd692d0e6fd3027607526e93883c86">CustodyTimerSpec</a> (u_int32_t min, u_int32_t lifetime_pct, u_int32_t max)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#37fd692d0e6fd3027607526e93883c86"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#f011c7a1d4146d8dd5dcd4e1bfd7b9a1">CustodyTimerSpec</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Default Constructor. <a href="#f011c7a1d4146d8dd5dcd4e1bfd7b9a1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">u_int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#594012538951c0ddb74c19052aea505a">calculate_timeout</a> (const <a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Calculate the appropriate timeout for the given bundle. <a href="#594012538951c0ddb74c19052aea505a"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#8d26dd3fc0961ed3d0bf558f86342cc9">parse_options</a> (int argc, const char *argv[], const char **invalidp=NULL)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Parse options to set the fields of the custody timer. <a href="#8d26dd3fc0961ed3d0bf558f86342cc9"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#ca4a6d5cfbc6e87d5b833c9ed294fcc1">serialize</a> (oasys::SerializeAction *a)</td></tr> <tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">u_int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#4eeda04970206428027b49cd227c139e">min_</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">min timer <a href="#4eeda04970206428027b49cd227c139e"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">u_int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#a678b1d99b6769917d161d651d431db3">lifetime_pct_</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">percentage of lifetime <a href="#a678b1d99b6769917d161d651d431db3"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">u_int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#22fdcd31911dbfc1740664b6c21a939e">max_</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">upper bound <a href="#22fdcd31911dbfc1740664b6c21a939e"></a><br></td></tr> <tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classdtn_1_1CustodyTimerSpec.html">CustodyTimerSpec</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1CustodyTimerSpec.html#c6d5e712cc94e4eb00f712c85065ac5c">defaults_</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Custody timer defaults, values set in the static initializer. <a href="#c6d5e712cc94e4eb00f712c85065ac5c"></a><br></td></tr> </table> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="37fd692d0e6fd3027607526e93883c86"></a><!-- doxytag: member="dtn::CustodyTimerSpec::CustodyTimerSpec" ref="37fd692d0e6fd3027607526e93883c86" args="(u_int32_t min, u_int32_t lifetime_pct, u_int32_t max)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">dtn::CustodyTimerSpec::CustodyTimerSpec </td> <td>(</td> <td class="paramtype">u_int32_t </td> <td class="paramname"> <em>min</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">u_int32_t </td> <td class="paramname"> <em>lifetime_pct</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">u_int32_t </td> <td class="paramname"> <em>max</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Constructor. <p> <p>Definition at line <a class="el" href="CustodyTimer_8h-source.html#l00057">57</a> of file <a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>.</p> </div> </div><p> <a class="anchor" name="f011c7a1d4146d8dd5dcd4e1bfd7b9a1"></a><!-- doxytag: member="dtn::CustodyTimerSpec::CustodyTimerSpec" ref="f011c7a1d4146d8dd5dcd4e1bfd7b9a1" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">dtn::CustodyTimerSpec::CustodyTimerSpec </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Default Constructor. <p> <p>Definition at line <a class="el" href="CustodyTimer_8h-source.html#l00065">65</a> of file <a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>.</p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="594012538951c0ddb74c19052aea505a"></a><!-- doxytag: member="dtn::CustodyTimerSpec::calculate_timeout" ref="594012538951c0ddb74c19052aea505a" args="(const Bundle *bundle) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">u_int32_t dtn::CustodyTimerSpec::calculate_timeout </td> <td>(</td> <td class="paramtype">const <a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em> </td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p> Calculate the appropriate timeout for the given bundle. <p> <p>Definition at line <a class="el" href="CustodyTimer_8cc-source.html#l00042">42</a> of file <a class="el" href="CustodyTimer_8cc-source.html">CustodyTimer.cc</a>.</p> <p>References <a class="el" href="bundling_2Bundle_8h-source.html#l00221">dtn::Bundle::expiration()</a>, <a class="el" href="CustodyTimer_8h-source.html#l00088">lifetime_pct_</a>, <a class="el" href="CustodyTimer_8h-source.html#l00089">max_</a>, and <a class="el" href="CustodyTimer_8h-source.html#l00087">min_</a>.</p> <p>Referenced by <a class="el" href="CustodyTimer_8cc-source.html#l00079">dtn::CustodyTimer::CustodyTimer()</a>.</p> </div> </div><p> <a class="anchor" name="8d26dd3fc0961ed3d0bf558f86342cc9"></a><!-- doxytag: member="dtn::CustodyTimerSpec::parse_options" ref="8d26dd3fc0961ed3d0bf558f86342cc9" args="(int argc, const char *argv[], const char **invalidp=NULL)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int dtn::CustodyTimerSpec::parse_options </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>argc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>argv</em>[], </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char ** </td> <td class="paramname"> <em>invalidp</em> = <code>NULL</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Parse options to set the fields of the custody timer. <p> Shifts any non-matching options to the beginning of the vector by using OptParser::parse_and_shift.<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>the number of parsed options </dd></dl> <p>Definition at line <a class="el" href="CustodyTimer_8cc-source.html#l00059">59</a> of file <a class="el" href="CustodyTimer_8cc-source.html">CustodyTimer.cc</a>.</p> <p>References <a class="el" href="CustodyTimer_8h-source.html#l00088">lifetime_pct_</a>, <a class="el" href="CustodyTimer_8h-source.html#l00089">max_</a>, and <a class="el" href="CustodyTimer_8h-source.html#l00087">min_</a>.</p> <p>Referenced by <a class="el" href="RouteEntry_8cc-source.html#l00072">dtn::RouteEntry::parse_options()</a>.</p> </div> </div><p> <a class="anchor" name="ca4a6d5cfbc6e87d5b833c9ed294fcc1"></a><!-- doxytag: member="dtn::CustodyTimerSpec::serialize" ref="ca4a6d5cfbc6e87d5b833c9ed294fcc1" args="(oasys::SerializeAction *a)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void dtn::CustodyTimerSpec::serialize </td> <td>(</td> <td class="paramtype">oasys::SerializeAction * </td> <td class="paramname"> <em>a</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="CustodyTimer_8cc-source.html#l00071">71</a> of file <a class="el" href="CustodyTimer_8cc-source.html">CustodyTimer.cc</a>.</p> <p>References <a class="el" href="CustodyTimer_8h-source.html#l00088">lifetime_pct_</a>, <a class="el" href="CustodyTimer_8h-source.html#l00089">max_</a>, and <a class="el" href="CustodyTimer_8h-source.html#l00087">min_</a>.</p> </div> </div><p> <hr><h2>Member Data Documentation</h2> <a class="anchor" name="c6d5e712cc94e4eb00f712c85065ac5c"></a><!-- doxytag: member="dtn::CustodyTimerSpec::defaults_" ref="c6d5e712cc94e4eb00f712c85065ac5c" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classdtn_1_1CustodyTimerSpec.html">CustodyTimerSpec</a> <a class="el" href="classdtn_1_1CustodyTimerSpec.html#c6d5e712cc94e4eb00f712c85065ac5c">dtn::CustodyTimerSpec::defaults_</a><code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> Custody timer defaults, values set in the static initializer. <p> Default custody timer specification:.<p> min: 30 minutes lifetime percent: 25% max: unlimited <p>Definition at line <a class="el" href="CustodyTimer_8h-source.html#l00052">52</a> of file <a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>.</p> <p>Referenced by <a class="el" href="BundleDaemon_8cc-source.html#l01027">dtn::BundleDaemon::handle_bundle_send()</a>, and <a class="el" href="ParamCommand_8cc-source.html#l00029">dtn::ParamCommand::ParamCommand()</a>.</p> </div> </div><p> <a class="anchor" name="4eeda04970206428027b49cd227c139e"></a><!-- doxytag: member="dtn::CustodyTimerSpec::min_" ref="4eeda04970206428027b49cd227c139e" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">u_int32_t <a class="el" href="classdtn_1_1CustodyTimerSpec.html#4eeda04970206428027b49cd227c139e">dtn::CustodyTimerSpec::min_</a> </td> </tr> </table> </div> <div class="memdoc"> <p> min timer <p> <p>Definition at line <a class="el" href="CustodyTimer_8h-source.html#l00087">87</a> of file <a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>.</p> <p>Referenced by <a class="el" href="CustodyTimer_8cc-source.html#l00042">calculate_timeout()</a>, <a class="el" href="ForwardingLog_8cc-source.html#l00180">dtn::ForwardingLog::dump()</a>, <a class="el" href="CustodyTimer_8cc-source.html#l00059">parse_options()</a>, and <a class="el" href="CustodyTimer_8cc-source.html#l00071">serialize()</a>.</p> </div> </div><p> <a class="anchor" name="a678b1d99b6769917d161d651d431db3"></a><!-- doxytag: member="dtn::CustodyTimerSpec::lifetime_pct_" ref="a678b1d99b6769917d161d651d431db3" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">u_int32_t <a class="el" href="classdtn_1_1CustodyTimerSpec.html#a678b1d99b6769917d161d651d431db3">dtn::CustodyTimerSpec::lifetime_pct_</a> </td> </tr> </table> </div> <div class="memdoc"> <p> percentage of lifetime <p> <p>Definition at line <a class="el" href="CustodyTimer_8h-source.html#l00088">88</a> of file <a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>.</p> <p>Referenced by <a class="el" href="CustodyTimer_8cc-source.html#l00042">calculate_timeout()</a>, <a class="el" href="ForwardingLog_8cc-source.html#l00180">dtn::ForwardingLog::dump()</a>, <a class="el" href="CustodyTimer_8cc-source.html#l00059">parse_options()</a>, and <a class="el" href="CustodyTimer_8cc-source.html#l00071">serialize()</a>.</p> </div> </div><p> <a class="anchor" name="22fdcd31911dbfc1740664b6c21a939e"></a><!-- doxytag: member="dtn::CustodyTimerSpec::max_" ref="22fdcd31911dbfc1740664b6c21a939e" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">u_int32_t <a class="el" href="classdtn_1_1CustodyTimerSpec.html#22fdcd31911dbfc1740664b6c21a939e">dtn::CustodyTimerSpec::max_</a> </td> </tr> </table> </div> <div class="memdoc"> <p> upper bound <p> <p>Definition at line <a class="el" href="CustodyTimer_8h-source.html#l00089">89</a> of file <a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a>.</p> <p>Referenced by <a class="el" href="CustodyTimer_8cc-source.html#l00042">calculate_timeout()</a>, <a class="el" href="ForwardingLog_8cc-source.html#l00180">dtn::ForwardingLog::dump()</a>, <a class="el" href="CustodyTimer_8cc-source.html#l00059">parse_options()</a>, and <a class="el" href="CustodyTimer_8cc-source.html#l00071">serialize()</a>.</p> </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="CustodyTimer_8h-source.html">CustodyTimer.h</a><li><a class="el" href="CustodyTimer_8cc-source.html">CustodyTimer.cc</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Mon Jul 21 14:09:51 2008 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.6 </small></address> </body> </html>