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

#include <PacketQueue.h>

Inheritance diagram for inet::PacketQueue:

Public Member Functions

 PacketQueue (const char *name=nullptr)
 
virtual void insert (cPacket *packet)
 
virtual void insertBefore (cPacket *where, cPacket *packet)
 
virtual void insertAfter (cPacket *where, cPacket *packet)
 
virtual int getMaxPacketLength ()
 
virtual void setMaxPacketLength (int maxPacketLength)
 
virtual int64_t getMaxBitLength ()
 
virtual void setMaxBitLength (int64_t maxBitLength)
 

Protected Member Functions

void checkInsertion (cPacket *packet)
 

Protected Attributes

int maxPacketLength = -1
 
int64_t maxBitLength = -1
 

Constructor & Destructor Documentation

inet::PacketQueue::PacketQueue ( const char *  name = nullptr)
22  :
23  cPacketQueue(name, nullptr)
24 {
25 }

Member Function Documentation

void inet::PacketQueue::checkInsertion ( cPacket *  packet)
protected

Referenced by insert(), insertAfter(), and insertBefore().

28 {
29  if ((maxPacketLength != -1 && getLength() == maxPacketLength) ||
30  (maxBitLength != -1 && getBitLength() + packet->getBitLength() > maxBitLength))
31  throw cRuntimeError("Queue is full");
32 }
int64_t maxBitLength
Definition: PacketQueue.h:29
int maxPacketLength
Definition: PacketQueue.h:28
virtual int64_t inet::PacketQueue::getMaxBitLength ( )
inlinevirtual
44 { return maxBitLength; }
int64_t maxBitLength
Definition: PacketQueue.h:29
virtual int inet::PacketQueue::getMaxPacketLength ( )
inlinevirtual

Referenced by inet::visualizer::QueueCanvasVisualizer::createQueueVisualization().

41 { return maxPacketLength; }
int maxPacketLength
Definition: PacketQueue.h:28
void inet::PacketQueue::insert ( cPacket *  packet)
virtual

Referenced by inet::CsmaCaMac::handleUpperPacket().

35 {
36  checkInsertion(packet);
37  cQueue::insert(packet);
38 }
void insert(std::vector< T > &v, int pos, const T &a)
Definition: stlutils.h:79
void checkInsertion(cPacket *packet)
Definition: PacketQueue.cc:27
void inet::PacketQueue::insertAfter ( cPacket *  where,
cPacket *  packet 
)
virtual
47 {
48  checkInsertion(packet);
49  cQueue::insertAfter(where, packet);
50 }
void checkInsertion(cPacket *packet)
Definition: PacketQueue.cc:27
void inet::PacketQueue::insertBefore ( cPacket *  where,
cPacket *  packet 
)
virtual
41 {
42  checkInsertion(packet);
43  cQueue::insertBefore(where, packet);
44 }
void checkInsertion(cPacket *packet)
Definition: PacketQueue.cc:27
virtual void inet::PacketQueue::setMaxBitLength ( int64_t  maxBitLength)
inlinevirtual
45 { this->maxBitLength = maxBitLength; }
int64_t maxBitLength
Definition: PacketQueue.h:29
virtual void inet::PacketQueue::setMaxPacketLength ( int  maxPacketLength)
inlinevirtual

Referenced by inet::CsmaCaMac::initialize().

int maxPacketLength
Definition: PacketQueue.h:28

Member Data Documentation

int64_t inet::PacketQueue::maxBitLength = -1
protected

Referenced by checkInsertion().

int inet::PacketQueue::maxPacketLength = -1
protected

Referenced by checkInsertion().


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