![]() |
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_FUN_MAIN_HPP 00029 #define WNS_LDK_FUN_MAIN_HPP 00030 00031 #include <WNS/ldk/fun/FUN.hpp> 00032 #include <WNS/ldk/Compound.hpp> 00033 #include <WNS/pyconfig/View.hpp> 00034 #include <WNS/node/Interface.hpp> 00035 00036 #include <map> 00037 #include <string> 00038 00039 namespace wns { namespace logger { 00040 class Logger; 00041 }} 00042 00043 namespace wns { namespace ldk { 00044 class ILayer; 00045 }} 00046 00047 namespace wns { namespace ldk { namespace fun { 00048 00055 class Main : 00056 public virtual FUN 00057 { 00058 public: 00059 typedef std::map<std::string, FunctionalUnit*> FunctionalUnitMap; 00060 00064 Main(ILayer* layer); 00065 00072 Main(ILayer* layer, const wns::pyconfig::View& _config); 00073 00074 virtual ~Main(); 00075 00076 // 00077 // FUN interface realization 00078 // 00079 00080 // FUN construction 00081 virtual void addFunctionalUnit(const std::string& commandName, 00082 const std::string& functionalUnitName, 00083 FunctionalUnit* functionalUnit); 00084 virtual void addFunctionalUnit(const std::string& name, FunctionalUnit* functionalUnit); 00085 virtual void removeFunctionalUnit(const std::string& name); 00086 00087 virtual void connectFunctionalUnit( 00088 const std::string& upperName, const std::string& lowerName, 00089 const std::string& srcPort = "SinglePort", const std::string& dstPort = "SinglePort"); 00090 00091 virtual void upConnectFunctionalUnit( 00092 const std::string& upperName, const std::string& lowerName, 00093 const std::string& srcPort = "SinglePort", const std::string& dstPort = "SinglePort"); 00094 00095 virtual void downConnectFunctionalUnit( 00096 const std::string& upperName, const std::string& lowerName, 00097 const std::string& srcPort = "SinglePort", const std::string& dstPort = "SinglePort"); 00098 00099 // virtual void reconfigureFUN(const wns::pyconfig::View& reconfig); 00100 00101 // FU access 00102 virtual FunctionalUnit* getFunctionalUnit(const std::string& name) const; 00103 virtual bool knowsFunctionalUnit(const std::string& name) const; 00104 00105 // getter 00106 virtual CommandProxy* getProxy() const; 00107 virtual ILayer* getLayer() const; 00108 virtual std::string getName() const; 00109 virtual LinkHandlerInterface* getLinkHandler() const; 00110 virtual CommandReaderInterface* getCommandReader(const std::string& commandName) const; 00111 00112 // 00113 // delayed configuration with optional verbosity 00114 // 00115 void onFUNCreated(wns::logger::Logger* logger = NULL); 00116 00117 private: 00118 ILayer* layer; 00119 CommandProxy* proxy; 00120 FunctionalUnitMap fuMap; 00121 LinkHandlerInterface* linkHandler; 00122 wns::logger::Logger logger; 00123 }; 00124 00125 }}} 00126 00127 00128 00129 #endif // NOT defined WNS_LDK_FUN_MAIN_HPP 00130 00131
1.5.5