INET Framework for OMNeT++/OMNEST
inet::ThresholdDropper Class Reference

Drops packets above threshold. More...

#include <ThresholdDropper.h>

Inheritance diagram for inet::ThresholdDropper:
inet::AlgorithmicDropperBase inet::IQueueAccess

Protected Member Functions

virtual void initialize () override
 
virtual bool shouldDrop (cPacket *packet) override
 
- Protected Member Functions inherited from inet::AlgorithmicDropperBase
virtual void handleMessage (cMessage *msg) override
 
virtual void dropPacket (cPacket *packet)
 
virtual void sendOut (cPacket *packet)
 
virtual int getLength () const override
 Returns the number of frames in the queue. More...
 
virtual int getByteLength () const override
 Returns the number of bytes in the queue. More...
 

Protected Attributes

int frameCapacity
 
int byteCapacity
 
- Protected Attributes inherited from inet::AlgorithmicDropperBase
int numGates
 
std::vector< IQueueAccess * > outQueues
 
std::set< IQueueAccess * > outQueueSet
 

Additional Inherited Members

- Public Member Functions inherited from inet::AlgorithmicDropperBase
 AlgorithmicDropperBase ()
 
virtual ~AlgorithmicDropperBase ()
 
- Public Member Functions inherited from inet::IQueueAccess
virtual ~IQueueAccess ()
 

Detailed Description

Drops packets above threshold.

Resources can be shared amongst multiple queues.

Member Function Documentation

void inet::ThresholdDropper::initialize ( )
overrideprotectedvirtual

Reimplemented from inet::AlgorithmicDropperBase.

26 {
28 
29  frameCapacity = par("frameCapacity");
30  byteCapacity = par("byteCapacity");
31 }
int byteCapacity
Definition: ThresholdDropper.h:35
int frameCapacity
Definition: ThresholdDropper.h:34
virtual void initialize() override
Definition: AlgorithmicDropperBase.cc:23
bool inet::ThresholdDropper::shouldDrop ( cPacket *  packet)
overrideprotectedvirtual

Implements inet::AlgorithmicDropperBase.

34 {
35  if (frameCapacity >= 0 && (getLength() + 1) > frameCapacity)
36  return true;
37  if (byteCapacity >= 0 && (getByteLength() + packet->getByteLength()) > byteCapacity)
38  return true;
39  return false;
40 }
int byteCapacity
Definition: ThresholdDropper.h:35
virtual int getByteLength() const override
Returns the number of bytes in the queue.
Definition: AlgorithmicDropperBase.cc:68
int frameCapacity
Definition: ThresholdDropper.h:34
virtual int getLength() const override
Returns the number of frames in the queue.
Definition: AlgorithmicDropperBase.cc:60

Member Data Documentation

int inet::ThresholdDropper::byteCapacity
protected

Referenced by initialize(), and shouldDrop().

int inet::ThresholdDropper::frameCapacity
protected

Referenced by initialize(), and shouldDrop().


The documentation for this class was generated from the following files: