![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 16, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef DLL_COMPOUNDSWITCH_FILTER_HPP 00029 #define DLL_COMPOUNDSWITCH_FILTER_HPP 00030 00031 #include <WNS/pyconfig/View.hpp> 00032 #include <WNS/logger/Logger.hpp> 00033 #include <WNS/StaticFactory.hpp> 00034 #include <WNS/ldk/Compound.hpp> 00035 00036 #include <DLL/compoundSwitch/CompoundSwitchConfigCreator.hpp> 00037 00038 namespace dll { namespace compoundSwitch { 00039 00040 class CompoundSwitch; 00041 00047 class IFilter 00048 { 00049 public: 00050 00051 virtual 00052 ~IFilter() {} 00053 00054 virtual void 00055 onFUNCreated() = 0; 00056 00057 virtual bool 00058 filter(const wns::ldk::CompoundPtr& compound) const = 0; 00059 00060 virtual std::string 00061 getName() const = 0; 00062 00063 }; 00064 00070 class Filter: 00071 public IFilter 00072 { 00073 public: 00074 00075 Filter(CompoundSwitch* compoundSwitch, wns::pyconfig::View& config); 00076 00077 virtual 00078 ~Filter(); 00079 00080 virtual void 00081 onFUNCreated() 00082 {} 00083 00084 virtual bool 00085 filter(const wns::ldk::CompoundPtr& compound) const = 0; 00086 00087 virtual std::string 00088 getName() const 00089 { 00090 return name_; 00091 } 00092 00093 bool 00094 operator==( const Filter& rhs) 00095 { 00096 return getName() == rhs.getName(); 00097 } 00098 00099 00100 00101 protected: 00102 00103 std::string name_; 00104 00105 CompoundSwitch* compoundSwitch_; 00106 wns::logger::Logger logger_; 00107 }; 00108 00109 typedef compoundSwitch::CompoundSwitchConfigCreator<Filter> FilterCreator; 00110 typedef wns::StaticFactory<FilterCreator> FilterFactory; 00111 00112 }} 00113 00114 #endif // NOT defined DLL_COMPOUNDSWITCH_FILTER_HPP
1.5.5