![]() |
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_SUB_HPP 00029 #define WNS_LDK_FUN_SUB_HPP 00030 00031 #include <WNS/ldk/fun/FUN.hpp> 00032 #include <WNS/pyconfig/View.hpp> 00033 #include <WNS/node/Interface.hpp> 00034 #include <WNS/Cloneable.hpp> 00035 00036 #include <map> 00037 #include <string> 00038 00039 00040 namespace wns { namespace ldk { namespace fun { 00041 00048 class Sub : 00049 public virtual FUN 00050 { 00051 public: 00052 typedef std::map<std::string, FunctionalUnit*> FunctionalUnitMap; 00053 00054 Sub(fun::FUN* fuNet); 00055 virtual ~Sub(); 00056 00057 // 00058 // FUN interface realization 00059 // 00060 00061 // FUN construction 00062 virtual void addFunctionalUnit(const std::string& commandName, const std::string& functionalUnitName, FunctionalUnit* functionalUnit); 00063 virtual void addFunctionalUnit(const std::string& name, FunctionalUnit* functionalUnit); 00064 virtual void removeFunctionalUnit(const std::string& name); 00065 virtual void connectFunctionalUnit( 00066 const std::string& upperName, const std::string& lowerName, 00067 const std::string& srcPort = "SinglePort", const std::string& dstPort = "SinglePort"); 00068 00069 virtual void upConnectFunctionalUnit( 00070 const std::string& upperName, const std::string& lowerName, 00071 const std::string& srcPort = "SinglePort", const std::string& dstPort = "SinglePort"); 00072 00073 virtual void downConnectFunctionalUnit( 00074 const std::string& upperName, const std::string& lowerName, 00075 const std::string& srcPort = "SinglePort", const std::string& dstPort = "SinglePort"); 00076 00077 // virtual void reconfigureFUN(const wns::pyconfig::View& reconfig); 00078 virtual void removeFUsFromCommandPool(); 00079 00080 // FU access 00081 virtual FunctionalUnit* getFunctionalUnit(const std::string& name) const; 00082 virtual bool knowsFunctionalUnit(const std::string& name) const; 00083 00084 // setter 00085 virtual void setNameParentFU(std::string _name); 00086 00087 // getter 00088 virtual CommandProxy* getProxy() const; 00089 virtual ILayer* getLayer() const; 00090 virtual std::string getName() const; 00091 virtual LinkHandlerInterface* getLinkHandler() const; 00092 virtual CommandReaderInterface* getCommandReader(const std::string& commandName) const; 00093 virtual std::string getNameParentFU() const; 00094 00095 // delayed configuration 00096 void onFUNCreated(); 00097 00098 00099 // 00100 // new stuff 00101 // 00102 fun::FUN* 00103 getParent() 00104 { 00105 return parent; 00106 } // getParent 00107 00108 // fun::Sub* clone() const; 00109 00110 private: 00111 virtual bool _knowsFunctionalUnit(const std::string& name) const; 00112 /* 00113 template<RECEPTACLETYPE> 00114 void 00115 translateLink(Link<RECEPTACLETYPE>* link, 00116 const std::map<RECEPTACLETYPE*,RECEPTACLETYPE*>& translate); 00117 */ 00118 fun::FUN* parent; 00119 ILayer* layer; 00120 CommandProxy* proxy; 00121 FunctionalUnitMap fuMap; 00122 LinkHandlerInterface* linkHandler; 00123 std::string nameParentFU; 00124 }; 00125 00126 }}} 00127 00128 00129 00130 #endif // NOT defined WNS_LDK_FUN_SUB_HPP 00131 00132
1.5.5