![]() |
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-2009 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * email: info@openwns.org 00009 * www: http://www.openwns.org 00010 * _____________________________________________________________________________ 00011 * 00012 * openWNS is free software; you can redistribute it and/or modify it under the 00013 * terms of the GNU Lesser General Public License version 2 as published by the 00014 * Free Software Foundation; 00015 * 00016 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00017 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00018 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00019 * details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public License 00022 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00023 * 00024 ******************************************************************************/ 00025 00026 #ifndef WIMAC_PHYACCESSFUNC_H 00027 #define WIMAC_PHYACCESSFUNC_H 00028 00029 #include <WNS/ldk/Compound.hpp> 00030 #include <WNS/service/phy/ofdma/Pattern.hpp> 00031 #include <WNS/Cloneable.hpp> 00032 #include <WNS/service/phy/phymode/PhyModeInterface.hpp> 00033 00034 namespace wns { namespace node { 00035 class Interface; 00036 }} 00037 00038 namespace wimac { 00039 class PhyUser; 00040 00053 class PhyAccessFunc : 00054 public virtual wns::CloneableInterface 00055 { 00056 public: 00057 virtual void operator()( PhyUser*, const wns::ldk::CompoundPtr& compound) = 0; 00058 virtual ~PhyAccessFunc(){} 00059 PhyAccessFunc(): 00060 transmissionStart_(-1.0), 00061 transmissionStop_(-1.0), 00062 subBand_(0), 00063 beam_(0), 00064 timeSlot_(-1), 00065 phyMode_() 00066 {} 00067 wns::simulator::Time transmissionStart_; 00068 wns::simulator::Time transmissionStop_; 00069 int subBand_; 00070 int beam_; 00071 int timeSlot_; 00072 wns::service::phy::phymode::PhyModeInterfacePtr phyMode_; 00073 }; 00074 00079 class BroadcastPhyAccessFunc : 00080 public wimac::PhyAccessFunc, 00081 public wns::Cloneable<BroadcastPhyAccessFunc> 00082 { 00083 public: 00084 virtual void 00085 operator()( wimac::PhyUser* , const wns::ldk::CompoundPtr& ); 00086 00087 private: 00088 }; 00089 00093 class OmniUnicastPhyAccessFunc : 00094 public PhyAccessFunc, 00095 public wns::Cloneable<OmniUnicastPhyAccessFunc> 00096 { 00097 public: 00098 virtual void operator()( PhyUser*, const wns::ldk::CompoundPtr& ); 00099 00100 wns::node::Interface* destination_; 00101 wns::Power requestedTxPower_; 00102 }; 00103 00108 class BeamformingPhyAccessFunc : 00109 public PhyAccessFunc, 00110 public wns::Cloneable<BeamformingPhyAccessFunc> 00111 { 00112 public: 00113 virtual void operator()( PhyUser*, const wns::ldk::CompoundPtr& ); 00114 00115 wns::node::Interface* destination_; 00116 wns::service::phy::ofdma::PatternPtr pattern_; 00117 wns::Power requestedTxPower_; 00118 }; 00119 00124 class PatternSetterPhyAccessFunc : 00125 public PhyAccessFunc, 00126 public wns::Cloneable<PatternSetterPhyAccessFunc> 00127 { 00128 public: 00129 virtual void operator()( PhyUser*, const wns::ldk::CompoundPtr& ); 00130 00131 wns::node::Interface* destination_; 00132 wns::simulator::Time patternStart_; 00133 wns::simulator::Time patternEnd_; 00134 wns::service::phy::ofdma::PatternPtr pattern_; 00135 }; 00136 /* @} */ 00137 00146 class StopTransmission 00147 { 00148 public: 00149 StopTransmission( wimac::PhyUser* phyUser, const wns::ldk::CompoundPtr& compound, int subBand = 0) : 00150 phyUser_( phyUser ), 00151 compound_( compound ), 00152 subBand_( subBand ) 00153 {} 00154 00155 void operator()(); 00156 00157 private: 00158 wimac::PhyUser* phyUser_; 00159 wns::ldk::CompoundPtr compound_; 00160 int subBand_; 00161 }; 00165 class StartBroadcastTransmission 00166 { 00167 public: 00168 StartBroadcastTransmission( wimac::PhyUser* phyUser, 00169 const wns::ldk::CompoundPtr& compound, 00170 wns::service::phy::phymode::PhyModeInterfacePtr phyMode, 00171 int subBand = 0): 00172 phyUser_( phyUser ), 00173 compound_( compound ), 00174 subBand_( subBand ), 00175 phyMode_( phyMode ) 00176 {} 00177 00178 void operator()(); 00179 00180 protected: 00181 wimac::PhyUser* phyUser_; 00182 wns::ldk::CompoundPtr compound_; 00183 int subBand_; 00184 const wns::service::phy::phymode::PhyModeInterfacePtr phyMode_; 00185 }; 00186 00191 class StartTransmission 00192 { 00193 public: 00194 StartTransmission( wimac::PhyUser* phyUser, 00195 const wns::ldk::CompoundPtr& compound, 00196 wns::node::Interface* dstStation, 00197 const wns::service::phy::phymode::PhyModeInterfacePtr phyMode, 00198 int subBand, 00199 wns::Power requestedTxPower) : 00200 phyUser_( phyUser ), 00201 compound_( compound ), 00202 dstStation_( dstStation ), 00203 subBand_( subBand ), 00204 phyMode_( phyMode ), 00205 requestedTxPower_( requestedTxPower ) 00206 {} 00207 00208 void operator()(); 00209 00210 protected: 00211 wimac::PhyUser* phyUser_; 00212 wns::ldk::CompoundPtr compound_; 00213 wns::node::Interface* dstStation_; 00214 const wns::service::phy::phymode::PhyModeInterfacePtr phyMode_; 00215 int subBand_; 00216 wns::Power requestedTxPower_; 00217 }; 00218 00223 class StartBeamformingTransmission : 00224 public StartTransmission 00225 { 00226 public: 00227 StartBeamformingTransmission( wimac::PhyUser* phyUser, 00228 const wns::ldk::CompoundPtr& compound, 00229 wns::node::Interface* dstStation, 00230 wns::service::phy::ofdma::PatternPtr pattern, 00231 int subBand, 00232 wns::Power requestedTxPower, 00233 wns::service::phy::phymode::PhyModeInterfacePtr phyMode) : 00234 StartTransmission( phyUser, compound, dstStation, phyMode, subBand, requestedTxPower), 00235 pattern_(pattern) 00236 {} 00237 00238 void operator()(); 00239 00240 protected: 00241 wns::service::phy::ofdma::PatternPtr pattern_; 00242 }; 00243 00247 class SetPattern 00248 { 00249 public: 00250 SetPattern( wimac::PhyUser* phyUser, 00251 wns::node::Interface* dstStation, 00252 wns::service::phy::ofdma::PatternPtr pattern ) : 00253 phyUser_(phyUser), 00254 dstStation_(dstStation), 00255 pattern_(pattern) 00256 {} 00257 00258 void operator()(); 00259 00260 protected: 00261 wimac::PhyUser* phyUser_; 00262 wns::node::Interface* dstStation_; 00263 wns::service::phy::ofdma::PatternPtr pattern_; 00264 }; 00265 00270 class RemovePattern 00271 { 00272 public: 00273 RemovePattern( wimac::PhyUser* phyUser, 00274 wns::node::Interface* dstStation) : 00275 phyUser_(phyUser), 00276 dstStation_(dstStation) 00277 {} 00278 00279 void operator()(); 00280 protected: 00281 wimac::PhyUser* phyUser_; 00282 wns::node::Interface* dstStation_; 00283 }; 00284 /* @} */ 00285 } 00286 00287 #endif
1.5.5