INET Framework for OMNeT++/OMNEST
inet::queueing::PacketQueue Class Reference

#include <PacketQueue.h>

Inheritance diagram for inet::queueing::PacketQueue:
inet::queueing::PacketQueueBase inet::queueing::IPacketBuffer::ICallback inet::queueing::PacketProcessorBase inet::queueing::IPacketQueue inet::queueing::IPacketProcessor inet::StringFormat::IDirectiveResolver inet::queueing::IPacketCollection inet::queueing::IPassivePacketSink inet::queueing::IPassivePacketSource inet::queueing::InProgressQueue

Public Member Functions

virtual ~PacketQueue ()
 
virtual int getMaxNumPackets () const override
 Returns maximum allowed number of packets in the collection. More...
 
virtual int getNumPackets () const override
 Returns the number of available packets in the collection in the range [0, inf). More...
 
virtual b getMaxTotalLength () const override
 Returns maximum allowed total length of all packets in the collection. More...
 
virtual b getTotalLength () const override
 Returns the total length of all packets in the collection in the range [0, inf). More...
 
virtual bool isEmpty () const override
 Returns true if there are no packets available in the collection. More...
 
virtual PacketgetPacket (int index) const override
 Returns the packet at the given index. More...
 
virtual void removePacket (Packet *packet) override
 Removes a packet from the collection. More...
 
virtual void removeAllPackets () override
 Removes all packets from the collection. More...
 
virtual bool supportsPacketPushing (cGate *gate) const override
 Returns true if the processor supports pushing packets at the given gate. More...
 
virtual bool canPushSomePacket (cGate *gate) const override
 Returns false if the packet sink is full at the given gate and no more packets can be pushed into it without raising an error. More...
 
virtual bool canPushPacket (Packet *packet, cGate *gate) const override
 Returns true if the given packet can be pushed at the given gate into the packet sink without raising an error. More...
 
virtual void pushPacket (Packet *packet, cGate *gate) override
 Pushes the packet into the packet sink at the given gate. More...
 
virtual bool supportsPacketPulling (cGate *gate) const override
 Returns true if the processor supports pulling packets at the given gate. More...
 
virtual bool canPullSomePacket (cGate *gate) const override
 Returns false if the packet source is empty at the given gate and no more packets can be pulled from it without raising an error. More...
 
virtual PacketcanPullPacket (cGate *gate) const override
 Returns the packet that can be pulled at the given gate. More...
 
virtual PacketpullPacket (cGate *gate) override
 Pulls the packet from the packet source at the given gate. More...
 
virtual void handlePacketRemoved (Packet *packet) override
 Notifies the packet owner about the packet being removed from the buffer. More...
 
- Public Member Functions inherited from inet::queueing::PacketQueueBase
virtual void enqueuePacket (Packet *packet) override
 Enqueues the packet into the packet queue. More...
 
virtual PacketdequeuePacket () override
 Dequeues the packet from the packet queue. More...
 
virtual void pushPacketStart (Packet *packet, cGate *gate, bps datarate) override
 Starts pushing the packet into the packet sink at the given gate. More...
 
virtual void pushPacketEnd (Packet *packet, cGate *gate) override
 Ends pushing the packet into the packet sink at the given gate. More...
 
virtual void pushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength=b(0)) override
 Progresses pushing the packet into the packet sink at the given gate. More...
 
virtual PacketpullPacketStart (cGate *gate, bps datarate) override
 Starts pulling the packet from the packet source at the given gate. More...
 
virtual PacketpullPacketEnd (cGate *gate) override
 Ends pulling the packet from the packet source at the given gate. More...
 
virtual PacketpullPacketProgress (cGate *gate, bps datarate, b position, b extraProcessableLength) override
 Progresses pulling the packet from the packet source at the given gate. More...
 
- Public Member Functions inherited from inet::queueing::PacketProcessorBase
virtual bool supportsPacketSending (cGate *gate) const override
 Returns true if the processor supports sending packets at the given gate. More...
 
virtual bool supportsPacketPassing (cGate *gate) const override
 Returns true if the processor supports passing packets as a whole at the given gate. More...
 
virtual bool supportsPacketStreaming (cGate *gate) const override
 Returns true if the processor supports streaming packets at the given gate. More...
 
- Public Member Functions inherited from inet::queueing::IPacketProcessor
virtual ~IPacketProcessor ()
 
- Public Member Functions inherited from inet::queueing::IPassivePacketSink
virtual ~IPassivePacketSink ()
 
- Public Member Functions inherited from inet::queueing::IPassivePacketSource
virtual ~IPassivePacketSource ()
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual IPacketDropperFunctioncreateDropperFunction (const char *dropperClass) const
 
virtual IPacketComparatorFunctioncreateComparatorFunction (const char *comparatorClass) const
 
virtual bool isOverloaded () const
 
- Protected Member Functions inherited from inet::queueing::PacketQueueBase
virtual void handleMessage (cMessage *message) override
 
virtual void emit (simsignal_t signal, cObject *object, cObject *details=nullptr) override
 
virtual const char * resolveDirective (char directive) const override
 
- Protected Member Functions inherited from inet::queueing::PacketProcessorBase
virtual int numInitStages () const override
 
virtual void refreshDisplay () const override
 
virtual void handlePacketProcessed (Packet *packet)
 
virtual void checkPacketOperationSupport (cGate *gate) const
 
virtual void checkPacketOperationSupport (cGate *startGate, cGate *endGate) const
 
virtual void animate (Packet *packet, cGate *gate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacket (Packet *packet, cGate *gate, Action action) const
 
virtual void animatePacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId, Action action) const
 
virtual void animatePacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacketEnd (Packet *packet, cGate *gate, long transmissionId, Action action) const
 
virtual void animatePacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId, Action action) const
 
virtual void animatePacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions, Action action) const
 
virtual void pushOrSendPacket (Packet *packet, cGate *gate, IPassivePacketSink *consumer)
 
virtual void pushOrSendPacketStart (Packet *packet, cGate *gate, IPassivePacketSink *consumer, bps datarate, int transmissionId)
 
virtual void pushOrSendPacketEnd (Packet *packet, cGate *gate, IPassivePacketSink *consumer, int transmissionId)
 
virtual void pushOrSendPacketProgress (Packet *packet, cGate *gate, IPassivePacketSink *consumer, bps datarate, b position, b extraProcessableLength, int transmissionId)
 
virtual void animatePush (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePushPacket (Packet *packet, cGate *gate) const
 
virtual void animatePushPacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId) const
 
virtual void animatePushPacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions) const
 
virtual void animatePushPacketEnd (Packet *packet, cGate *gate, long transmissionId) const
 
virtual void animatePushPacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId) const
 
virtual void animatePushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions) const
 
virtual void animatePull (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePullPacket (Packet *packet, cGate *gate) const
 
virtual void animatePullPacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId) const
 
virtual void animatePullPacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions) const
 
virtual void animatePullPacketEnd (Packet *packet, cGate *gate, long transmissionId) const
 
virtual void animatePullPacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePullPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId) const
 
virtual void animatePullPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions) const
 
virtual void dropPacket (Packet *packet, PacketDropReason reason, int limit=-1)
 
virtual void updateDisplayString () const
 

Protected Attributes

int packetCapacity = -1
 
b dataCapacity = b(-1)
 
IActivePacketSourceproducer = nullptr
 
IActivePacketSinkcollector = nullptr
 
cPacketQueue queue
 
IPacketBufferbuffer = nullptr
 
IPacketDropperFunctionpacketDropperFunction = nullptr
 
IPacketComparatorFunctionpacketComparatorFunction = nullptr
 
- Protected Attributes inherited from inet::queueing::PacketQueueBase
int numPushedPackets = -1
 
int numPulledPackets = -1
 
int numRemovedPackets = -1
 
int numDroppedPackets = -1
 
int numCreatedPackets = -1
 
cGate * inputGate = nullptr
 
cGate * outputGate = nullptr
 
- Protected Attributes inherited from inet::queueing::PacketProcessorBase
const char * displayStringTextFormat = nullptr
 
int numProcessedPackets = -1
 
b processedTotalLength = b(-1)
 

Additional Inherited Members

- Protected Types inherited from inet::queueing::PacketProcessorBase
enum  Action { PUSH, PULL }
 

Constructor & Destructor Documentation

◆ ~PacketQueue()

virtual inet::queueing::PacketQueue::~PacketQueue ( )
inlinevirtual
45 { delete packetDropperFunction; }

Member Function Documentation

◆ canPullPacket()

virtual Packet* inet::queueing::PacketQueue::canPullPacket ( cGate *  gate) const
inlineoverridevirtual

Returns the packet that can be pulled at the given gate.

The returned value is nullptr if there is no such packet.

The gate must be a valid gate of this module and it must support pushing packets.

Implements inet::queueing::IPassivePacketSource.

65 { return !isEmpty() ? getPacket(0) : nullptr; }

◆ canPullSomePacket()

virtual bool inet::queueing::PacketQueue::canPullSomePacket ( cGate *  gate) const
inlineoverridevirtual

Returns false if the packet source is empty at the given gate and no more packets can be pulled from it without raising an error.

The gate must be a valid gate of this module and it must support pulling packets.

Reimplemented from inet::queueing::PacketQueueBase.

64 { return !isEmpty(); }

◆ canPushPacket()

bool inet::queueing::PacketQueue::canPushPacket ( Packet packet,
cGate *  gate 
) const
overridevirtual

Returns true if the given packet can be pushed at the given gate into the packet sink without raising an error.

The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing packets.

Implements inet::queueing::IPassivePacketSink.

Reimplemented in inet::queueing::InProgressQueue.

169 {
171  return true;
172  if (getMaxNumPackets() != -1 && getNumPackets() >= getMaxNumPackets())
173  return false;
174  if (getMaxTotalLength() != b(-1) && getMaxTotalLength() - getTotalLength() < packet->getDataLength())
175  return false;
176  return true;
177 }

◆ canPushSomePacket()

bool inet::queueing::PacketQueue::canPushSomePacket ( cGate *  gate) const
overridevirtual

Returns false if the packet sink is full at the given gate and no more packets can be pushed into it without raising an error.

The gate must be a valid gate of this module and it must support pushing packets.

Reimplemented from inet::queueing::PacketQueueBase.

Reimplemented in inet::queueing::InProgressQueue.

158 {
160  return true;
161  if (getMaxNumPackets() != -1 && getNumPackets() >= getMaxNumPackets())
162  return false;
163  if (getMaxTotalLength() != b(-1) && getTotalLength() >= getMaxTotalLength())
164  return false;
165  return true;
166 }

◆ createComparatorFunction()

IPacketComparatorFunction * inet::queueing::PacketQueue::createComparatorFunction ( const char *  comparatorClass) const
protectedvirtual
56 {
57  if (strlen(comparatorClass) == 0)
58  return nullptr;
59  else
60  return check_and_cast<IPacketComparatorFunction *>(createOne(comparatorClass));
61 }

Referenced by initialize().

◆ createDropperFunction()

IPacketDropperFunction * inet::queueing::PacketQueue::createDropperFunction ( const char *  dropperClass) const
protectedvirtual
48 {
49  if (strlen(dropperClass) == 0)
50  return nullptr;
51  else
52  return check_and_cast<IPacketDropperFunction *>(createOne(dropperClass));
53 }

Referenced by initialize().

◆ getMaxNumPackets()

virtual int inet::queueing::PacketQueue::getMaxNumPackets ( ) const
inlineoverridevirtual

Returns maximum allowed number of packets in the collection.

The value -1 means no such limit.

Implements inet::queueing::IPacketCollection.

47 { return packetCapacity; }

Referenced by canPushPacket(), and canPushSomePacket().

◆ getMaxTotalLength()

virtual b inet::queueing::PacketQueue::getMaxTotalLength ( ) const
inlineoverridevirtual

Returns maximum allowed total length of all packets in the collection.

The value -1 means no such limit.

Implements inet::queueing::IPacketCollection.

50 { return dataCapacity; }

Referenced by canPushPacket(), and canPushSomePacket().

◆ getNumPackets()

int inet::queueing::PacketQueue::getNumPackets ( ) const
overridevirtual

Returns the number of available packets in the collection in the range [0, inf).

Implements inet::queueing::IPacketCollection.

70 {
71  return queue.getLength();
72 }

Referenced by canPushPacket(), canPushSomePacket(), isOverloaded(), pullPacket(), pushPacket(), and removeAllPackets().

◆ getPacket()

Packet * inet::queueing::PacketQueue::getPacket ( int  index) const
overridevirtual

Returns the packet at the given index.

Throws error when the index is out of range.

Implements inet::queueing::IPacketCollection.

75 {
76  if (index < 0 || index >= queue.getLength())
77  throw cRuntimeError("index %i out of range", index);
78  return check_and_cast<Packet *>(queue.get(index));
79 }

Referenced by inet::queueing::InProgressQueue::canPushPacket().

◆ getTotalLength()

virtual b inet::queueing::PacketQueue::getTotalLength ( ) const
inlineoverridevirtual

Returns the total length of all packets in the collection in the range [0, inf).

Implements inet::queueing::IPacketCollection.

51 { return b(queue.getBitLength()); }

Referenced by canPushPacket(), canPushSomePacket(), isOverloaded(), and pullPacket().

◆ handlePacketRemoved()

void inet::queueing::PacketQueue::handlePacketRemoved ( Packet packet)
overridevirtual

Notifies the packet owner about the packet being removed from the buffer.

The packet is never nullptr.

Implements inet::queueing::IPacketBuffer::ICallback.

180 {
181  Enter_Method("handlePacketRemoved");
182  if (queue.contains(packet)) {
183  EV_INFO << "Removing packet" << EV_FIELD(packet) << EV_ENDL;
184  queue.remove(packet);
185  emit(packetRemovedSignal, packet);
187  }
188 }

◆ initialize()

void inet::queueing::PacketQueue::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::queueing::PacketQueueBase.

23 {
25  if (stage == INITSTAGE_LOCAL) {
26  queue.setName("storage");
27  producer = findConnectedModule<IActivePacketSource>(inputGate);
28  collector = findConnectedModule<IActivePacketSink>(outputGate);
29  packetCapacity = par("packetCapacity");
30  dataCapacity = b(par("dataCapacity"));
31  buffer = findModuleFromPar<IPacketBuffer>(par("bufferModule"), this);
32  packetComparatorFunction = createComparatorFunction(par("comparatorClass"));
33  if (packetComparatorFunction != nullptr)
35  packetDropperFunction = createDropperFunction(par("dropperClass"));
36  }
37  else if (stage == INITSTAGE_QUEUEING) {
40  if (producer != nullptr)
41  producer->handleCanPushPacketChanged(inputGate->getPathStartGate());
42  }
43  else if (stage == INITSTAGE_LAST)
45 }

◆ isEmpty()

virtual bool inet::queueing::PacketQueue::isEmpty ( ) const
inlineoverridevirtual

Returns true if there are no packets available in the collection.

Implements inet::queueing::IPacketCollection.

53 { return getNumPackets() == 0; }

◆ isOverloaded()

bool inet::queueing::PacketQueue::isOverloaded ( ) const
protectedvirtual
64 {
65  return (packetCapacity != -1 && getNumPackets() > packetCapacity) ||
66  (dataCapacity != b(-1) && getTotalLength() > dataCapacity);
67 }

Referenced by pushPacket().

◆ pullPacket()

Packet * inet::queueing::PacketQueue::pullPacket ( cGate *  gate)
overridevirtual

Pulls the packet from the packet source at the given gate.

This operation pulls the packet as a whole. The onwership of the packet is transferred to the sink.

The source must not be empty at the given gate. The returned packet must not be nullptr. The gate must be a valid gate of this module and it must support pulling and passing packets.

Implements inet::queueing::IPassivePacketSource.

108 {
109  Enter_Method("pullPacket");
110  auto packet = check_and_cast<Packet *>(queue.front());
111  EV_INFO << "Pulling packet" << EV_FIELD(packet) << EV_ENDL;
112  if (buffer != nullptr) {
113  queue.remove(packet);
114  buffer->removePacket(packet);
115  }
116  else
117  queue.pop();
118  auto queueingTime = simTime() - packet->getArrivalTime();
119  auto packetEvent = new PacketQueuedEvent();
120  packetEvent->setQueuePacketLength(getNumPackets());
121  packetEvent->setQueueDataLength(getTotalLength());
122  insertPacketEvent(this, packet, PEK_QUEUED, queueingTime, packetEvent);
123  increaseTimeTag<QueueingTimeTag>(packet, queueingTime, queueingTime);
124  emit(packetPulledSignal, packet);
125  animatePullPacket(packet, outputGate);
127  return packet;
128 }

◆ pushPacket()

void inet::queueing::PacketQueue::pushPacket ( Packet packet,
cGate *  gate 
)
overridevirtual

Pushes the packet into the packet sink at the given gate.

This operation pushes the packet as a whole. The onwership of the packet is transferred to the sink.

This method is called, for example, when a packet source module pushes a packet into a queue module.

The sink must not be full at the gate. The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing and passing packets.

Implements inet::queueing::IPassivePacketSink.

82 {
83  Enter_Method("pushPacket");
84  take(packet);
85  cNamedObject packetPushStartedDetails("atomicOperationStarted");
86  emit(packetPushStartedSignal, packet, &packetPushStartedDetails);
87  EV_INFO << "Pushing packet" << EV_FIELD(packet) << EV_ENDL;
88  queue.insert(packet);
89  if (buffer != nullptr)
90  buffer->addPacket(packet);
91  else if (packetDropperFunction != nullptr) {
92  while (isOverloaded()) {
93  auto packet = packetDropperFunction->selectPacket(this);
94  EV_INFO << "Dropping packet" << EV_FIELD(packet) << EV_ENDL;
95  queue.remove(packet);
96  dropPacket(packet, QUEUE_OVERFLOW);
97  }
98  }
99  ASSERT(!isOverloaded());
100  if (collector != nullptr && getNumPackets() != 0)
101  collector->handleCanPullPacketChanged(outputGate->getPathEndGate());
102  cNamedObject packetPushEndedDetails("atomicOperationEnded");
103  emit(packetPushEndedSignal, nullptr, &packetPushEndedDetails);
105 }

◆ removeAllPackets()

void inet::queueing::PacketQueue::removeAllPackets ( )
overridevirtual

Removes all packets from the collection.

Implements inet::queueing::IPacketCollection.

142 {
143  Enter_Method("removeAllPackets");
144  EV_INFO << "Removing all packets" << EV_ENDL;
145  std::vector<Packet *> packets;
146  for (int i = 0; i < getNumPackets(); i++)
147  packets.push_back(check_and_cast<Packet *>(queue.pop()));
148  if (buffer != nullptr)
150  for (auto packet : packets) {
151  emit(packetRemovedSignal, packet);
152  delete packet;
153  }
155 }

◆ removePacket()

void inet::queueing::PacketQueue::removePacket ( Packet packet)
overridevirtual

Removes a packet from the collection.

The collection must contain the packet.

Implements inet::queueing::IPacketCollection.

131 {
132  Enter_Method("removePacket");
133  EV_INFO << "Removing packet" << EV_FIELD(packet) << EV_ENDL;
134  queue.remove(packet);
135  if (buffer != nullptr)
136  buffer->removePacket(packet);
137  emit(packetRemovedSignal, packet);
139 }

◆ supportsPacketPulling()

virtual bool inet::queueing::PacketQueue::supportsPacketPulling ( cGate *  gate) const
inlineoverridevirtual

Returns true if the processor supports pulling packets at the given gate.

Pulling a packet is a synchronous operation that is initiated by the sink module. A pulled packet can be passed as a whole using pullPacket(), or it can be streamed from the source to the sink using pullPacketStart(), pullPacketEnd(), and pullPacketProgress().

For output gates, true means that the connected module can pull packets from this module. For input gates, true means that this module can pull packets from the connected module. For example, a packet server module can pull packets from a queue module.

Connecting incompatible gates raises an error during initialize. The gate parameter must be a valid gate of this module. The gate should be marked with @labels(pull) in the NED file.

Implements inet::queueing::IPacketProcessor.

63 { return outputGate == gate; }

◆ supportsPacketPushing()

virtual bool inet::queueing::PacketQueue::supportsPacketPushing ( cGate *  gate) const
inlineoverridevirtual

Returns true if the processor supports pushing packets at the given gate.

Pushing a packet is a synchronous operation that is initiated by the source module. A pushed packet can be passed as a whole using pushPacket(), or it can be streamed from the source to the sink using pushPacketStart(), pushPacketEnd(), and pushPacketProgress().

For output gates, true means that this module can push packets into the connected module. For input gates, true means that the connected module can push packets into this module. For example, a packet generator module can push packets into a queue module.

Connecting incompatible gates raises an error during initialize. The gate parameter must be a valid gate of this module. The gate should be marked with @labels(push) in the NED file.

Implements inet::queueing::IPacketProcessor.

58 { return inputGate == gate; }

Member Data Documentation

◆ buffer

IPacketBuffer* inet::queueing::PacketQueue::buffer = nullptr
protected

◆ collector

IActivePacketSink* inet::queueing::PacketQueue::collector = nullptr
protected

Referenced by initialize(), and pushPacket().

◆ dataCapacity

b inet::queueing::PacketQueue::dataCapacity = b(-1)
protected

Referenced by initialize(), and isOverloaded().

◆ packetCapacity

int inet::queueing::PacketQueue::packetCapacity = -1
protected

Referenced by initialize(), and isOverloaded().

◆ packetComparatorFunction

IPacketComparatorFunction* inet::queueing::PacketQueue::packetComparatorFunction = nullptr
protected

◆ packetDropperFunction

IPacketDropperFunction* inet::queueing::PacketQueue::packetDropperFunction = nullptr
protected

◆ producer

IActivePacketSource* inet::queueing::PacketQueue::producer = nullptr
protected

Referenced by initialize().

◆ queue


The documentation for this class was generated from the following files:
inet::queueing::PacketQueue::getMaxTotalLength
virtual b getMaxTotalLength() const override
Returns maximum allowed total length of all packets in the collection.
Definition: PacketQueue.h:50
inet::queueing::PacketQueue::createComparatorFunction
virtual IPacketComparatorFunction * createComparatorFunction(const char *comparatorClass) const
Definition: PacketQueue.cc:55
inet::INITSTAGE_LAST
INET_API InitStage INITSTAGE_LAST
Operations that no other initializations can depend on, e.g.
inet::queueing::PacketQueue::packetCapacity
int packetCapacity
Definition: PacketQueue.h:24
inet::queueing::PacketQueue::collector
IActivePacketSink * collector
Definition: PacketQueue.h:28
inet::queueing::PacketProcessorBase::animatePullPacket
virtual void animatePullPacket(Packet *packet, cGate *gate) const
Definition: PacketProcessorBase.cc:355
inet::queueing::PacketQueue::dataCapacity
b dataCapacity
Definition: PacketQueue.h:25
inet::queueing::IPacketBuffer::addPacket
virtual void addPacket(Packet *packet)=0
Adds the packet to the buffer.
inet::INITSTAGE_QUEUEING
INET_API InitStage INITSTAGE_QUEUEING
Initialization of queueing modules.
inet::packetRemovedSignal
simsignal_t packetRemovedSignal
Definition: Simsignals.cc:84
inet::queueing::PacketQueue::buffer
IPacketBuffer * buffer
Definition: PacketQueue.h:31
inet::packetPulledSignal
simsignal_t packetPulledSignal
Definition: Simsignals.cc:105
inet::queueing::PacketQueue::getPacket
virtual Packet * getPacket(int index) const override
Returns the packet at the given index.
Definition: PacketQueue.cc:74
inet::queueing::PacketQueue::createDropperFunction
virtual IPacketDropperFunction * createDropperFunction(const char *dropperClass) const
Definition: PacketQueue.cc:47
inet::utils::createOne
cObject * createOne(const char *className, const char *defaultNamespace)
Like cObjectFactory::createOne(), except it starts searching for the class in the given namespace.
Definition: INETUtils.cc:147
inet::queueing::PacketQueue::isEmpty
virtual bool isEmpty() const override
Returns true if there are no packets available in the collection.
Definition: PacketQueue.h:53
inet::packetPushStartedSignal
simsignal_t packetPushStartedSignal
Definition: Simsignals.cc:102
inet::queueing::IPacketCollection::removeAllPackets
virtual void removeAllPackets()=0
Removes all packets from the collection.
inet::queueing::PacketQueueBase::emit
virtual void emit(simsignal_t signal, cObject *object, cObject *details=nullptr) override
Definition: PacketQueueBase.cc:53
inet::QUEUE_OVERFLOW
@ QUEUE_OVERFLOW
Definition: Simsignals_m.h:77
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::queueing::PacketQueue::isOverloaded
virtual bool isOverloaded() const
Definition: PacketQueue.cc:63
inet::queueing::PacketProcessorBase::dropPacket
virtual void dropPacket(Packet *packet, PacketDropReason reason, int limit=-1)
Definition: PacketProcessorBase.cc:390
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::queueing::IActivePacketSource::handleCanPushPacketChanged
virtual void handleCanPushPacketChanged(cGate *gate)=0
Notifies about a change in the possibility of pushing some packet into the passive packet sink at the...
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::queueing::PacketQueue::getNumPackets
virtual int getNumPackets() const override
Returns the number of available packets in the collection in the range [0, inf).
Definition: PacketQueue.cc:69
inet::queueing::PacketQueue::packetComparatorFunction
IPacketComparatorFunction * packetComparatorFunction
Definition: PacketQueue.h:34
inet::queueing::IPacketDropperFunction::selectPacket
virtual Packet * selectPacket(IPacketCollection *collection) const =0
Returns a packet to be dropped from the collection.
inet::queueing::PacketProcessorBase::updateDisplayString
virtual void updateDisplayString() const
Definition: PacketProcessorBase.cc:399
inet::queueing::PacketQueue::getTotalLength
virtual b getTotalLength() const override
Returns the total length of all packets in the collection in the range [0, inf).
Definition: PacketQueue.h:51
inet::queueing::PacketProcessorBase::checkPacketOperationSupport
virtual void checkPacketOperationSupport(cGate *gate) const
Definition: PacketProcessorBase.cc:40
inet::queueing::PacketQueueBase::outputGate
cGate * outputGate
Definition: PacketQueueBase.h:27
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::queueing::IPacketBuffer::removePacket
virtual void removePacket(Packet *packet)=0
Removes the packet from the buffer.
inet::queueing::PacketQueue::getMaxNumPackets
virtual int getMaxNumPackets() const override
Returns maximum allowed number of packets in the collection.
Definition: PacketQueue.h:47
inet::queueing::PacketQueue::queue
cPacketQueue queue
Definition: PacketQueue.h:30
inet::queueing::PacketQueueBase::inputGate
cGate * inputGate
Definition: PacketQueueBase.h:26
inet::queueing::PacketQueue::packetDropperFunction
IPacketDropperFunction * packetDropperFunction
Definition: PacketQueue.h:33
inet::queueing::PacketQueue::producer
IActivePacketSource * producer
Definition: PacketQueue.h:27
EV_ENDL
#define EV_ENDL
Definition: INETDefs.h:114
inet::insertPacketEvent
void insertPacketEvent(const cModule *module, Packet *packet, int kind, simtime_t duration, PacketEvent *packetEvent)
Definition: PacketEventTag.cc:12
inet::queueing::PacketQueueBase::initialize
virtual void initialize(int stage) override
Definition: PacketQueueBase.cc:16
inet::PEK_QUEUED
@ PEK_QUEUED
Definition: PacketEventTag_m.h:66
inet::packetPushEndedSignal
simsignal_t packetPushEndedSignal
Definition: Simsignals.cc:103
inet::queueing::IActivePacketSink::handleCanPullPacketChanged
virtual void handleCanPullPacketChanged(cGate *gate)=0
Notifies about a change in the possibility of pulling some packet from the passive packet source at t...