User Manual, Developers Guide and API Documentation

Propagation.hpp

Go to the documentation of this file.
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 _RISE_SCENARIO_PROPAGATION_HPP
00029 #define _RISE_SCENARIO_PROPAGATION_HPP
00030 
00031 #include <RISE/scenario/pathloss/Pathloss.hpp>
00032 #include <RISE/scenario/shadowing/Shadowing.hpp>
00033 #include <RISE/scenario/fastfading/FastFading.hpp>
00034 
00035 #include <WNS/container/Matrix.hpp>
00036 #include <WNS/StaticFactoryBroker.hpp>
00037 #include <WNS/Broker.hpp>
00038 #include <WNS/Singleton.hpp>
00039 #include <WNS/pyconfig/View.hpp>
00040 #include <WNS/Ttos.hpp>
00041 #include <WNS/Exception.hpp>
00042 
00043 #include <string>
00044 
00045 namespace rise { namespace scenario { 
00046 
00052     class Propagation
00053     {
00054     typedef wns::container::Matrix<pathloss::Pathloss*, 2> PathlossMatrix;
00055     typedef wns::container::Matrix<shadowing::Shadowing*, 2> ShadowingMatrix;
00056     typedef wns::container::Matrix<fastfading::FastFading*, 2> FastFadingMatrix;
00057     public:
00058 
00059     typedef PathlossMatrix::SizeType IdType;
00060 
00064     class NoModelError :
00065         public wns::Exception
00066     {
00067     public:
00068         NoModelError(const std::string& modelType,
00069              const std::string& transmitterName,
00070              const std::string& receiverName);
00071     
00072         virtual ~NoModelError() throw() {};
00073     };
00074 
00075     Propagation(const wns::pyconfig::View& config);
00076 
00077     virtual
00078     ~Propagation();
00079 
00085     const pathloss::Pathloss&
00086     getPathlossModel(const IdType& transmitterId, const IdType& receiverId) const;
00087 
00093     const shadowing::Shadowing&
00094     getShadowingModel(const IdType& transmitterId, const IdType& receiverId) const;
00095 
00101     const fastfading::FastFading&
00102     getFastFadingModel(const IdType& transmitterId, const IdType& receiverId) const;
00103 
00107     template<class C>
00108     static C*
00109     create(const wns::pyconfig::View& config)
00110     {
00111         const std::string model = config.get<std::string>("__plugin__");
00112         return getBroker<C>().procure(model, config);
00113     }
00114 
00115     std::string
00116     getName(const IdType& id) const;
00117 
00118     private:
00119     PathlossMatrix pathlossMatrix;
00120     ShadowingMatrix shadowingMatrix;
00121     FastFadingMatrix fastFadingMatrix;
00122 
00123     const wns::pyconfig::View config;
00124 
00125     template<class C>
00126     static wns::StaticFactoryBroker<C, wns::PyConfigViewCreator<C> >&
00127     getBroker()
00128     {
00129         static wns::StaticFactoryBroker<C, wns::PyConfigViewCreator<C> > broker;
00130         return broker;
00131     }
00132 
00133     };
00134 
00135     typedef wns::Broker<Propagation> PropagationBroker;
00136     typedef wns::SingletonHolder<PropagationBroker> GlobalPropagationBroker;
00137 
00138 } // scenario
00139 } // rise
00140 
00141 #endif // NOT defined _RISE_SCENARIO_PROPAGATION_HPP

Generated on Fri May 25 03:31:58 2012 for openWNS by  doxygen 1.5.5