![]() |
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. 5, 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 WNS_LDK_FLOWSEPARATOR_CREATORSTRATEGY_HPP 00029 #define WNS_LDK_FLOWSEPARATOR_CREATORSTRATEGY_HPP 00030 00031 #include <WNS/ldk/FunctionalUnit.hpp> 00032 00033 00034 namespace wns { namespace ldk { namespace flowseparator { 00035 00040 class CreatorStrategy 00041 { 00042 public: 00043 virtual 00044 ~CreatorStrategy() 00045 {} 00046 00050 virtual FunctionalUnit* 00051 create() const = 0; 00052 00056 virtual FunctionalUnit* 00057 createPrototype() const = 0; 00058 }; 00059 00064 class PrototypeCreator : 00065 public virtual CreatorStrategy 00066 { 00067 public: 00068 PrototypeCreator(fun::FUN* fuNet, const pyconfig::View& config); 00069 00070 PrototypeCreator(fun::FUN* fuNet, std::string name, FunctionalUnit* prototype); 00071 00072 FunctionalUnit* 00073 create() const; 00074 00075 FunctionalUnit* 00076 createPrototype() const; 00077 00078 private: 00079 FunctionalUnit* prototype; 00080 }; 00081 00086 class ConfigCreator : 00087 public virtual CreatorStrategy 00088 { 00089 public: 00090 ConfigCreator(fun::FUN* _fun, const pyconfig::View& _config); 00091 00092 FunctionalUnit* 00093 create() const; 00094 00095 FunctionalUnit* 00096 createPrototype() const; 00097 00098 private: 00099 wns::ldk::fun::FUN* fun; 00100 wns::pyconfig::View config; 00101 std::string creatorName; 00102 std::string commandName; 00103 }; 00104 00105 typedef FUNConfigCreator<CreatorStrategy> CreatorStrategyCreator; 00106 typedef wns::StaticFactory<CreatorStrategyCreator> CreatorStrategyFactory; 00107 00108 } // namespace flowseparator 00109 } // namespace ldk 00110 } // namespace wns 00111 00112 #endif // WNS_LDK_FLOWSEPARATOR_CREATORSTRATEGY_HPP
1.5.5