coriolis/kite/doc/html/RoutingEventLoop_8h_source....

72 lines
18 KiB
HTML

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Kite - Detailed Router</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="SoC.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<h1 id="pagetop" class="header">Kite - Detailed Router</h1>
<!--
<center class="header">
<table class="header">
<tr>
<td><a href="customSummary.html">Summary</a></td>
<td><a href="namespaces.html">Namespaces</a></td>
<td><a href="customHierarchy.html">Class Hierarchy</a></td>
<td><a href="annotated.html">Classes</a></td>
<td><a href="functions.html">Member Index</a></td>
</tr>
</table>
</center>
-->
<br>
<body onload="javascript:toggleLevel(1)">
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_2916ee297f5e79ec495d393dfe8ba769.html">kite</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">RoutingEventLoop.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// -*- C++ -*-</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// This file is part of the Coriolis Software.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// Copyright (c) UPMC 2008-2013, All Rights Reserved</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// +-----------------------------------------------------------------+</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">// | C O R I O L I S |</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// | K i t e - D e t a i l e d R o u t e r |</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// | |</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// | Author : Jean-Paul CHAPUT |</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">// | =============================================================== |</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment">// | C++ Header : &quot;./kite/RoutingEventLoop.h&quot; |</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// +-----------------------------------------------------------------+</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#ifndef KITE_ROUTING_EVENT_LOOP_H</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#define KITE_ROUTING_EVENT_LOOP_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceKite.html">Kite</a> {</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="keyword">class </span>RoutingEvent;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment">// -------------------------------------------------------------------</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment">// Class : &quot;RoutingEventLoop&quot;.</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="classKite_1_1RoutingEventLoop.html"> 32</a></span>&#160; <span class="keyword">class </span><a class="code" href="classKite_1_1RoutingEventLoop.html">RoutingEventLoop</a> {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">class </span>Element {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keyword">inline</span> Element ( <span class="keywordtype">size_t</span> <span class="keywordtype">id</span>=0, <span class="keywordtype">size_t</span> timestamp=0 );</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordtype">size_t</span> _id;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keywordtype">size_t</span> _timestamp;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordtype">int</span> _count;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; };</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keyword">class </span>CompareByTimestamp {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator() ( <span class="keyword">const</span> Element&amp; lhs, <span class="keyword">const</span> Element&amp; rhs );</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; };</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="classKite_1_1RoutingEventLoop.html#aa33efa06ccc2175e35eff7ac6dadffb6">RoutingEventLoop</a> ( <span class="keywordtype">size_t</span> depth=10, <span class="keywordtype">int</span> limit=20 );</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classKite_1_1RoutingEventLoop.html#a78155a2b0119ac92d377fa404e348a98">isLooping</a> () <span class="keyword">const</span>;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classKite_1_1RoutingEventLoop.html#a5744f7f01d26947fb0765bc5d1e2c3bd">getMaxCount</a> () <span class="keyword">const</span>;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keyword">inline</span> <span class="keyword">const</span> std::vector&lt;Element&gt;&amp; <a class="code" href="classKite_1_1RoutingEventLoop.html#a7411a9e20edba3f3eeceb237dec86ff3">getElements</a> () <span class="keyword">const</span>;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classKite_1_1RoutingEventLoop.html#ad684b7c05480897bdbd86a5fb8363c72">update</a> ( <span class="keywordtype">size_t</span> <span class="keywordtype">id</span> );</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classKite_1_1RoutingEventLoop.html#a9b6582ce996327c65bf532396ca11b61">erase</a> ( <span class="keywordtype">size_t</span> <span class="keywordtype">id</span> );</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; std::vector&lt;Element&gt; _elements;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keywordtype">size_t</span> _depth;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordtype">int</span> _maxCount;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordtype">int</span> _countLimit;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordtype">bool</span> _isLooping;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; };</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">inline</span> RoutingEventLoop::Element::Element ( <span class="keywordtype">size_t</span> <span class="keywordtype">id</span>, <span class="keywordtype">size_t</span> timestamp )</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; : _id(id), _timestamp(timestamp), _count(1)</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; { }</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> RoutingEventLoop::CompareByTimestamp::operator() ( <span class="keyword">const</span> RoutingEventLoop::Element&amp; lhs, <span class="keyword">const</span> RoutingEventLoop::Element&amp; rhs )</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; { <span class="keywordflow">return</span> lhs._timestamp &gt; rhs._timestamp; }</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classKite_1_1RoutingEventLoop.html#a78155a2b0119ac92d377fa404e348a98"> 71</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classKite_1_1RoutingEventLoop.html#a78155a2b0119ac92d377fa404e348a98">RoutingEventLoop::isLooping</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _isLooping; }</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classKite_1_1RoutingEventLoop.html#a5744f7f01d26947fb0765bc5d1e2c3bd"> 72</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classKite_1_1RoutingEventLoop.html#a5744f7f01d26947fb0765bc5d1e2c3bd">RoutingEventLoop::getMaxCount</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _maxCount; }</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keyword">inline</span> <span class="keyword">const</span> std::vector&lt;RoutingEventLoop::Element&gt;&amp;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classKite_1_1RoutingEventLoop.html#a7411a9e20edba3f3eeceb237dec86ff3"> 74</a></span>&#160; <a class="code" href="classKite_1_1RoutingEventLoop.html#a7411a9e20edba3f3eeceb237dec86ff3">RoutingEventLoop::getElements</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _elements; }</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;} <span class="comment">// Kite namespace.</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="comment">//INSPECTOR_P_SUPPORT(Kite::RoutingEvent);</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor">#endif // KITE_ROUTING_EVENT_LOOP_H</span></div><div class="ttc" id="classKite_1_1RoutingEventLoop_html_a5744f7f01d26947fb0765bc5d1e2c3bd"><div class="ttname"><a href="classKite_1_1RoutingEventLoop.html#a5744f7f01d26947fb0765bc5d1e2c3bd">Kite::RoutingEventLoop::getMaxCount</a></div><div class="ttdeci">int getMaxCount() const</div><div class="ttdef"><b>Definition:</b> RoutingEventLoop.h:72</div></div>
<div class="ttc" id="classKite_1_1RoutingEventLoop_html_a9b6582ce996327c65bf532396ca11b61"><div class="ttname"><a href="classKite_1_1RoutingEventLoop.html#a9b6582ce996327c65bf532396ca11b61">Kite::RoutingEventLoop::erase</a></div><div class="ttdeci">void erase(size_t id)</div><div class="ttdef"><b>Definition:</b> RoutingEventLoop.cpp:65</div></div>
<div class="ttc" id="classKite_1_1RoutingEventLoop_html_a78155a2b0119ac92d377fa404e348a98"><div class="ttname"><a href="classKite_1_1RoutingEventLoop.html#a78155a2b0119ac92d377fa404e348a98">Kite::RoutingEventLoop::isLooping</a></div><div class="ttdeci">bool isLooping() const</div><div class="ttdef"><b>Definition:</b> RoutingEventLoop.h:71</div></div>
<div class="ttc" id="classKite_1_1RoutingEventLoop_html_aa33efa06ccc2175e35eff7ac6dadffb6"><div class="ttname"><a href="classKite_1_1RoutingEventLoop.html#aa33efa06ccc2175e35eff7ac6dadffb6">Kite::RoutingEventLoop::RoutingEventLoop</a></div><div class="ttdeci">RoutingEventLoop(size_t depth=10, int limit=20)</div><div class="ttdef"><b>Definition:</b> RoutingEventLoop.cpp:31</div></div>
<div class="ttc" id="classKite_1_1RoutingEventLoop_html"><div class="ttname"><a href="classKite_1_1RoutingEventLoop.html">Kite::RoutingEventLoop</a></div><div class="ttdoc">Simple loop dectector for RoutingEvent. </div><div class="ttdef"><b>Definition:</b> RoutingEventLoop.h:32</div></div>
<div class="ttc" id="classKite_1_1RoutingEventLoop_html_a7411a9e20edba3f3eeceb237dec86ff3"><div class="ttname"><a href="classKite_1_1RoutingEventLoop.html#a7411a9e20edba3f3eeceb237dec86ff3">Kite::RoutingEventLoop::getElements</a></div><div class="ttdeci">const std::vector&lt; Element &gt; &amp; getElements() const</div><div class="ttdef"><b>Definition:</b> RoutingEventLoop.h:74</div></div>
<div class="ttc" id="classKite_1_1RoutingEventLoop_html_ad684b7c05480897bdbd86a5fb8363c72"><div class="ttname"><a href="classKite_1_1RoutingEventLoop.html#ad684b7c05480897bdbd86a5fb8363c72">Kite::RoutingEventLoop::update</a></div><div class="ttdeci">void update(size_t id)</div><div class="ttdef"><b>Definition:</b> RoutingEventLoop.cpp:40</div></div>
<div class="ttc" id="namespaceKite_html"><div class="ttname"><a href="namespaceKite.html">Kite</a></div><div class="ttdoc">The namespace dedicated to Kite. </div><div class="ttdef"><b>Definition:</b> Constants.h:22</div></div>
</div><!-- fragment --></div><!-- contents -->
<br>
<hr>
<table class="footer1">
<tr>
<td class="LFooter"><small>Generated by doxygen 1.8.14 on Sun Nov 21 2021</small></td>
<td class="RFooter"><a href='#pagetop'><small>Return to top of page</small></a></td>
</tr>
</table>
<table class="footer2">
<tr>
<td class="LFooter">Kite - Detailed Router</td>
<td class="RFooter"><small>Copyright &#169; 2008-2020 Sorbonne Universite. All rights reserved</small></td>
</tr>
</table>
</body>
</html>