TTEthernet Model for INET Framework
|
Base class for a time-triggered buffer class. More...
#include <TTBuffer.h>
Public Member Functions | |
TTBuffer () | |
Constructor. More... | |
~TTBuffer () | |
Destructor. 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 SchedulerActionTimeEvent. 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 | |
SchedulerActionTimeEvent * | actionTimeEvent |
Event indicating the actionTime. 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 time-triggered buffer class.
The Frame is stored and released time-triggered using a previously registered SchedulerActionTimeEvent. The Buffer interacts with the TTEScheduler.
Use the implementations TTDoubleBuffer, TTQueueBuffer.
Definition at line 37 of file TTBuffer.h.
TTBuffer::TTBuffer | ( | ) |
TTBuffer::~TTBuffer | ( | ) |
Destructor.
Definition at line 30 of file TTBuffer.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). When a SchedulerActionTimeEvent message arrives the previously stored message is released and the callbacks are executed. When there is no message to send a TTBufferEmpty message is transmitted. This allowes the receiving application to use the bandwidth for other messages.
msg | incoming EtherFrame for the Buffer or SchedulerActionTimeEvent message. |
Definition at line 62 of file TTBuffer.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 108 of file TTBuffer.cc.
|
protectedvirtual |
Initializes the SchedulerActionTimeEvent.
stage | the stages. Module registers events when stage==1 |
Reimplemented from TTEthernetModel::Buffer.
Definition at line 41 of file TTBuffer.cc.
|
protectedvirtual |
Returns the numer of initializaiton stages this module needs.
Reimplemented from TTEthernetModel::Buffer.
Definition at line 36 of file TTBuffer.cc.
|
private |
Event indicating the actionTime.
Definition at line 44 of file TTBuffer.h.
Referenced by handleParameterChange(), initialize(), TTBuffer(), and ~TTBuffer().