#include <BasicApplLayer.h>
Inherits BasicModule.
Inherited by ClientApplLayer, and TestApplLayer.
Inheritance diagram for BasicApplLayer:
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 |
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.
|
Handle control messages from lower layer. The basic application layer just silently deletes all messages it receives. |
|
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. |
|
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.
|
|
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. |
|
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. |
|
Return my application layer address. We use the network module index as application address |
|
Sends a message to the lower layer; waits delay seconds before sending. Send message down to lower layer after delay seconds |
|
Sends a message to the lower layer. Send message down to lower layer |
|
Length of the ApplPkt header.
|