|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.comp.queue.ActiveQueue
drcl.inet.core.Queue
drcl.inet.core.queue.PriorityQueue
PriorityQueue is an m-level queue. m is configurable.
Specifically, it consists of m FIFO queues, each associated with
a queue logic.
The level-0 queue has the highest priority
while the level-(m-1) queue has the lowest.
It uses a PktClassifier to
classify the incoming packets into m levels. When a packet arrives,
the packet is classified into one of the m level and is put in that
FIFO queue if the corresponding queue logic permits.
The component treats a packet as lowest priority if no level of queue
is found for the packet.
| Nested Class Summary |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary | |
static java.lang.String |
EVENT_QSIZE_PORT_ID
Name of the port that exports the instant queue size change events. |
| Fields inherited from class drcl.comp.queue.ActiveQueue |
OUTPUT_PORT_ID |
| Fields inherited from interface drcl.inet.core.InetCoreConstants |
CONFIG_PORT_ID, PULL_PORT_ID |
| Constructor Summary | |
PriorityQueue()
|
|
PriorityQueue(java.lang.String id_)
|
|
| Method Summary | |
int |
classify(Packet p_)
Implements PktClassifier.classify(drcl.net.Packet).
|
java.lang.Object |
dequeue()
Dequeues and returns the first object in the queue. |
void |
duplicate(java.lang.Object source_)
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. |
java.lang.Object |
enqueue(java.lang.Object obj_)
Enqueues the object at the end of the queue |
java.lang.Object |
firstElement()
Retrieves but not dequeue the first object in the queue. |
int |
getCapacity()
Returns the capacity of the queue. |
QLogic |
getQLogic(int level_)
|
Queue |
getQueue(int level_)
|
int |
getSize()
Returns the current size of the queue. |
java.lang.String |
info(java.lang.String prefix_)
|
boolean |
isDropHeadEnabled()
|
boolean |
isEmpty()
Return true if the queue is empty. |
boolean |
isFull()
Return true if the queue is full. |
java.lang.Object |
lastElement()
Retrieves but not remove the last object in the queue. |
java.lang.Object |
peekAt(int pos_)
Retrieves but not remove the object at the position specified. |
void |
reset()
Resets the component for being used anew. |
void |
setCapacity(int capacity_)
Sets the capacity of the queue. |
void |
setClassifier(PktClassifier pc_)
|
void |
setDropHeadEnabled(boolean enabled_)
|
void |
setLevels(int nlevels_)
|
void |
setQLogic(int level_,
QLogic qlogic_)
|
| Methods inherited from class drcl.inet.core.Queue |
getMode, setMode |
| Methods inherited from class drcl.comp.queue.ActiveQueue |
enqueueAt, getAvailableSize, increaseEnqueCount, info, retrieveAt |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String EVENT_QSIZE_PORT_ID
| Constructor Detail |
public PriorityQueue()
public PriorityQueue(java.lang.String id_)
| Method Detail |
public int classify(Packet p_)
PktClassifier.classify(drcl.net.Packet).
It simply return (1 - the first bit of the ToS field of the INET header)
so CONTROL packets have higher priority than DATA packets.
classify in interface PktClassifierpublic void setClassifier(PktClassifier pc_)
public void reset()
Component
reset in class Queuepublic void duplicate(java.lang.Object source_)
Component
duplicate in interface ObjectDuplicableduplicate in class Queuepublic java.lang.String info(java.lang.String prefix_)
info in class Queuepublic Queue getQueue(int level_)
public void setQLogic(int level_,
QLogic qlogic_)
level_ - level index of the queue logic.public void setLevels(int nlevels_)
public QLogic getQLogic(int level_)
public java.lang.Object enqueue(java.lang.Object obj_)
enqueue in class ActiveQueuepublic java.lang.Object dequeue()
dequeue in class ActiveQueuepublic java.lang.Object peekAt(int pos_)
peekAt in class ActiveQueuepublic java.lang.Object firstElement()
firstElement in class ActiveQueuepublic java.lang.Object lastElement()
lastElement in class ActiveQueuepublic boolean isFull()
isFull in class ActiveQueuepublic boolean isEmpty()
isEmpty in class ActiveQueuepublic void setCapacity(int capacity_)
setCapacity in class Queuecapacity_ - the new capacity.public int getCapacity()
getCapacity in class Queuepublic int getSize()
getSize in class Queuepublic void setDropHeadEnabled(boolean enabled_)
public boolean isDropHeadEnabled()
|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||