TTEthernet Model for INET Framework
|
Base class for all critical traffic buffer classes. More...
#include <CTBuffer.h>
Public Member Functions | |
~CTBuffer () | |
Destructor. More... | |
virtual void | handleParameterChange (const char *parname) |
Indicates a parameter has changed. 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 | |
void | handleMessage (cMessage *msg) |
Is called when a new Frame is received in the buffer. 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... | |
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... | |
Protected Attributes | |
uint32_t | ctMask |
caches ct_mask parameter More... | |
uint32_t | ctMarker |
caches ct_marker parameter More... | |
uint16_t | ctId |
caches ct_id parameter More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
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 all critical traffic buffer classes.
CTBuffer, although packed with buffer-related functionality, does not do anything useful by itself: one has to subclass from it and redefine one or more virtual member functions to make it do useful work. These functions are:
enqueue(EtherFrame *newFrame) is called to queue a message in the buffer. It must be implemented according to the correct buffer behaviour.
dequeue() is called to get a frame from the buffer.
Definition at line 44 of file CTBuffer.h.
CTBuffer::~CTBuffer | ( | ) |
|
protected |
Is called when a new Frame is received in the buffer.
When a frame is received on the in-Gate it is processed. If the destination address is unspecified it is set according to the ct marker of the buffer. Afterwards it is enqueued using the buffer specific enqueue(EtherFrame *newFrame) method. In the end all registered receive callbacks are executed.
msg | The incoming message |
Definition at line 38 of file CTBuffer.cc.
Referenced by TTEthernetModel::TTBuffer::handleMessage(), and TTEthernetModel::RCBuffer::handleMessage().
|
virtual |
Indicates a parameter has changed.
parname | Name of the changed parameter or NULL if multiple parameter changed. |
Reimplemented from TTEthernetModel::Buffer.
Reimplemented in TTEthernetModel::RCBuffer, and TTEthernetModel::TTBuffer.
Definition at line 57 of file CTBuffer.cc.
Referenced by TTEthernetModel::TTBuffer::handleParameterChange(), and TTEthernetModel::RCBuffer::handleParameterChange().
void CTBuffer::putFrame | ( | EtherFrame * | frame | ) |
Wrapper function arround enqueue().
frame | the EtherFrame to put in the buffer. |
Definition at line 30 of file CTBuffer.cc.
|
protected |
caches ct_id parameter
Definition at line 71 of file CTBuffer.h.
Referenced by handleMessage(), and handleParameterChange().
|
protected |
caches ct_marker parameter
Definition at line 67 of file CTBuffer.h.
Referenced by handleMessage(), and handleParameterChange().
|
protected |
caches ct_mask parameter
Definition at line 63 of file CTBuffer.h.
Referenced by handleMessage(), and handleParameterChange().