![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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_HELPER_HOPCONTEXTWINDOWPROBE_HPP 00030 #define WIFIMAC_HELPER_HOPCONTEXTWINDOWPROBE_HPP 00031 00032 #include <WNS/ldk/probe/bus/Window.hpp> 00033 #include <WNS/probe/bus/ContextCollector.hpp> 00034 #include <WNS/SlidingWindow.hpp> 00035 #include <WNS/ldk/CommandReaderInterface.hpp> 00036 #include <WNS/container/Registry.hpp> 00037 00038 #include <vector> 00039 00040 namespace wifimac { namespace helper { 00041 00048 class HopContextWindowProbe: 00049 public wns::ldk::probe::bus::Window 00050 { 00051 public: 00052 HopContextWindowProbe(wns::ldk::fun::FUN* fuNet, const wns::pyconfig::View& config); 00053 virtual ~HopContextWindowProbe(); 00054 00055 // Processor interface 00056 virtual void processIncoming(const wns::ldk::CompoundPtr& compound); 00057 00058 private: 00059 virtual void onFUNCreated(); 00060 00066 void 00067 putIntoBitsIncomming(unsigned int numHops, double value); 00068 00074 void 00075 putIntoBitsAggregated(unsigned int numHops, double value); 00076 00082 void 00083 putIntoCompoundsIncomming(unsigned int numHops, double value); 00084 00090 void 00091 putIntoCompoundsAggregated(unsigned int numHops, double value); 00092 00093 00095 wns::SlidingWindow* 00096 getProbe(SlidingWindowMap& probeHolder, PutterMap& putterHolder, std::string id, unsigned int numHops); 00097 00099 void 00100 periodically(); 00101 00105 void 00106 storeProbes(SlidingWindowMap& probeHolder, PutterMap& putterHolder); 00107 00109 wns::ldk::CommandReaderInterface* forwardingReader; 00110 00111 wns::pyconfig::View config_; 00112 const simTimeType windowSize; 00113 00116 typedef wns::container::Registry<int, wns::probe::bus::ContextCollectorPtr, wns::container::registry::DeleteOnErase> PutterMap; 00117 PutterMap bitsIncomingPutterHolder; 00118 PutterMap bitsAggregatedPutterHolder; 00119 PutterMap compoundsIncomingPutterHolder; 00120 PutterMap compoundsAggregatedPutterHolder; 00121 00124 typedef wns::container::Registry<int, wns::SlidingWindow*, wns::container::registry::DeleteOnErase> slidingWindowMap; 00125 slidingWindowMap bitsIncomingProbeHolder; 00126 slidingWindowMap bitsAggregatedProbeHolder; 00127 slidingWindowMap compoundsIncomingProbeHolder; 00128 slidingWindowMap compoundsAggregatedProbeHolder; 00129 00132 struct Friends 00133 { 00134 wifimac::multiradio::Manager* manager; 00135 } friends; 00136 }; 00137 00138 } // Helper 00139 } // WiFiMac 00140 00141 #endif
1.5.5