⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node67.html

📁 相关搜索: ns2仿真结果分析 all-awk ns2 ns2 无限网络中awk文件 ... [2.tcl.rar] - 在ns2平台上实现对AODV协议的模拟
💻 HTML
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by:  Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by:  Nikos Drakos, CBLU, University of Leeds* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from:  Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>7.1.2 PacketQueue Class</TITLE><META NAME="description" CONTENT="7.1.2 PacketQueue Class"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="previous" HREF="node66.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node66.html"><LINK REL="up" HREF="node65.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node65.html"><LINK REL="next" HREF="node68.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node68.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html2348"  HREF="node68.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node68.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2342"  HREF="node65.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node65.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2338"  HREF="node66.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node66.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2344"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html2346"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html2349"  HREF="node68.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node68.html">7.2 Example: Drop Tail</A><B> Up:</B> <A NAME="tex2html2343"  HREF="node65.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node65.html">7.1 The C++ Queue</A><B> Previous:</B> <A NAME="tex2html2339"  HREF="node66.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node66.html">7.1.1 Queue blocking</A> &nbsp <B>  <A NAME="tex2html2345"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html2347"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H2><A NAME="SECTION03412000000000000000"></A><A NAME="sec:packetqclass"></A><BR>7.1.2 PacketQueue Class</H2><P>The <TT>Queue</TT> class may implement buffer management and scheduling butdo not implement the low-level operations on a particular queue.The <TT>PacketQueue</TT> class is used for this purpose, and is defined as follows(see <TT>queue.h</TT>):<PRE>        class PacketQueue {        public:                PacketQueue();                int length(); /* queue length in packets */                void enque(Packet* p);                Packet* deque();                Packet* lookup(int n);                /* remove a specific packet, which must be in the queue */                void remove(Packet*);        protected:                Packet* head_;                Packet** tail_;                int len_;               // packet count        };</PRE>This class maintains a linked-list of packets, and is commonlyused by particular scheduling and buffer management disciplinesto hold an ordered set of packets.Particular scheduling or buffer management schemes may makeuse of several <TT>PacketQueue</TT> objects.The <TT>PacketQueue</TT> class maintains current counts of the number ofpackets held in the queue which is returned by the []length method.The <TT>enque</TT> function places the specified packet at the end ofthe queue and updates the <TT>len_</TT> member variable.The <TT>deque</TT> function returns the packet at the head of thequeue and removes it from the queue (and updates the counters), orreturns NULL if the queue is empty.The <TT>lookup</TT> function returns the th packet from the headof the queue, or NULL otherwise.The <TT>remove</TT> function deletes the packet stored in the given addressfrom the queue (and updates the counters).It causes an abnormal program termination if the packet does not exist.<P><HR><!--Navigation Panel--><A NAME="tex2html2348"  HREF="node68.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node68.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2342"  HREF="node65.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node65.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2338"  HREF="node66.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node66.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2344"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html2346"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html2349"  HREF="node68.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node68.html">7.2 Example: Drop Tail</A><B> Up:</B> <A NAME="tex2html2343"  HREF="node65.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node65.html">7.1 The C++ Queue</A><B> Previous:</B> <A NAME="tex2html2339"  HREF="node66.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node66.html">7.1.1 Queue blocking</A> &nbsp <B>  <A NAME="tex2html2345"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html2347"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <!--End of Navigation Panel--><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -