ChannelAccess.h

00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        ChannelAccess.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  * description: - Base class for physical layers
00019  *              - if you create your own physical layer, please subclass
00020  *                from this class and use the sendToChannel() function!!
00021  **************************************************************************/
00022 
00023 
00024 #ifndef CHANNEL_ACCESS_H
00025 #define CHANNEL_ACCESS_H
00026 
00027 #include <omnetpp.h>
00028 #include <vector>
00029 
00030 #include "BatteryAccess.h"
00031 #include "Move.h"
00032 #include "BaseWorldUtility.h"
00033 #include "AirFrame_m.h"
00034 
00035 #include "BaseConnectionManager.h"
00036 
00052 class ChannelAccess : public BatteryAccess
00053 {
00054 protected:
00056     bool useSendDirect;
00057 
00059     BaseConnectionManager* cc;
00060 
00062     bool coreDebug;
00063 
00065   bool usePropagationDelay;
00066 
00068     Move move;
00070     int catMove;
00071 
00073     bool isRegistered;
00074 
00076   BaseWorldUtility* world;
00077 
00078 protected:
00082   simtime_t calculatePropagationDelay(const NicEntry* nic);
00083 
00093   void sendToChannel(cPacket *msg);
00094 
00095 public:
00104   static BaseConnectionManager* getConnectionManager(cModule* nic);
00105 
00111     virtual void initialize(int stage);
00112 
00119     virtual void receiveBBItem(int category, const BBItem *details, int scopeModuleId);
00120 };
00121 
00122 #endif
00123