![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /****************************************************************************** 00002 * WiMeMac * 00003 * This file is part of openWNS (open Wireless Network Simulator) 00004 * _____________________________________________________________________________ 00005 * 00006 * Copyright (C) 2004-2011 00007 * Chair of Communication Networks (ComNets) 00008 * Kopernikusstr. 5, 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 WIMEMAC_DRPmap_H 00030 #define WIMEMAC_DRPmap_H 00031 #include <WNS/logger/Logger.hpp> 00032 #include <vector> 00033 #include <WNS/service/dll/Address.hpp> 00034 00035 #include <WNS/container/Registry.hpp> 00036 00037 00038 00039 namespace wimemac { 00040 namespace drp { 00041 typedef std::vector<bool> Vector; 00042 00043 class DRPmap 00044 { 00045 public: 00046 DRPmap(int gMASpSF); 00047 void UpdateHardDRPmap(Vector, wns::logger::Logger _logger); 00048 void UpdateSoftDRPmap(Vector, wns::logger::Logger _logger); 00049 void UpdateDRPmap(Vector UpdateMap, Vector& UpdatedMap); 00050 bool PossiblePattern(Vector CompareDRPMap); 00051 void GetPattern(wns::logger::Logger _logger); 00052 void GetGlobalPattern(Vector& GlobalPattern); 00053 bool IsSpaceInGlobalPattern(); 00054 Vector GetGlobalHardDRPmap(); 00055 bool isPatternValidated(); // Returns true if DRP-Map has no additional entries that appear just once 00056 00057 void SetLogger(wns::logger::Logger _logger); 00058 00059 void setBPSlots(int numberOfBPSlots_); 00060 00061 // Start of a new BP -> clear globalDRPMaps from slots not announced during the last mMaxLostBeacons beacons 00062 void onBPStarted(); 00063 00064 private: 00065 std::deque<Vector> globalHardDRPmapVec; 00066 std::deque<Vector> globalSoftDRPmapVec; 00067 std::deque<Vector> globalEraseDRPmapVec; 00068 int mMaxLostBeacons; 00069 int numberOfBPSlots; 00070 bool isPatternValid; 00071 00072 Vector globalHardDRPmap; 00073 Vector globalSoftDRPmap; 00074 Vector globalEraseDRPmap; 00075 00076 wns::logger::Logger logger; 00077 }; 00078 } 00079 } 00080 #endif 00081
1.5.5