|
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.MQueue
MQueue is an m-level queue generalized from RIO and
3-Color queue. Specifically, it is a FIFO queue with m queue
logics, one for each level. The level-0 queue is the highest level queue
while the level-(m-1) queue is 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. If the packet can
be enqueued in that level (permitted by the corresponding queue logic),
the packet is also enqueued to all the queues of lower levels without being
rejected. Dequeuing follows FIFO, the dequeued packet is also dequeued from
the queues of its (classified) level and all the lower levels.
The component exports an error 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 | |
MQueue()
|
|
MQueue(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. |
PktClassifier |
getClassifier()
|
QLogic |
getQLogic(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 c)
|
void |
setDropHeadEnabled(boolean enabled_)
|
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 MQueue()
public MQueue(java.lang.String id_)
| Method Detail |
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 int classify(Packet p_)
PktClassifier.classify(drcl.net.Packet).
It simply return the first bit of the ToS field of the INET header.
classify in interface PktClassifierpublic void setClassifier(PktClassifier c)
public PktClassifier getClassifier()
public void setQLogic(int level_,
QLogic qlogic_)
level_ - level index of the queue logic.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 | ||||||||||