#include <BasicLayer.h>
Inherits BasicModule.
Inherited by BasicMacLayer, Decider80211, Mac80211, and SimpleNetwLayer.
Inheritance diagram for BasicLayer:
Public Member Functions | |
Module_Class_Members (BasicLayer, BasicModule, 0) | |
virtual void | initialize (int) |
Initialization of the module and some variables. | |
virtual void | handleMessage (cMessage *) |
Called every time a message arrives. | |
Protected Member Functions | |
Handle Messages | |
Functions to be redefined 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 | handleUpperMsg (cMessage *msg)=0 |
Handle messages from upper layer. | |
virtual void | handleLowerMsg (cMessage *msg)=0 |
Handle messages from lower layer. | |
virtual void | handleLowerControl (cMessage *msg)=0 |
Handle control messages from lower layer. | |
Convenience Functions | |
Functions for convenience - NOT to be modified These are functions taking care of message encapsulation and message sending. Normally you should not need to alter these.
All these functions assume that YOU do all the necessary handling of control information etc. before you use them. | |
void | sendDown (cMessage *msg) |
Sends a message to the lower layer. | |
void | sendUp (cMessage *msg) |
Sends a message to the upper layer. | |
void | sendControlUp (cMessage *msg) |
Sends a control message to an upper layer. | |
Protected Attributes | |
int | uppergateIn |
gate id | |
int | uppergateOut |
gate id | |
int | lowergateIn |
gate id | |
int | lowergateOut |
gate id | |
int | upperControlOut |
gate id | |
int | lowerControlIn |
gate id |
This module provides basic abstractions that ease development of a network or MAC layer.
|
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. You should not make any changes in this function but implement all your functionality into the handle*Msg functions called from here.
|
|
Handle messages from upper layer. This function is pure virtual here, because there is no reasonable guess what to do with it by default. Implemented in Flood, SimpleNetwLayer, AlohaMacLayer, CSMAMacLayer, Mac80211, Decider80211, and BasicMacLayer. |
|
Initialization of the module and some variables. First we have to initialize the module from which we derived ours, in this case BasicModule. This module takes care of the gate initialization. Reimplemented from BasicModule. Reimplemented in Flood, SimpleNetwLayer, AlohaMacLayer, CSMAMacLayer, Mac80211, Decider80211, and BasicMacLayer. |
|
Sends a message to the lower layer. Short hand for send(msg, lowergateOut); You have to take care of encapsulation We recommend that you use a pair of functions called encapsMsg/decapsMsg. |
|
Sends a message to the upper layer. Short hand for send(msg, uppergateOut); You have to take care of decapsulation and deletion of superflous frames. We recommend that you use a pair of functions decapsMsg/encapsMsg. |