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

BasicLayer Class Reference
[basicModules - basic module classes of the MF]

A very simple layer template. More...

#include <BasicLayer.h>

Inherits BasicModule.

Inherited by BasicMacLayer, Decider80211, Mac80211, and SimpleNetwLayer.

Inheritance diagram for BasicLayer:

Inheritance graph
[legend]
Collaboration diagram for BasicLayer:

Collaboration graph
[legend]
List of all members.

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

Detailed Description

A very simple layer template.

This module provides basic abstractions that ease development of a network or MAC layer.

Author:
Andreas Koepke


Member Function Documentation

void BasicLayer::handleMessage cMessage *  msg  )  [virtual]
 

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.

See also:
handleUpperMsg, handleLowerMsg, handleSelfMsg

virtual void BasicLayer::handleUpperMsg cMessage *  msg  )  [protected, pure virtual]
 

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.

void BasicLayer::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. This module takes care of the gate initialization.

Reimplemented from BasicModule.

Reimplemented in Flood, SimpleNetwLayer, AlohaMacLayer, CSMAMacLayer, Mac80211, Decider80211, and BasicMacLayer.

void BasicLayer::sendDown cMessage *  msg  )  [protected]
 

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.

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

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.


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