![]() |
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/helper/FilterSize.hpp> 00030 #include <DLL/compoundSwitch/CompoundSwitch.hpp> 00031 00032 using namespace wifimac::helper; 00033 00034 STATIC_FACTORY_REGISTER_WITH_CREATOR(FilterSize, 00035 dll::compoundSwitch::Filter, 00036 "wifimac.helper.FilterSize", 00037 dll::compoundSwitch::CompoundSwitchConfigCreator); 00038 00039 FilterSize::FilterSize(dll::compoundSwitch::CompoundSwitch* compoundSwitch, wns::pyconfig::View& config) : 00040 dll::compoundSwitch::Filter(compoundSwitch, config), 00041 minSize(config.get<Bit>("minSize")), 00042 maxSize(config.get<Bit>("maxSize")) 00043 { 00044 00045 } 00046 FilterSize::~FilterSize() 00047 { 00048 } 00049 00050 void 00051 FilterSize::onFUNCreated() 00052 { 00053 } 00054 00055 bool 00056 FilterSize::filter(const wns::ldk::CompoundPtr& compound) const 00057 { 00058 Bit len = compound->getLengthInBits(); 00059 return((len >= minSize) and (len <= maxSize)); 00060 }
1.5.5