User Manual, Developers Guide and API Documentation

RACH.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef LTE_MACR_RACH_HPP
00029 #define LTE_MACR_RACH_HPP
00030 
00031 #include <LTE/macr/RACHInterface.hpp>
00032 #include <LTE/helper/HasModeName.hpp>
00033 
00034 #include <WNS/ldk/CommandTypeSpecifier.hpp>
00035 #include <WNS/ldk/HasReceptor.hpp>
00036 #include <WNS/ldk/HasConnector.hpp>
00037 #include <WNS/ldk/HasDeliverer.hpp>
00038 #include <WNS/Cloneable.hpp>
00039 #include <WNS/logger/Logger.hpp>
00040 #include <WNS/PowerRatio.hpp>
00041 #include <WNS/service/phy/phymode/PhyModeInterface.hpp>
00042 #include <WNS/ldk/ShortcutFU.hpp>
00043 #include <WNS/ldk/fu/Plain.hpp>
00044 #include <WNS/service/dll/Address.hpp>
00045 
00046 namespace dll { namespace services { namespace control {
00047     class Association;
00048 }}}
00049 
00050 
00051 namespace lte {
00052     namespace controlplane {
00053     class RRHandlerUT;
00054     namespace bch {
00055         class BCHService;
00056     }
00057     }
00058     namespace macr {
00059     class PhyUser;
00060 
00063     class RACH :
00064         public virtual wns::ldk::FunctionalUnit,
00065         public wns::ldk::CommandTypeSpecifier<>,
00066         public wns::ldk::HasReceptor<>,
00067         public wns::ldk::HasConnector<>,
00068         public wns::ldk::HasDeliverer<>,
00069         public helper::HasModeName
00070     {
00071     public:
00073         RACH(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00074 
00076         virtual ~RACH();
00077 
00080         virtual void
00081         onFUNCreated();
00082 
00083     protected:
00087         struct {
00088         PhyUser* phyUser;
00089         } friends;
00090 
00093         dll::services::control::Association* associationService;
00094 
00096         wns::service::phy::phymode::PhyModeInterfacePtr phyModePtr;
00097 
00099         wns::logger::Logger logger;
00100     };
00101 
00102     class RACHUT :
00103         public RACH,
00104         public IRachTimingTx,
00105         public wns::Cloneable<RACHUT>
00106     {
00108         class StopEvent
00109         {
00110         RACHUT* rach;
00111         public:
00112         StopEvent(RACHUT* _rach) :
00113             rach(_rach)
00114         {
00115         }
00116 
00117         virtual
00118         ~StopEvent()
00119         {
00120         }
00121 
00122         virtual void
00123         operator()()
00124         {
00125             rach->stopTx();
00126         }
00127         };
00128 
00131         virtual bool
00132         doIsAccepting(const wns::ldk::CompoundPtr& /* compound */) const;
00133 
00134         virtual void
00135         doWakeup();
00137 
00138         lte::controlplane::RRHandlerUT* rrh;
00139 
00140         lte::controlplane::bch::BCHService* bchService;
00141 
00142         int subBandCounter;
00143 
00144         bool accepting;
00145         
00146         bool inWakeup;
00147         
00148         simTimeType stopTime;
00149     
00150         wns::Power txPower;
00151 
00152     public:
00153         RACHUT(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config) :
00154         RACH(fun, config),
00155         wns::Cloneable<RACHUT>(),
00156         rrh(NULL),
00157         bchService(NULL),
00158         subBandCounter(0),
00159         accepting(false),
00160         inWakeup(false),
00161         stopTime(0.0),
00162         txPower(config.get<wns::Power>("txPower"))
00163         {}
00164 
00165         virtual
00166         ~RACHUT(){}
00167 
00170         virtual void
00171         onFUNCreated();
00172 
00175         virtual void
00176         doSendData(const wns::ldk::CompoundPtr&);
00177 
00178         virtual void
00179         doOnData(const wns::ldk::CompoundPtr&);
00181 
00182 
00184         void
00185         startTx(simTimeType duration);
00186 
00188         void
00189         stopTx();
00190     };
00191 
00192     class RACHBS :
00193         public RACH,
00194         public IRachTimingRx,
00195         public wns::Cloneable<RACHBS>
00196     {
00199         virtual bool
00200         doIsAccepting(const wns::ldk::CompoundPtr& /* compound */) const;
00201         
00202         virtual void
00203         doWakeup();
00205 
00206     public:
00207         RACHBS(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config) :
00208         RACH(fun, config),
00209         wns::Cloneable<RACHBS>()
00210         {}
00211 
00212         virtual
00213         ~RACHBS(){}
00214 
00217         virtual void
00218         doSendData(const wns::ldk::CompoundPtr&);
00219         
00220         virtual void
00221         doOnData(const wns::ldk::CompoundPtr&);
00223 
00224 
00226         void
00227         startRx(simTimeType duration);
00228 
00230         void
00231         stopRx();
00232     };
00233 
00234     class RACHShortcut:
00235         public wns::ldk::ShortcutFU<wns::service::dll::UnicastAddress, RACHShortcut*>,
00236         public wns::ldk::CommandTypeSpecifier<>,
00237         public wns::ldk::HasReceptor<>,
00238         public wns::ldk::HasConnector<>,
00239         public wns::ldk::HasDeliverer<>
00240     {
00241     public:
00242         RACHShortcut(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00243 
00244         virtual ~RACHShortcut();
00245 
00246         virtual wns::service::dll::UnicastAddress
00247         getSourceAddress();
00248 
00249         virtual wns::service::dll::UnicastAddress
00250         getDestinationAddress(const wns::ldk::CompoundPtr&);
00251 
00252         virtual bool
00253         isBroadcast(const wns::ldk::CompoundPtr&);
00254     };
00255 
00256     class RACHShortcutBS:
00257         public RACHShortcut,
00258         public wns::Cloneable<RACHShortcutBS>
00259     {
00260     public:
00261         RACHShortcutBS(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00262         
00263         virtual ~RACHShortcutBS() {}
00264 
00265         virtual bool
00266         isReceiver();
00267     };
00268 
00269     class RACHShortcutUT:
00270         public RACHShortcut,
00271         public wns::Cloneable<RACHShortcutUT>
00272     {
00273     public:
00274         RACHShortcutUT(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00275 
00276         virtual ~RACHShortcutUT() {}
00277 
00278         virtual bool
00279         isReceiver();
00280     };
00281     
00282     } // macr
00283 } // lte
00284 
00285 #endif // LTE_MACR_RACH_HPP
00286 
00287 

Generated on Fri May 25 03:32:06 2012 for openWNS by  doxygen 1.5.5