TTEthernet Model for INET Framework
|
Base class for a rate-constrained buffer class. More...
#include <RCBuffer.h>
Public Member Functions | |
RCBuffer () | |
Constructor. More... | |
virtual | ~RCBuffer () |
Destructor. More... | |
virtual void | resetBag () |
resets the bag for a destination gate. More... | |
![]() | |
~CTBuffer () | |
Destructor. More... | |
void | putFrame (EtherFrame *frame) |
Wrapper function arround enqueue(). More... | |
![]() | |
~Buffer () | |
Destructor. 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 | initialize (int stage) |
Initializes the timerMessage. More... | |
virtual int | numInitStages () const |
Returns the numer of initializaiton stages this module needs. More... | |
virtual void | handleMessage (cMessage *msg) |
handles the incoming and outgoing messages of the buffer. More... | |
virtual void | handleParameterChange (const char *parname) |
Indicates a parameter has changed. More... | |
![]() | |
void | handleMessage (cMessage *msg) |
Is called when a new Frame is received in the buffer. More... | |
![]() | |
void | handleMessage (cMessage *msg) |
Is called when a new Frame is received in the buffer. More... | |
virtual void | enqueue (EtherFrame *newFrame) |
Is called to store an EtherFrame in the buffer. More... | |
virtual EtherFrame * | dequeue () |
Is called to get an EtherFrame from 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... | |
Private Attributes | |
bool | bagExpired |
Boolean indicating the bag already expired. More... | |
unsigned int | numReset |
Number of reset messages by the destination Gates. More... | |
SchedulerTimerEvent * | timerMessage |
The timer Message is stored for reusage purpose. More... | |
Additional Inherited Members | |
![]() | |
uint32_t | ctMask |
caches ct_mask parameter More... | |
uint32_t | ctMarker |
caches ct_marker parameter More... | |
uint16_t | ctId |
caches ct_id parameter 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... | |
Base class for a rate-constrained buffer class.
The Frame is stored and released immediately when the bag has expired previously. If the bag has not expired yet the frame is stored. The implementation uses a SchedulerTimerEvent that is registered at the TTEScheduler.
Use the implementations RCDoubleBuffer, RCQueueBuffer.
Definition at line 38 of file RCBuffer.h.
TTEthernetModel::RCBuffer::RCBuffer | ( | ) |
|
virtual |
Destructor.
Definition at line 31 of file RCBuffer.cc.
|
protectedvirtual |
handles the incoming and outgoing messages of the buffer.
If message arrived on in, it is queued by calling Buffer::handleMessage(cMessage *msg). Afterwards the message is directly send when the bag already expired. When the scheduler message arrives (schedulerIn) a pending message is transferred. If there is no message waiting the bagExpired state is saved.
msg | incoming EtherFrame for the Buffer or SchedulerTimerEvent message. |
Definition at line 56 of file RCBuffer.cc.
|
protectedvirtual |
Indicates a parameter has changed.
parname | Name of the changed parameter or NULL if multiple parameter changed. |
Reimplemented from TTEthernetModel::CTBuffer.
Definition at line 107 of file RCBuffer.cc.
|
protectedvirtual |
Initializes the timerMessage.
stage | the stages. Module initializes when stage==0 |
Reimplemented from TTEthernetModel::Buffer.
Definition at line 45 of file RCBuffer.cc.
|
protectedvirtual |
Returns the numer of initializaiton stages this module needs.
Reimplemented from TTEthernetModel::Buffer.
Definition at line 37 of file RCBuffer.cc.
|
virtual |
resets the bag for a destination gate.
This method must be invoked only once by each destination gate to indicate the message left the interface. The method executes the transmit callbacks and registers a SchedulerTimerEvent that indicates the beginning of a new bag
Definition at line 113 of file RCBuffer.cc.
Referenced by TTEthernetModel::TTEOutput::handleMessage(), and TTEthernetModel::TTEOutput::requestPacket().
|
private |
Boolean indicating the bag already expired.
Definition at line 44 of file RCBuffer.h.
Referenced by handleMessage(), and RCBuffer().
|
private |
Number of reset messages by the destination Gates.
The bag is only reseted when all gates invoked resetBag().
Definition at line 51 of file RCBuffer.h.
Referenced by handleMessage(), and resetBag().
|
private |
The timer Message is stored for reusage purpose.
Definition at line 56 of file RCBuffer.h.
Referenced by handleParameterChange(), initialize(), RCBuffer(), resetBag(), and ~RCBuffer().