![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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 // #include <WNS/service/phy/phymode/PhyModeMapperInterface.hpp> 00028 00029 #ifndef WNS_SERVICE_PHY_PHYMODE_PHYMODEMAPPERINTERFACE_HPP 00030 #define WNS_SERVICE_PHY_PHYMODE_PHYMODEMAPPERINTERFACE_HPP 00031 00032 #include <string> 00033 #include <WNS/PowerRatio.hpp> 00034 #include <WNS/Interval.hpp> 00035 #include <WNS/StaticFactory.hpp> 00036 #include <WNS/pyconfig/View.hpp> 00037 #include <WNS/service/phy/phymode/PhyModeInterface.hpp> 00038 #include <WNS/SmartPtr.hpp> 00039 00040 namespace wns { namespace service { namespace phy { namespace phymode { 00041 00043 typedef wns::Interval<double> SINRRange; 00044 00046 const int UNDEFINED_PHYMODEINDEX = -1; 00047 00051 class PhyModeMapperInterface 00052 { 00053 public: 00054 virtual ~PhyModeMapperInterface() {} 00055 00057 virtual PhyModeInterfacePtr 00058 getBestPhyMode(const wns::Ratio& sinr) const = 0; 00059 00061 virtual wns::Ratio 00062 getMinSINRRatio(const wns::service::phy::phymode::PhyModeInterfacePtr phyMode) const = 0; 00063 00066 virtual bool 00067 sinrIsAboveLimit(const wns::Ratio& sinr) const = 0; 00068 00070 virtual PhyModeInterfacePtr 00071 getPhyModeForIndex(int index) const = 0; 00072 00074 virtual int 00075 getIndexForPhyMode(const wns::service::phy::phymode::PhyModeInterface& phyMode) const = 0; 00076 00078 virtual const wns::service::phy::phymode::PhyModeInterfacePtr 00079 getHighestPhyMode() const = 0; 00081 virtual const wns::service::phy::phymode::PhyModeInterfacePtr 00082 getLowestPhyMode() const = 0; 00083 00085 virtual double 00086 getMinSINR(const wns::service::phy::phymode::PhyModeInterfacePtr phyMode) const = 0; 00087 00089 virtual wns::service::phy::phymode::SINRRange 00090 getSINRRange(const wns::service::phy::phymode::PhyModeInterfacePtr phyMode) const = 0; 00091 00093 virtual double getMinimumSINR() const = 0; 00094 00096 virtual int 00097 getPhyModeCount() const = 0; 00098 00100 virtual const std::vector< wns::service::phy::phymode::PhyModeInterfacePtr > 00101 getListOfPhyModePtr() const = 0; 00102 00104 static PhyModeMapperInterface* 00105 getPhyModeMapper(const wns::pyconfig::View& config); 00106 00107 private: 00110 // /** @brief find best PhyMode for a given SINR */ 00111 // virtual const wns::service::phy::phymode::PhyModeInterface& 00112 // getBestPhyMode(double sinr /* dB */) const = 0; 00113 00114 // /** @brief find best PhyModeIndex for a given SINR (faster than above) */ 00115 // int 00116 // getBestPhyModeIndex(double sinr /* dB */) const; 00117 00118 // virtual bool sinrIsAboveLimit(double sinr /* dB */) const = 0; 00119 00120 }; 00121 00122 typedef wns::PyConfigViewCreator<PhyModeMapperInterface> PhyModeMapperCreator; 00123 typedef wns::StaticFactory<PhyModeMapperCreator> PhyModeMapperFactory; 00124 00126 inline PhyModeMapperInterface* 00127 createPhyModeMapper(const wns::pyconfig::View& config) 00128 { 00129 std::cout << "createPhyModeMapper() is obsolete. Use getPhyModeMapper to get a singleton!"<<std::endl; 00130 std::string nameInFactory = config.get<std::string>("nameInPhyModeMapperFactory"); 00131 return PhyModeMapperFactory::creator(nameInFactory)->create(config); 00132 } 00133 00134 } // phymode 00135 } // phy 00136 } // service 00137 } // wns 00138 00139 #endif // WNS_SERVICE_PHY_PHYMODE_PHYMODEMAPPERINTERFACE_HPP
1.5.5