User Manual, Developers Guide and API Documentation

PhyUser.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-2009
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 
00029 #ifndef WIMAC_PHYUSER_HPP
00030 #define WIMAC_PHYUSER_HPP
00031 
00032 #include <WNS/node/Node.hpp>
00033 #include <WNS/probe/bus/ContextCollector.hpp>
00034 #include <WNS/probe/bus/json/probebus.hpp>
00035 
00036 #include <WNS/ldk/FunctionalUnit.hpp>
00037 #include <WNS/ldk/Compound.hpp>
00038 #include <WNS/ldk/CommandTypeSpecifier.hpp>
00039 #include <WNS/ldk/HasReceptor.hpp>
00040 #include <WNS/ldk/HasConnector.hpp>
00041 #include <WNS/ldk/HasDeliverer.hpp>
00042 #include <WNS/ldk/Receptor.hpp>
00043 #include <WNS/ldk/Connector.hpp>
00044 
00045 #include <WNS/service/phy/ofdma/Handler.hpp>
00046 #include <WNS/service/phy/ofdma/Notification.hpp>
00047 #include <WNS/service/phy/ofdma/DataTransmission.hpp>
00048 #include <WNS/service/dll/Address.hpp>
00049 
00050 #include <WNS/pyconfig/View.hpp>
00051 
00052 #include <WIMAC/PhyUserCommand.hpp>
00053 #include <WIMAC/scheduler/RegistryProxyWiMAC.hpp>
00054 
00055 
00056 #include <WNS/service/phy/phymode/PhyModeMapperInterface.hpp>
00057 
00058 namespace wns { namespace node{
00059     class Node;
00060 }}
00061 
00062 namespace wns { namespace ldk { namespace fcf {
00063     class FrameBuilder;
00064 }}}
00065 
00066 namespace wimac {
00067 
00068     class GuiWriter;
00069     namespace service {
00070         class ConnectionManager;
00071         class InterferenceCache;
00072     }
00073 
00074     class ConnectionClassifier;
00075     class Layer2;
00076     class InterferenceCache;
00077 
00087     class PhyUser :
00088         public virtual wns::ldk::FunctionalUnit,
00089         public virtual wns::service::phy::ofdma::Handler,
00090         public wns::ldk::CommandTypeSpecifier< PhyUserCommand >,
00091         public wns::ldk::HasReceptor<>,
00092         public wns::ldk::HasConnector<>,
00093         public wns::ldk::HasDeliverer<>,
00094         public wns::Cloneable<PhyUser>
00095     {
00096         enum States {initial, receiving, measuring};
00097 
00098     public:
00099         PhyUser(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00100         PhyUser( const PhyUser& rhs );
00101         virtual ~PhyUser();
00102 
00103         // CompoundHandlerInterface
00104         virtual bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00105         virtual void doSendData(const wns::ldk::CompoundPtr& sdu);
00106         virtual void doOnData(const wns::ldk::CompoundPtr& compound);
00107         virtual void doWakeup();
00108 
00109         // Interface to lower layer (phy)
00114         virtual void
00115         onData(wns::SmartPtr<wns::osi::PDU>,
00116                wns::service::phy::power::PowerMeasurementPtr);
00117 
00118         // Handling of the services
00119         virtual void
00120         setNotificationService(wns::service::Service* phy);
00121 
00122         virtual wns::service::phy::ofdma::Notification*
00123         getNotificationService() const;
00124 
00125         virtual void
00126         setDataTransmissionService(wns::service::Service* phy);
00127 
00128         virtual wns::service::phy::ofdma::DataTransmission*
00129         getDataTransmissionService() const;
00130 
00131         virtual void
00132         setMACAddress(const wns::service::dll::UnicastAddress& address);
00133 
00134         void onFUNCreated();
00135 
00136     private:
00137         void
00138         traceIncoming(wns::ldk::CompoundPtr compound, wns::service::phy::power::PowerMeasurementPtr rxPowerMeasurement);
00139 
00140         bool 
00141         filter(const wns::ldk::CompoundPtr& compound);
00142 
00143         // point in time when last C/I measurement was written to
00144         // interference cache
00145         wns::simulator::Time cacheEntryTimeStamp;
00146 
00150         const wns::simulator::Time maxAgeCacheEntry;
00151 
00152         int lastInterferenceSlot;
00153         wns::Power interferenceForSlot;
00154 
00155         struct{
00156 
00157             wns::probe::bus::ContextCollectorPtr interferenceSDMA;
00158             wns::probe::bus::ContextCollectorPtr carrierSDMA;
00159             wns::probe::bus::ContextCollectorPtr cirSDMA;
00160             wns::probe::bus::ContextCollectorPtr deltaPHYModeSDMA;
00161             wns::probe::bus::ContextCollectorPtr PHYModeSDMA;
00162             wns::probe::bus::ContextCollectorPtr deltaInterferenceSDMA;
00163             wns::probe::bus::ContextCollectorPtr deltaCarrierSDMA;
00164             wns::probe::bus::ContextCollectorPtr interferenceFrameHead;
00165             wns::probe::bus::ContextCollectorPtr cirFrameHead;
00166             wns::probe::bus::ContextCollectorPtr interferenceContention;
00167             wns::probe::bus::ContextCollectorPtr cirContention;
00168             wns::probe::bus::ContextCollectorPtr pathloss;
00169             wns::probe::bus::ContextCollectorPtr jsonTracing;
00170         } probes_;
00171 
00172         wns::simulator::Time safetyFraction;
00173         wns::events::scheduler::Interface* es;
00174 
00175         wns::service::dll::UnicastAddress address;
00176         wns::service::phy::ofdma::DataTransmission* dataTransmission;
00177         wns::service::phy::ofdma::Notification* notificationService;
00178 
00179         struct Friends {
00180             std::string interferenceCacheName;
00181             std::string connectionManagerName;
00182             std::string connectionClassifierName;
00183             std::string dataCollectorName;
00184 
00185             wimac::Component* layer;
00186             service::InterferenceCache* interferenceCache;
00187             service::ConnectionManager* connectionManager;
00188             ConnectionClassifier* connectionClassifier;
00189             wimac::scheduler::RegistryProxyWiMAC* registry;
00190         } friends_;
00191     };
00192 }
00193 
00194 
00195 #endif

Generated on Sun May 27 03:32:05 2012 for openWNS by  doxygen 1.5.5