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

#include <PacketBufferBase.h>

Inheritance diagram for inet::queueing::PacketBufferBase:
inet::queueing::PacketProcessorBase inet::queueing::IPacketCollection inet::queueing::IPacketProcessor inet::StringFormat::IDirectiveResolver inet::queueing::PacketBuffer

Protected Member Functions

virtual void initialize (int stage) 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 numAddedPackets = -1
 
int numRemovedPackets = -1
 
int numDroppedPackets = -1
 
- Protected Attributes inherited from inet::queueing::PacketProcessorBase
const char * displayStringTextFormat = nullptr
 
int numProcessedPackets = -1
 
b processedTotalLength = b(-1)
 

Additional Inherited Members

- 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 ()
 
virtual bool supportsPacketPushing (cGate *gate) const =0
 Returns true if the processor supports pushing packets at the given gate. More...
 
virtual bool supportsPacketPulling (cGate *gate) const =0
 Returns true if the processor supports pulling packets at the given gate. More...
 
- Public Member Functions inherited from inet::queueing::IPacketCollection
virtual int getMaxNumPackets () const =0
 Returns maximum allowed number of packets in the collection. More...
 
virtual int getNumPackets () const =0
 Returns the number of available packets in the collection in the range [0, inf). More...
 
virtual b getMaxTotalLength () const =0
 Returns maximum allowed total length of all packets in the collection. More...
 
virtual b getTotalLength () const =0
 Returns the total length of all packets in the collection in the range [0, inf). More...
 
virtual PacketgetPacket (int index) const =0
 Returns the packet at the given index. More...
 
virtual bool isEmpty () const =0
 Returns true if there are no packets available in the collection. More...
 
virtual void removePacket (Packet *packet)=0
 Removes a packet from the collection. More...
 
virtual void removeAllPackets ()=0
 Removes all packets from the collection. More...
 
- Protected Types inherited from inet::queueing::PacketProcessorBase
enum  Action { PUSH, PULL }
 

Member Function Documentation

◆ emit()

void inet::queueing::PacketBufferBase::emit ( simsignal_t  signal,
cObject *  object,
cObject *  details = nullptr 
)
overrideprotectedvirtual
31 {
32  if (signal == packetAddedSignal)
34  else if (signal == packetRemovedSignal)
36  else if (signal == packetDroppedSignal)
38  cSimpleModule::emit(signal, object, details);
39 }

Referenced by inet::queueing::PacketBuffer::addPacket(), inet::queueing::PacketBuffer::removeAllPackets(), and inet::queueing::PacketBuffer::removePacket().

◆ initialize()

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

Reimplemented from inet::queueing::PacketProcessorBase.

Reimplemented in inet::queueing::PacketBuffer.

17 {
19  if (stage == INITSTAGE_LOCAL) {
20  displayStringTextFormat = par("displayStringTextFormat");
21  numAddedPackets = 0;
24  WATCH(numAddedPackets);
25  WATCH(numRemovedPackets);
26  WATCH(numDroppedPackets);
27  }
28 }

Referenced by inet::queueing::PacketBuffer::initialize().

◆ resolveDirective()

const char * inet::queueing::PacketBufferBase::resolveDirective ( char  directive) const
overrideprotectedvirtual

Reimplemented from inet::queueing::PacketProcessorBase.

42 {
43  static std::string result;
44  switch (directive) {
45  case 'p':
46  result = std::to_string(getNumPackets());
47  break;
48  case 'l':
49  result = getTotalLength().str();
50  break;
51  case 'a':
52  result = std::to_string(numAddedPackets);
53  break;
54  case 'r':
55  result = std::to_string(numRemovedPackets);
56  break;
57  case 'd':
58  result = std::to_string(numDroppedPackets);
59  break;
60  default:
61  return PacketProcessorBase::resolveDirective(directive);
62  }
63  return result.c_str();
64 }

Member Data Documentation

◆ numAddedPackets

int inet::queueing::PacketBufferBase::numAddedPackets = -1
protected

Referenced by emit(), initialize(), and resolveDirective().

◆ numDroppedPackets

int inet::queueing::PacketBufferBase::numDroppedPackets = -1
protected

Referenced by emit(), initialize(), and resolveDirective().

◆ numRemovedPackets

int inet::queueing::PacketBufferBase::numRemovedPackets = -1
protected

Referenced by emit(), initialize(), and resolveDirective().


The documentation for this class was generated from the following files:
inet::queueing::PacketProcessorBase::initialize
virtual void initialize(int stage) override
Definition: PacketProcessorBase.cc:16
inet::queueing::PacketBufferBase::numRemovedPackets
int numRemovedPackets
Definition: PacketBufferBase.h:21
inet::units::value::str
std::string str() const
Definition: Units.h:101
inet::queueing::PacketBufferBase::numAddedPackets
int numAddedPackets
Definition: PacketBufferBase.h:20
inet::packetRemovedSignal
simsignal_t packetRemovedSignal
Definition: Simsignals.cc:84
inet::queueing::IPacketCollection::getNumPackets
virtual int getNumPackets() const =0
Returns the number of available packets in the collection in the range [0, inf).
inet::packetDroppedSignal
simsignal_t packetDroppedSignal
Definition: Simsignals.cc:85
inet::queueing::PacketProcessorBase::resolveDirective
virtual const char * resolveDirective(char directive) const override
Definition: PacketProcessorBase.cc:407
inet::queueing::PacketBufferBase::numDroppedPackets
int numDroppedPackets
Definition: PacketBufferBase.h:22
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::packetAddedSignal
simsignal_t packetAddedSignal
Definition: Simsignals.cc:83
inet::queueing::PacketProcessorBase::displayStringTextFormat
const char * displayStringTextFormat
Definition: PacketProcessorBase.h:29
inet::queueing::IPacketCollection::getTotalLength
virtual b getTotalLength() const =0
Returns the total length of all packets in the collection in the range [0, inf).