User Manual, Developers Guide and API Documentation

IRateAdaptationStrategy.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WiFiMac                                                                    *
00003  * This file is part of openWNS (open Wireless Network Simulator)
00004  * _____________________________________________________________________________
00005  *
00006  * Copyright (C) 2004-2007
00007  * Chair of Communication Networks (ComNets)
00008  * Kopernikusstr. 16, D-52074 Aachen, Germany
00009  * phone: ++49-241-80-27910,
00010  * fax: ++49-241-80-22242
00011  * email: info@openwns.org
00012  * www: http://www.openwns.org
00013  * _____________________________________________________________________________
00014  *
00015  * openWNS is free software; you can redistribute it and/or modify it under the
00016  * terms of the GNU Lesser General Public License version 2 as published by the
00017  * Free Software Foundation;
00018  *
00019  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00020  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00021  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00022  * details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public License
00025  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00026  *
00027  ******************************************************************************/
00028 
00029 #ifndef WIFIMAC_LOWERMAC_RATEADAPTATIONSTRATEGIES_IRATEADAPTATIONSTRATEGY_HPP
00030 #define WIFIMAC_LOWERMAC_RATEADAPTATIONSTRATEGIES_IRATEADAPTATIONSTRATEGY_HPP
00031 
00032 #include <WIFIMAC/convergence/PhyUser.hpp>
00033 #include <WIFIMAC/convergence/PhyMode.hpp>
00034 #include <WIFIMAC/management/PERInformationBase.hpp>
00035 #include <WIFIMAC/management/SINRInformationBase.hpp>
00036 #include <WIFIMAC/lowerMAC/Manager.hpp>
00037 
00038 #include <WNS/logger/Logger.hpp>
00039 #include <WNS/StaticFactory.hpp>
00040 #include <WNS/PowerRatio.hpp>
00041 
00042 namespace wifimac { namespace lowerMAC { namespace rateAdaptationStrategies {
00043 
00047     class IRateAdaptationStrategy
00048     {
00049     public:
00050         IRateAdaptationStrategy(const wns::pyconfig::View&,
00051                                 wns::service::dll::UnicastAddress receiver,
00052                                 wifimac::management::PERInformationBase*,
00053                                 wifimac::management::SINRInformationBase*,
00054                                 wifimac::lowerMAC::Manager*,
00055                                 wifimac::convergence::PhyUser*,
00056                                 wns::logger::Logger*)
00057             {};
00058         virtual ~IRateAdaptationStrategy()
00059             {};
00071         virtual wifimac::convergence::PhyMode
00072         getPhyMode(size_t numTransmissions) const = 0;
00073 
00077         virtual wifimac::convergence::PhyMode
00078         getPhyMode(size_t numTransmissions,
00079                    const wns::Ratio lqm) const = 0;
00080 
00085         virtual void
00086         setCurrentPhyMode(wifimac::convergence::PhyMode pm) = 0;
00087     };
00088 
00090     template <typename T, typename KIND = T>
00091     class IRateAdaptationStrategyCreator:
00092         public IRateAdaptationStrategyCreator<KIND, KIND>
00093     {
00094     public:
00095         virtual
00096         KIND* create(const wns::pyconfig::View& _config,
00097                      wns::service::dll::UnicastAddress _receiver,
00098                      wifimac::management::PERInformationBase* _per,
00099                      wifimac::management::SINRInformationBase* _sinr,
00100                      wifimac::lowerMAC::Manager* _manager,
00101                      wifimac::convergence::PhyUser* _phyUser,
00102                      wns::logger::Logger* _logger)
00103             {
00104                 return new T(_config, _receiver, _per, _sinr, _manager, _phyUser, _logger);
00105             }
00106     };
00107 
00108     template <typename KIND>
00109     class IRateAdaptationStrategyCreator<KIND, KIND>
00110     {
00111     public:
00112         virtual
00113         ~IRateAdaptationStrategyCreator() {};
00114 
00115         virtual KIND*
00116         create(const wns::pyconfig::View& _config,
00117                wns::service::dll::UnicastAddress _receiver,
00118                wifimac::management::PERInformationBase* _per,
00119                wifimac::management::SINRInformationBase* _sinr,
00120                wifimac::lowerMAC::Manager* _manager,
00121                wifimac::convergence::PhyUser* _phyUser,
00122                wns::logger::Logger* _logger) = 0;
00123     };
00124 
00125     typedef IRateAdaptationStrategyCreator<IRateAdaptationStrategy> RateAdaptationStrategyCreator;
00126     typedef wns::StaticFactory<RateAdaptationStrategyCreator> RateAdaptationStrategyFactory;
00127 }}}
00128 
00129 #endif

Generated on Thu May 24 03:32:09 2012 for openWNS by  doxygen 1.5.5