00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef BASIC_APPL_LAYER_H
00024 #define BASIC_APPL_LAYER_H
00025
00026 #include <omnetpp.h>
00027
00028 #include "BasicModule.h"
00029 #include "ApplPkt_m.h"
00030
00031
00043 class BasicApplLayer : public BasicModule
00044 {
00045 protected:
00048 int lowergateIn;
00049 int lowerControlIn;
00050 int lowergateOut;
00059 int headerLength;
00060
00061 public:
00062 Module_Class_Members( BasicApplLayer , BasicModule, 0 );
00063
00065 virtual void initialize(int);
00066
00068 void handleMessage(cMessage*);
00069
00070 protected:
00081
00088 virtual void handleSelfMsg(cMessage* msg){
00089 EV << "BasicAppl: handleSelfMsg not redefined; delete msg\n";
00090 delete msg;
00091 };
00092
00102 virtual void handleLowerMsg(cMessage* msg){
00103 EV << "BasicAppl: handleLowerMsg not redefined; delete msg\n";
00104 delete msg;
00105 };
00106
00113 virtual void handleLowerControl(cMessage* msg){
00114 EV << "BasicAppl: handleLowerControl not redefined; delete msg\n";
00115 delete msg;
00116 };
00117
00132
00134 void sendDown(cMessage *);
00135
00138 void sendDelayedDown(cMessage *, double);
00139
00148 virtual const int myApplAddr(){
00149 return parentModule()->index();
00150 };
00151
00152 };
00153
00154 #endif