INET Framework for OMNeT++/OMNEST
BasicSnrEval.h
Go to the documentation of this file.
00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        BasicSnrEval.h
00003  *
00004  * author:      Marc Loebbers
00005  *
00006  * copyright:   (C) 2004 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  ***************************************************************************/
00019 
00020 
00021 #ifndef BASIC_SNREVAL_H
00022 #define BASIC_SNREVAL_H
00023 
00024 #include <map>
00025 
00026 #include "ChannelAccess.h"
00027 #include "AirFrame_m.h"
00028 #include "SnrControlInfo_m.h"
00029 
00030 
00055 class INET_API BasicSnrEval : public ChannelAccess
00056 {
00057   protected:
00059     double bitrate;
00060 
00062     int headerLength;
00063 
00065     double transmitterPower;
00066 
00069     int uppergateOut;
00070     int uppergateIn;
00073   protected:
00075     virtual void initialize(int);
00076 
00078     virtual void handleMessage( cMessage* );
00079 
00080   protected:
00089     virtual void handleUpperMsg(AirFrame*);
00090 
00097     virtual void handleSelfMsg(cMessage *msg){delete msg;};
00098 
00100     virtual void handleLowerMsgStart(AirFrame*);
00101 
00106     virtual void handleLowerMsgEnd(AirFrame*);
00121 
00123     virtual void bufferMsg(AirFrame *frame);
00124 
00126     virtual AirFrame* unbufferMsg(cMessage *msg);
00127 
00129     virtual void sendUp(AirFrame*, SnrList&);
00130 
00132     virtual void sendDown(AirFrame *msg);
00133 
00135     virtual AirFrame *encapsMsg(cPacket *msg);
00139     virtual double calcDuration(cPacket *);
00140 
00142     virtual int getChannelNumber() const {return 0;}
00143 
00157 
00159     virtual AirFrame* createCapsulePkt() {
00160         return new AirFrame();
00161     };
00164 };
00165 
00166 #endif