INET Framework for OMNeT++/OMNEST
ChannelAccess.h
Go to the documentation of this file.
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  **************************************************************************/
00019 
00020 
00021 #ifndef CHANNEL_ACCESS_H
00022 #define CHANNEL_ACCESS_H
00023 
00024 #include <list>
00025 #include <omnetpp.h>
00026 #include "AirFrame_m.h"
00027 #include "BasicModule.h"
00028 #include "ChannelControl.h"
00029 
00047 class INET_API ChannelAccess : public BasicModule
00048 {
00049   protected:
00051     ChannelControl* cc;
00052 
00054     ChannelControl::HostRef myHostRef;
00055 
00056   protected:
00058     virtual void sendToChannel(AirFrame *msg);
00059 
00061     const Coord& getMyPosition() {return cc->getHostPosition(myHostRef);}
00062 
00063   protected:
00065     virtual void initialize(int stage);
00066 
00067     virtual int numInitStages() const {return 3;}
00068 };
00069 
00070 #endif
00071