// Header file for qMgr class, which manages a set of queues. // links in the system. #ifndef QMGR_H #define QMGR_H #include "wunet.h" #include "listset.h" #include "mheap.h" #include "lnkTbl.h" #include "pktStore.h" class qMgr { public: qMgr(int,int,int,pktStore*,lnkTbl*); ~qMgr(); bool enq(int,int,uint32_t); // add packet on link queue int deq(int); // deq packet from given link int nextReady(uint32_t); // index of next ready link int qlenPkts(int); int qlenBytes(int); private: int nL; // number of links int nP; // number of packets that can be queued int qL; // maximum queue length (in packets) listset *queues; // collection of lists mheap *active; // active links, ordered by due time mheap *vactive; // virtually active links int *npq; // npq[q] = number of packets in q int *nbq; // nbq[q] = number of bytes in q pktStore *ps; // pointer to packet store object lnkTbl *lt; // pointer to link table object }; inline int qMgr::qlenPkts(int q) { return npq[q]; } inline int qMgr::qlenBytes(int q) { return nbq[q]; } #endif