![]() |
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 LTE_MACG_MACG_HPP 00029 #define LTE_MACG_MACG_HPP 00030 00031 #include <LTE/macg/MACgCommand.hpp> 00032 #include <LTE/main/Layer2.hpp> 00033 #include <LTE/macr/ScorerInterface.hpp> 00034 00035 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00036 #include <WNS/ldk/Forwarding.hpp> 00037 #include <WNS/ldk/FUNConfigCreator.hpp> 00038 #include <WNS/logger/Logger.hpp> 00039 00040 namespace lte { namespace macg { namespace modeselection { class Strategy; }}} 00041 00042 namespace lte { namespace macg { 00043 00044 class MACg; 00045 class Best; 00046 00047 typedef std::vector<lte::macr::ScorerInterface*> ScorerContainer; 00048 typedef std::vector<wns::ldk::IConnectorReceptacle*> LayerContainer; 00049 00050 class MACgScheduler : 00051 public wns::ldk::Connector 00052 { 00053 public: 00054 00055 MACgScheduler() : 00056 macg(NULL), 00057 logger(NULL){}; 00058 00059 virtual ~MACgScheduler(); 00060 00061 virtual unsigned long int 00062 size() const; 00063 00064 virtual lte::helper::Route 00065 getRoute(const wns::ldk::CompoundPtr& compound); 00066 00067 void 00068 addDestination(lte::macr::ScorerInterface* scorer); 00069 00070 virtual 00071 void setStrategy(lte::macg::modeselection::Strategy* strategy); 00072 00073 // Link Interface 00074 virtual void 00075 add(wns::ldk::IConnectorReceptacle*); 00076 00077 virtual void 00078 clear(){assure(false, "clear not supported.");}; 00079 00080 virtual const wns::ldk::Link<wns::ldk::IConnectorReceptacle>::ExchangeContainer 00081 get() const 00082 { 00083 assure(false, "Exchange not supported."); 00084 return wns::ldk::Link<wns::ldk::IConnectorReceptacle>::ExchangeContainer(); 00085 } 00086 00087 virtual void 00088 set(const wns::ldk::Link<wns::ldk::IConnectorReceptacle>::ExchangeContainer&) 00089 { 00090 assure(false, "set not supported."); 00091 } 00092 00096 void setLogger(const wns::pyconfig::View& config); 00097 00098 protected: 00099 // coupling the MACg with the MACgScheduler(below) 00100 void 00101 setMACg(MACg* _macg); 00102 00103 // The FUs which are conneted with the connector set of MACg 00104 LayerContainer layers; 00105 00106 // To manage the (several) Scorers in the different modes 00107 ScorerContainer scorers; 00108 00109 MACg* macg; 00110 lte::macg::modeselection::Strategy* strategy; 00111 00112 // Logger Instance 00113 wns::logger::Logger* logger; 00114 }; // MACgScheduler 00115 00116 class MACg : 00117 virtual public wns::ldk::FunctionalUnit, 00118 public wns::ldk::CommandTypeSpecifier<MACgCommand> 00119 { 00120 public: 00121 MACg(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00122 00123 virtual ~MACg() {} 00124 00125 virtual void 00126 onFUNCreated(); 00127 00128 virtual wns::ldk::CommandPool* 00129 createReply(const wns::ldk::CommandPool* original) const; 00130 00131 protected: 00132 wns::ldk::fun::FUN* fun; 00133 00134 private: 00135 wns::pyconfig::View config; 00136 wns::logger::Logger logger; 00137 }; // MACg 00138 00139 } 00140 } 00141 00142 #endif // LTE_MACG_MACG_HPP 00143 00144
1.5.5