umts-queue.h

00001 /*
00002  * Copyright (c) 2003 Ericsson Telecommunicatie B.V.
00003  * All rights reserved.
00004  * 
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *     notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *     notice, this list of conditions and the following disclaimer in the
00012  *     documentation and/or other materials provided with the
00013  *     distribution.
00014  * 3. Neither the name of Ericsson Telecommunicatie B.V. may be used
00015  *     to endorse or promote products derived from this software without
00016  *     specific prior written permission.
00017  * 
00018  * 
00019  * THIS SOFTWARE IS PROVIDED BY ERICSSON TELECOMMUNICATIE B.V. AND
00020  * CONTRIBUTORS "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
00021  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00022  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00023  * IN NO EVENT SHALL ERICSSON TELECOMMUNICATIE B.V., THE AUTHOR OR HIS
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00027  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00028  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00030  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  * 
00032  * 
00033  * Contact for feedback on EURANE: eurane@ti-wmc.nl
00034  * EURANE = Enhanced UMTS Radio Access Network Extensions
00035  * website: http://www.ti-wmc.nl/eurane/
00036  */
00037 
00038 /*
00039  * $Id: umts-queue.h,v 1.11 2004/02/06 16:34:02 simon Exp $
00040  */
00041 
00042 #ifndef ns_umtsQueue_h
00043 #define ns_umtsQueue_h
00044 
00045 
00046 #include "packet.h"
00047 #include "umts-headers.h"
00048 #include <vector>
00049 
00050 
00051 class umtsQueue:public TclObject {
00052 public:
00053    umtsQueue();
00054 
00055    void        enque(Packet * p);
00056    void        enqueUniqueFront(Packet * p);
00057    void        orderedEnque(Packet * p);
00058    Packet     *deque();
00059    Packet     *dequeTail();
00060    Packet     *dequeCopy();
00061    Packet     *dequeTailCopy();
00062    Packet     *deque(int seqno);
00063    Packet     *dequeCopy(int seqno);
00064    Packet     *dequeFirstSendable();
00065    void        updateLastServedTime();
00066    int         getPacketSize();
00067    void        dropTill(int seqno);
00068    void        printQueue();
00069    int         size();
00070    int         size(int position);
00071    int         sizeInBits();
00072    int         sizeInBits(int position);
00073    int         length();
00074    int         red_size(int bytes);
00075    void        dump();
00076 
00077    // lastServedTime_ is set to the current simulation time, when the first
00078    // element is changed. This enables round-robin schedulers to determine
00079    // which queue to handle.
00080    double      lastServedTime_;
00081 
00082    // for debugging purposes only...
00083    int         len_;
00084 
00085    // TODO: change hsdpalink in such a way that this variable isn't needed here
00086    // anymore.
00087    int         tx_seq_nr_;      // last TSN
00088 
00089 private:
00090                vector < Packet * >q_;
00091 
00092 };
00093 
00094 #endif

Generated on Wed Nov 26 15:47:29 2008 for NS-MIRACLE library by  doxygen 1.5.2