root/doc/html/front__drop__queue_8h-source.html @ 353

Revision 353, 7.9 kB (checked in by smidl, 16 years ago)

doc

RevLine 
[353]1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3<title>mixpp: front_drop_queue.h Source File</title>
4<link href="tabs.css" rel="stylesheet" type="text/css">
5<link href="doxygen.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.5.8 -->
8<script type="text/javascript">
9<!--
10function changeDisplayState (e){
11  var num=this.id.replace(/[^[0-9]/g,'');
12  var button=this.firstChild;
13  var sectionDiv=document.getElementById('dynsection'+num);
14  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
15    sectionDiv.style.display='block';
16    button.src='open.gif';
17  }else{
18    sectionDiv.style.display='none';
19    button.src='closed.gif';
20  }
21}
22function initDynSections(){
23  var divs=document.getElementsByTagName('div');
24  var sectionCounter=1;
25  for(var i=0;i<divs.length-1;i++){
26    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
27      var header=divs[i];
28      var section=divs[i+1];
29      var button=header.firstChild;
30      if (button!='IMG'){
31        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
32        button=document.createElement('img');
33        divs[i].insertBefore(button,divs[i].firstChild);
34      }
35      header.style.cursor='pointer';
36      header.onclick=changeDisplayState;
37      header.id='dynheader'+sectionCounter;
38      button.src='closed.gif';
39      section.id='dynsection'+sectionCounter;
40      section.style.display='none';
41      section.style.marginLeft='14px';
42      sectionCounter++;
43    }
44  }
45}
46window.onload = initDynSections;
47-->
48</script>
49<div class="navigation" id="top">
50  <div class="tabs">
51    <ul>
52      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
53      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
54      <li><a href="modules.html"><span>Modules</span></a></li>
55      <li><a href="annotated.html"><span>Classes</span></a></li>
56      <li class="current"><a href="files.html"><span>Files</span></a></li>
57    </ul>
58  </div>
59  <div class="tabs">
60    <ul>
61      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
62      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
63    </ul>
64  </div>
65<h1>front_drop_queue.h</h1><a href="front__drop__queue_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
66<a name="l00029"></a>00029 <span class="preprocessor">#ifndef FRONT_DROP_QUEUE_H</span>
67<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define FRONT_DROP_QUEUE_H</span>
68<a name="l00031"></a>00031 <span class="preprocessor"></span>
69<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="packet_8h.html" title="Definition of a Packet class.">itpp/protocol/packet.h</a>&gt;</span>
70<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="events_8h.html" title="Definitions of an event-based simulation class.">itpp/protocol/events.h</a>&gt;</span>
71<a name="l00034"></a>00034
72<a name="l00035"></a>00035
73<a name="l00036"></a>00036 <span class="keyword">namespace </span>itpp
74<a name="l00037"></a>00037 {
75<a name="l00038"></a>00038
76<a name="l00040"></a>00040
77<a name="l00041"></a>00041
78<a name="l00043"></a><a class="code" href="group__protocol.html#g237c48e37f0f4e948eade393d5fedd5c">00043</a> <span class="preprocessor">#define DEFAULT_MAX_BYTES_IN_QUEUE 24000</span>
79<a name="l00044"></a>00044 <span class="preprocessor"></span>
80<a name="l00046"></a><a class="code" href="classitpp_1_1Front__Drop__Queue.html">00046</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1Front__Drop__Queue.html" title="ADD DOCUMENTATION HERE.">Front_Drop_Queue</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> std::queue&lt;Packet*&gt;
81<a name="l00047"></a>00047 {
82<a name="l00048"></a>00048 <span class="keyword">public</span>:
83<a name="l00050"></a><a class="code" href="classitpp_1_1Front__Drop__Queue.html#71817f6e6ef4f81a6c0c2f6f82a37242">00050</a>   <a class="code" href="classitpp_1_1Front__Drop__Queue.html#71817f6e6ef4f81a6c0c2f6f82a37242" title="ADD DOCUMENTATION HERE.">Front_Drop_Queue</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> max_bytes = <a class="code" href="group__protocol.html#g237c48e37f0f4e948eade393d5fedd5c" title="ADD DOCUMENTATION HERE.">DEFAULT_MAX_BYTES_IN_QUEUE</a>)  {
84<a name="l00051"></a>00051     max_bytes_in_queue = max_bytes;
85<a name="l00052"></a>00052     bytes_in_queue = 0;
86<a name="l00053"></a>00053     debug = <span class="keyword">false</span>;
87<a name="l00054"></a>00054   }
88<a name="l00055"></a>00055
89<a name="l00056"></a>00056   <span class="comment">// TODO destructor</span>
90<a name="l00057"></a>00057   <span class="comment">//  ~FrontDropQueue() { }</span>
91<a name="l00058"></a>00058
92<a name="l00060"></a><a class="code" href="classitpp_1_1Front__Drop__Queue.html#aef4fba0d5bd35d9e501f1e1c8722703">00060</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Front__Drop__Queue.html#aef4fba0d5bd35d9e501f1e1c8722703" title="ADD DOCUMENTATION HERE.">set_debug</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> enable_debug = <span class="keyword">true</span>) {
93<a name="l00061"></a>00061     debug = enable_debug;
94<a name="l00062"></a>00062   }
95<a name="l00063"></a>00063
96<a name="l00065"></a>00065   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Front__Drop__Queue.html#6c065bc1b104306b8a659f50ffaf3ce0" title="ADD DOCUMENTATION HERE.">push</a>(<a class="code" href="classitpp_1_1Packet.html">Packet</a> *packet);
97<a name="l00067"></a>00067   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Front__Drop__Queue.html#494fd290edf625e35f88a24ef3768a87" title="ADD DOCUMENTATION HERE.">pop</a>();
98<a name="l00068"></a>00068
99<a name="l00070"></a><a class="code" href="classitpp_1_1Front__Drop__Queue.html#8979aadfadd56add978c181a9970fc4d">00070</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1Front__Drop__Queue.html#8979aadfadd56add978c181a9970fc4d" title="ADD DOCUMENTATION HERE.">set_max_byte_size</a>(<span class="keywordtype">int</span> max_bytes) { max_bytes_in_queue = max_bytes; }
100<a name="l00072"></a><a class="code" href="classitpp_1_1Front__Drop__Queue.html#f2f0e20b7b8fb3a3bee82ef666ccb50e">00072</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Front__Drop__Queue.html#f2f0e20b7b8fb3a3bee82ef666ccb50e" title="ADD DOCUMENTATION HERE.">max_byte_size</a>() { <span class="keywordflow">return</span> max_bytes_in_queue; }
101<a name="l00074"></a><a class="code" href="classitpp_1_1Front__Drop__Queue.html#5b2bc4caacf5ada02208db0e5f9f4362">00074</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Front__Drop__Queue.html#5b2bc4caacf5ada02208db0e5f9f4362" title="ADD DOCUMENTATION HERE.">byte_size</a>() { <span class="keywordflow">return</span> bytes_in_queue; }
102<a name="l00075"></a>00075
103<a name="l00076"></a>00076 <span class="keyword">private</span>:
104<a name="l00077"></a>00077   <span class="keywordtype">int</span> max_bytes_in_queue;
105<a name="l00078"></a>00078   <span class="keywordtype">int</span> bytes_in_queue;
106<a name="l00079"></a>00079   <span class="keywordtype">int</span> debug;
107<a name="l00080"></a>00080 };
108<a name="l00081"></a>00081
109<a name="l00083"></a>00083
110<a name="l00084"></a>00084 } <span class="comment">// namespace itpp</span>
111<a name="l00085"></a>00085
112<a name="l00086"></a>00086 <span class="preprocessor">#endif // #ifndef FRONT_DROP_QUEUE_H</span>
113<a name="l00087"></a>00087 <span class="preprocessor"></span>
114</pre></div></div>
115<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:11 2009 for mixpp by&nbsp;
116<a href="http://www.doxygen.org/index.html">
117<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
118</body>
119</html>
Note: See TracBrowser for help on using the browser.