![]() |
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 #include <WIFIMAC/management/ProtocolCalculator.hpp> 00030 00031 using namespace wifimac::management; 00032 00033 STATIC_FACTORY_REGISTER_WITH_CREATOR(ProtocolCalculator, 00034 wns::ldk::ManagementServiceInterface, 00035 "wifimac.management.ProtocolCalculator", 00036 wns::ldk::MSRConfigCreator); 00037 00038 ProtocolCalculator::ProtocolCalculator( wns::ldk::ManagementServiceRegistry* msr, const wns::pyconfig::View& config_): 00039 wns::ldk::ManagementService(msr), 00040 logger(config_.get("logger")), 00041 config(config_) 00042 { 00043 errorProbability = new protocolCalculatorPlugins::ErrorProbability(); 00044 frameLength = new protocolCalculatorPlugins::FrameLength(config_.get<wns::pyconfig::View>("myConfig.frameLength")); 00045 duration = new protocolCalculatorPlugins::Duration(frameLength, config_.get<wns::pyconfig::View>("myConfig.duration")); 00046 } 00047 00048 void 00049 ProtocolCalculator::onMSRCreated() 00050 { 00051 MESSAGE_SINGLE(NORMAL, logger, "Created."); 00052 } 00053 00054 00055 protocolCalculatorPlugins::ErrorProbability* 00056 ProtocolCalculator::getErrorProbability() const 00057 { 00058 return errorProbability; 00059 } 00060 00061 protocolCalculatorPlugins::FrameLength* 00062 ProtocolCalculator::getFrameLength() const 00063 { 00064 return frameLength; 00065 } 00066 00067 protocolCalculatorPlugins::Duration* 00068 ProtocolCalculator::getDuration() const 00069 { 00070 return duration; 00071 }
1.5.5