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

BasicApplLayer Class Reference
[applLayer - application layer modules]

Basic class for the application layer. More...

#include <BasicApplLayer.h>

Inherits BasicModule.

Inherited by ClientApplLayer, and TestApplLayer.

Inheritance diagram for BasicApplLayer:

Inheritance graph
[legend]
Collaboration diagram for BasicApplLayer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Module_Class_Members (BasicApplLayer, BasicModule, 0)
virtual void initialize (int)
 Initialization of the module and some variables.
void handleMessage (cMessage *)
 Called every time a message arrives.

Protected Member Functions

virtual const int myApplAddr ()
 Return my application layer address.
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 self message or a data message from the upper or lower layer arrives respectively.

virtual void handleSelfMsg (cMessage *msg)
 Handle self messages such as timer...
virtual void handleLowerMsg (cMessage *msg)
 Handle messages from lower layer.
virtual void handleLowerControl (cMessage *msg)
 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 but should use them to handle message encasulation and sending. They will wirte all necessary information into packet headers and add or strip the appropriate headers for each layer.

void sendDown (cMessage *)
 Sends a message to the lower layer.
void sendDelayedDown (cMessage *, double)
 Sends a message to the lower layer; waits delay seconds before sending.

Protected Attributes

int headerLength
 Length of the ApplPkt header.
int lowergateIn
 gate id
int lowerControlIn
 gate id
int lowergateOut
 gate id

Detailed Description

Basic class for the application layer.

This is the generic class for all application layer modules. If you want to implement your own application layer you have to subclass your module from this class.

Author:
Daniel Willkomm


Member Function Documentation

virtual void BasicApplLayer::handleLowerControl cMessage *  msg  )  [inline, protected, virtual]
 

Handle control messages from lower layer.

The basic application layer just silently deletes all messages it receives.

virtual void BasicApplLayer::handleLowerMsg cMessage *  msg  )  [inline, protected, virtual]
 

Handle messages from lower layer.

Redefine this function if you want to process messages from lower layers.

The basic application layer just silently deletes all messages it receives.

Reimplemented in ClientApplLayer, PollApplLayer, and TestApplLayer.

void BasicApplLayer::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 message 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:
handleLowerMsg, handleSelfMsg

virtual void BasicApplLayer::handleSelfMsg cMessage *  msg  )  [inline, protected, virtual]
 

Handle self messages such as timer...

Define this function if you want to process timer or other kinds of self messages

Reimplemented in BurstApplLayer, PollApplLayer, and TestApplLayer.

void BasicApplLayer::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 BurstApplLayer, PollApplLayer, and TestApplLayer.

virtual const int BasicApplLayer::myApplAddr  )  [inline, protected, virtual]
 

Return my application layer address.

We use the network module index as application address

void BasicApplLayer::sendDelayedDown cMessage *  msg,
double  delay
[protected]
 

Sends a message to the lower layer; waits delay seconds before sending.

Send message down to lower layer after delay seconds

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

Sends a message to the lower layer.

Send message down to lower layer


Member Data Documentation

int BasicApplLayer::headerLength [protected]
 

Length of the ApplPkt header.

Todo:
for now it is read from omnetpp.ini but should be easily settable by the user later


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