User Manual, Developers Guide and API Documentation

SINRInformationBase.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_MANAGEMENT_SINRINFORMATIONBASE_HPP
00030 #define WIFIMAC_MANAGEMENT_SINRINFORMATIONBASE_HPP
00031 
00032 #include <WNS/ldk/ManagementServiceInterface.hpp>
00033 #include <WNS/logger/Logger.hpp>
00034 #include <WNS/PowerRatio.hpp>
00035 #include <WNS/SlidingWindow.hpp>
00036 
00037 #include <WNS/service/dll/Address.hpp>
00038 #include <WNS/simulator/Time.hpp>
00039 
00040 #include <utility>
00041 
00042 
00043 namespace wifimac { namespace management {
00044 
00068     class SINRInformationBase:
00069         public wns::ldk::ManagementService
00070     {
00071     public:
00073         SINRInformationBase( wns::ldk::ManagementServiceRegistry*, const wns::pyconfig::View& config );
00074 
00076         virtual ~SINRInformationBase() {};
00077 
00078 
00086         void
00087         putMeasurement(const wns::service::dll::UnicastAddress tx,
00088                        const wns::Ratio sinr,
00089                        const wns::simulator::Time estimatedValidity = 0.0);
00090 
00092         bool
00093         knowsMeasuredSINR(const wns::service::dll::UnicastAddress tx);
00094 
00096         wns::Ratio
00097         getMeasuredSINR(const wns::service::dll::UnicastAddress tx);
00098 
00099 
00106         void
00107         putPeerSINR(const wns::service::dll::UnicastAddress peer,
00108                     const wns::Ratio sinr,
00109                     const wns::simulator::Time estimatedValidity = 0.0);
00110 
00112         bool
00113         knowsPeerSINR(const wns::service::dll::UnicastAddress peer);
00114 
00116         wns::Ratio
00117         getPeerSINR(const wns::service::dll::UnicastAddress peer);
00118 
00120         void
00121         putFakePeerSINR(const wns::service::dll::UnicastAddress peer,
00122                         const wns::Ratio sinr);
00123 
00124     private:
00125 
00127         void
00128         onMSRCreated();
00129 
00131         typedef wns::container::Registry<wns::service::dll::UnicastAddress, wns::SlidingWindow*, wns::container::registry::DeleteOnErase> slidingWindowMap;
00132 
00134         slidingWindowMap measuredSINRHolder;
00135 
00137         typedef wns::container::Registry<wns::service::dll::UnicastAddress, wns::Ratio*> ratioMap;
00138 
00140         ratioMap peerSINRHolder;
00141 
00142         typedef std::pair<wns::Ratio, wns::simulator::Time> ratioTimePair;
00143         typedef wns::container::Registry<wns::service::dll::UnicastAddress, ratioTimePair*> ratioWithTimeMap;
00144 
00146         ratioWithTimeMap lastMeasurement;
00147 
00149         ratioWithTimeMap lastPeerMeasurement;
00150 
00152         ratioWithTimeMap fakePeerMeasurement;
00153 
00155         wns::logger::Logger logger;
00156 
00158         const simTimeType windowSize;
00159 
00160     };
00161 } // management
00162 } // wifimac
00163 
00164 #endif

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