TTEthernet Model for INET Framework
|
Base class for a queuing buffer class. More...
#include <QueueBuffer.h>
Public Member Functions | |
QueueBuffer () | |
Constructor for the class. More... | |
~QueueBuffer () | |
Destructor for the class. More... | |
![]() | |
~Buffer () | |
Destructor. More... | |
virtual void | handleParameterChange (const char *parname) |
Indicates a parameter has changed. More... | |
EtherFrame * | getFrame () |
Wrapper function arround dequeue(). More... | |
void | putFrame (EtherFrame *frame) |
Wrapper function arround enqueue(). More... | |
void | addReceiveCallback (Callback *cb, TTEApplicationBase *application) |
Adds a receive callback for an application to the buffer. More... | |
Callback * | getReceiveCallback (TTEApplicationBase *application) |
Returns the currently registered receive callback for an application. More... | |
void | addTransmitCallback (Callback *cb, TTEApplicationBase *application) |
Adds a transmit callback for an application to the buffer. More... | |
Callback * | getTransmitCallback (TTEApplicationBase *application) |
Returns the currently registered transmit callback for an application. More... | |
Protected Member Functions | |
virtual void | enqueue (EtherFrame *newFrame) |
Inserts EtherFrame in the Queue and emits the queue length. More... | |
virtual EtherFrame * | dequeue () |
Removes and returns an EtherFrame from the Queue and emits the queue length. More... | |
![]() | |
virtual void | initialize (int stage) |
Initializes the module. More... | |
virtual int | numInitStages () const |
Returns the numer of initializaiton stages this module needs. More... | |
void | handleMessage (cMessage *msg) |
Is called when a new Frame is received in the buffer. More... | |
void | recordPacketSent () |
Emits a statistics signal that a frame was sent from the buffer. More... | |
void | setIsEmpty (bool empty) |
Sets the status of the Buffer to empty or non-empty. More... | |
Static Protected Attributes | |
static simsignal_t | queueLengthSignal = SIMSIGNAL_NULL |
Signal containing the queue length, that is emitted every time a frame was inserted or removed. More... | |
static simsignal_t | ctDroppedSignal = SIMSIGNAL_NULL |
Signal that is emitted when a frame is dropped. More... | |
![]() | |
static simsignal_t | txPkSignal = SIMSIGNAL_NULL |
Signal that is emitted every time a frame was sent. More... | |
static simsignal_t | latencySignal = SIMSIGNAL_NULL |
Signal that contains the latency until the frame enters the buffer. More... | |
Private Member Functions | |
virtual void | initializeStatistics () |
Initializes the statistics for the Queue. More... | |
Private Attributes | |
cQueue | frames |
Queue for the EtherFrames in the Buffer. More... | |
Additional Inherited Members | |
![]() | |
std::list< cGate * > | destinationGates |
Stores the Gates to that the messages are delivered. More... | |
std::map< TTEApplicationBase *, Callback * > | receiveCallbacks |
Stores the callbacks that are executed when a frame is added to the buffer. More... | |
std::map< TTEApplicationBase *, Callback * > | transmitCallbacks |
Stores the callbacks that are executed when a frame is removed from the buffer. More... | |
Base class for a queuing buffer class.
The queue is an endless fifo queue.
Use the implementations BGQueueBuffer, TTQueueBuffer, RCQueueBuffer.
Definition at line 35 of file QueueBuffer.h.
TTEthernetModel::QueueBuffer::QueueBuffer | ( | ) |
Constructor for the class.
executes initializeStatistics()
Definition at line 23 of file QueueBuffer.cc.
TTEthernetModel::QueueBuffer::~QueueBuffer | ( | ) |
Destructor for the class.
Definition at line 28 of file QueueBuffer.cc.
|
protectedvirtual |
Removes and returns an EtherFrame from the Queue and emits the queue length.
Reimplemented from TTEthernetModel::Buffer.
Definition at line 68 of file QueueBuffer.cc.
|
protectedvirtual |
Inserts EtherFrame in the Queue and emits the queue length.
newFrame | a pointer to the EtherFrame to insert in the queue. |
Reimplemented from TTEthernetModel::Buffer.
Definition at line 40 of file QueueBuffer.cc.
|
privatevirtual |
Initializes the statistics for the Queue.
Definition at line 33 of file QueueBuffer.cc.
Referenced by QueueBuffer().
|
staticprotected |
Signal that is emitted when a frame is dropped.
Frames may be dropped when frame arrives at a full buffer.
Definition at line 88 of file QueueBuffer.h.
Referenced by enqueue(), and initializeStatistics().
|
private |
Queue for the EtherFrames in the Buffer.
Definition at line 55 of file QueueBuffer.h.
Referenced by dequeue(), enqueue(), initializeStatistics(), and ~QueueBuffer().
|
staticprotected |
Signal containing the queue length, that is emitted every time a frame was inserted or removed.
Definition at line 82 of file QueueBuffer.h.
Referenced by dequeue(), enqueue(), and initializeStatistics().