#include <BasicDecider.h>
Inherits BasicModule.
Inherited by SnrDecider, and TestDecider.
Inheritance diagram for BasicDecider:
Public Member Functions | |
virtual void | initialize (int) |
Initialization of the module and some variables. | |
void | handleMessage (cMessage *) |
Called every time a message arrives. | |
Protected Member Functions | |
void | sendUp (cMessage *) |
Sends a message to the upper layer. | |
virtual cMessage * | decapsMsg (AirFrame *) |
decapsulate the MacPkt from the AirFrame | |
Handle Messages | |
Functions to redefine by the programmer
These are the functions provided to add own functionality to your modules. These functions are called whenever a blackboard message, a self message or a data message from the upper or lower layer arrives respectively. | |
virtual void | handleSelfMsg (cMessage *msg)=0 |
Handle self messages such as timer... | |
virtual void | handleLowerMsg (AirFrame *, const SnrList &)=0 |
In this function the decision whether a frame is received correctly or not is made. | |
Protected Attributes | |
bool | coreDebug |
debug this core module? | |
int | uppergateOut |
gate id | |
int | lowergateIn |
gate id | |
Private Member Functions | |
Module_Class_Members (BasicDecider, BasicModule, 0) |
The decider module only handles messages from lower layers. All messages from upper layers are directly passed to the snrEval layer and cannot be processed in the decider module
This is the basic decider module which does not really decide anything. It only provides the basic functionality which all decider modules should have, namely message de- & encapsulation (For further information about the functionality of the physical layer modules and the formats used for communication in between them have a look at "The Design of a Mobility Framework in OMNeT++" paper)
Every own decider module class should be derived from this class and only the handle*Msg functions may be redefined for your own needs. The other functions should usually NOT be changed.
All decider modules should assume bits as a unit for the length fields.
|
In this function the decision whether a frame is received correctly or not is made. Redefine this function if you want to process messages from the channel before they are forwarded to upper layers In this function it has to be decided whether this message got lost or not. This can be done with a simple SNR threshold or with transformations of SNR into bit error probabilities... Afterwrads the message has to be decapsulated (decapsMsg) and send to the MAC layer (sendUp) just an example how to handle the snrList...: bool correct = true; //check the entries in the snrList if a level greater than the //acceptable minimum occured: double min = 0.0000000000000001; // just a senseless example for (SnrList::iterator iter = snrList.begin(); iter != snrList.end(); iter++){ if (iter->snr < min) correct = false; } if (correct){ sendUp(frame); } else{ delete frame; } Implemented in ErrAndCollDecider, SnrDecider, and TestDecider. |
|
Called every time a message arrives. The basic handle message function. Depending on the gate a message arrives handleMessage just calls different handle*Msg functions to further process the message. The decider module only handles messages from lower layers. All messages from upper layers are directly passed to the snrEval layer and cannot be processed in the decider module You should not make any changes in this function but implement all your functionality into the handle*Msg functions called from here.
|
|
Handle self messages such as timer... Define this function if you want to timer or other kinds of self messages Implemented in ErrAndCollDecider, SnrDecider, and TestDecider. |
|
Initialization of the module and some variables. First we have to initialize the module from which we derived ours, in this case BasicModule. Then we have to intialize the gates and - if necessary - some own variables. Reimplemented from BasicModule. Reimplemented in SnrDecider. |
|
Sends a message to the upper layer. Send message to the upper layer. to be called within handleLowerMsg. |