![]() |
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_CONVERGENCE_TXDURATIONSETTER_HPP 00030 #define WIFIMAC_CONVERGENCE_TXDURATIONSETTER_HPP 00031 00032 #include <WIFIMAC/lowerMAC/Manager.hpp> 00033 #include <WIFIMAC/management/ProtocolCalculator.hpp> 00034 00035 #include <WNS/ldk/fu/Plain.hpp> 00036 #include <WNS/ldk/Processor.hpp> 00037 00038 namespace wifimac { namespace convergence { 00039 00040 class TxDurationProviderCommand 00041 { 00042 public: 00043 virtual wns::simulator::Time getDuration() const = 0; 00044 virtual ~TxDurationProviderCommand() {}; 00045 }; 00046 00047 class TxDurationSetterCommand: 00048 public wns::ldk::Command, 00049 public TxDurationProviderCommand 00050 { 00051 public: 00052 TxDurationSetterCommand() 00053 { 00054 local.txDuration = 0; 00055 }; 00056 00057 struct { 00058 wns::simulator::Time txDuration; 00059 } local; 00060 00061 struct {} peer; 00062 struct {} magic; 00063 00064 wns::simulator::Time getDuration() const { return local.txDuration; } 00065 }; 00066 00072 class TxDurationSetter : 00073 public wns::ldk::fu::Plain<TxDurationSetter, TxDurationSetterCommand>, 00074 public wns::ldk::Processor<TxDurationSetter> 00075 { 00076 public: 00077 00078 TxDurationSetter(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00079 00080 virtual 00081 ~TxDurationSetter(); 00082 00083 private: 00085 void processIncoming(const wns::ldk::CompoundPtr& compound); 00086 void processOutgoing(const wns::ldk::CompoundPtr& compound); 00087 00088 void onFUNCreated(); 00089 00090 const std::string protocolCalculatorName; 00091 const std::string managerName; 00092 wns::logger::Logger logger; 00093 wifimac::management::ProtocolCalculator* protocolCalculator; 00094 00095 struct Friends 00096 { 00097 wifimac::lowerMAC::Manager* manager; 00098 } friends; 00099 }; 00100 00101 00102 } // mac 00103 } // wifimac 00104 00105 #endif // WIFIMAC_CONVERGENCE_TXDURATIONSETTER_HPP
1.5.5