00001 /* -*- mode:c++ -*- ******************************************************** 00002 * file: BasicLayer.h 00003 * 00004 * author: Andreas Koepke 00005 * 00006 * copyright: (C) 2006 Telecommunication Networks Group (TKN) at 00007 * Technische Universitaet Berlin, Germany. 00008 * 00009 * This program is free software; you can redistribute it 00010 * and/or modify it under the terms of the GNU General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2 of the License, or (at your option) any later 00013 * version. 00014 * For further information see file COPYING 00015 * in the top level directory 00016 *************************************************************************** 00017 * part of: framework implementation developed by tkn 00018 * description: basic MAC layer class 00019 * subclass to create your own MAC layer 00020 **************************************************************************/ 00021 00022 00023 #ifndef BASIC_LAYER_H 00024 #define BASIC_LAYER_H 00025 00026 #include <omnetpp.h> 00027 #include "BasicModule.h" 00028 00038 class BasicLayer : public BasicModule 00039 { 00040 protected: 00041 00044 int uppergateIn; 00045 int uppergateOut; 00046 int lowergateIn; 00047 int lowergateOut; 00048 int upperControlOut; 00049 int lowerControlIn; 00050 00053 public: 00054 Module_Class_Members(BasicLayer, BasicModule, 0 ); 00055 00057 virtual void initialize(int); 00058 00060 virtual void handleMessage( cMessage* ); 00061 00062 protected: 00073 00076 virtual void handleSelfMsg(cMessage* msg) = 0; 00077 00083 virtual void handleUpperMsg(cMessage *msg) = 0; 00084 00085 00087 virtual void handleLowerMsg(cMessage *msg) = 0; 00088 00090 virtual void handleLowerControl(cMessage *msg) = 0; 00091 00106 00114 void sendDown(cMessage *msg); 00115 00123 void sendUp(cMessage *msg); 00124 00126 void sendControlUp(cMessage *msg); 00127 00129 }; 00130 00131 #endif