INET Framework for OMNeT++/OMNEST
|
Base class for packet schedulers. More...
#include <SchedulerBase.h>
Public Member Functions | |
SchedulerBase () | |
virtual | ~SchedulerBase () |
virtual void | requestPacket () override |
The queue should send a packet whenever this method is invoked. More... | |
virtual int | getNumPendingRequests () override |
Returns number of pending requests. More... | |
virtual bool | isEmpty () override |
Return true when queue is empty, otherwise return false. More... | |
virtual void | clear () override |
Clear all queued packets and stored requests. More... | |
virtual cMessage * | pop () override |
Returns a packet directly from the queue, bypassing the primary, send-on-request mechanism. More... | |
virtual void | packetEnqueued (IPassiveQueue *inputQueue) override |
A packet arrived and it was added to the queue (the queue length increased by one). More... | |
virtual void | addListener (IPassiveQueueListener *listener) override |
Adds a new listener to the listener list. More... | |
virtual void | removeListener (IPassiveQueueListener *listener) override |
Removes a listener from the listener list. More... | |
Public Member Functions inherited from inet::IPassiveQueue | |
virtual | ~IPassiveQueue () |
Public Member Functions inherited from inet::IPassiveQueueListener | |
virtual | ~IPassiveQueueListener () |
Protected Member Functions | |
virtual void | initialize () override |
virtual void | finalize () |
virtual void | handleMessage (cMessage *msg) override |
virtual void | sendOut (cMessage *msg) |
virtual void | notifyListeners () |
virtual bool | schedulePacket ()=0 |
Protected Attributes | |
int | packetsRequestedFromUs |
int | packetsToBeRequestedFromInputs |
std::vector< IPassiveQueue * > | inputQueues |
cGate * | outGate |
std::list< IPassiveQueueListener * > | listeners |
Base class for packet schedulers.
Schedulers are attached to the 'out' end of queues and decide from which queue a packet needs to be dequeued.
Schedulers behave as passive queues (they provide a view for the actual queues behind them), and can be cascaded. They must be able to notice when a new packet arrives at one of their inputs without dequeueing it, so they hook themselves as listeners on their inputs.
inet::SchedulerBase::SchedulerBase | ( | ) |
|
overridevirtual |
Adds a new listener to the listener list.
It does nothing, if the listener list already contains the listener (by pointer equality).
Implements inet::IPassiveQueue.
|
overridevirtual |
Clear all queued packets and stored requests.
Implements inet::IPassiveQueue.
|
protectedvirtual |
|
inlineoverridevirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Reimplemented in inet::WRRScheduler.
Referenced by inet::WRRScheduler::initialize().
|
overridevirtual |
Return true when queue is empty, otherwise return false.
Implements inet::IPassiveQueue.
Referenced by pop(), and inet::WRRScheduler::schedulePacket().
|
protectedvirtual |
Referenced by packetEnqueued().
|
overridevirtual |
A packet arrived and it was added to the queue (the queue length increased by one).
Therefore a subsequent requestPacket() call can deliver a packet immediately.
Implements inet::IPassiveQueueListener.
Referenced by notifyListeners().
|
overridevirtual |
Returns a packet directly from the queue, bypassing the primary, send-on-request mechanism.
Returns nullptr if the queue is empty.
Implements inet::IPassiveQueue.
|
overridevirtual |
Removes a listener from the listener list.
It does nothing if the listener was not found on the listener list.
Implements inet::IPassiveQueue.
Referenced by finalize().
|
overridevirtual |
The queue should send a packet whenever this method is invoked.
If the queue is currently empty, it should send a packet when when one becomes available.
Implements inet::IPassiveQueue.
|
protectedpure virtual |
Implemented in inet::WRRScheduler, and inet::PriorityScheduler.
Referenced by packetEnqueued(), and requestPacket().
|
protectedvirtual |
Referenced by handleMessage().
|
protected |
|
protected |
Referenced by addListener(), notifyListeners(), and removeListener().
|
protected |
Referenced by initialize(), and sendOut().
|
protected |
Referenced by clear(), handleMessage(), packetEnqueued(), and requestPacket().
|
protected |
Referenced by clear(), packetEnqueued(), and requestPacket().