Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

BasicDecider Class Reference
[decider - decider modulesbasicModules - basic module classes of the MF]

Module to decide whether a frame is received correctly or is lost due to bit errors, interference... More...

#include <BasicDecider.h>

Inherits BasicModule.

Inherited by SnrDecider, and TestDecider.

Inheritance diagram for BasicDecider:

Inheritance graph
[legend]
Collaboration diagram for BasicDecider:

Collaboration graph
[legend]
List of all members.

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)

Detailed Description

Module to decide whether a frame is received correctly or is lost due to bit errors, interference...

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.

Author:
Marc Löbbers, Daniel Willkomm


Member Function Documentation

virtual void BasicDecider::handleLowerMsg AirFrame *  ,
const SnrList
[protected, pure virtual]
 

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.

void BasicDecider::handleMessage cMessage *  msg  ) 
 

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.

See also:
handleLowerMsg, handleSelfMsg

virtual void BasicDecider::handleSelfMsg cMessage *  msg  )  [protected, pure virtual]
 

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.

void BasicDecider::initialize int  stage  )  [virtual]
 

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.

void BasicDecider::sendUp cMessage *  msg  )  [protected]
 

Sends a message to the upper layer.

Send message to the upper layer.

to be called within handleLowerMsg.


The documentation for this class was generated from the following files:
Generated on Fri Jan 12 08:29:38 2007 for Mobility Framework by  doxygen 1.4.4