![]() |
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_SOFTSAR_HPP 00029 #define WNS_LDK_SOFTSAR_HPP 00030 00031 #include <WNS/ldk/HasReceptor.hpp> 00032 #include <WNS/ldk/HasConnector.hpp> 00033 #include <WNS/ldk/HasDeliverer.hpp> 00034 #include <WNS/ldk/Delayed.hpp> 00035 #include <WNS/ldk/Compound.hpp> 00036 00037 #include <WNS/ldk/sar/SAR.hpp> 00038 #include <WNS/ldk/ErrorRateProviderInterface.hpp> 00039 00040 #include <WNS/probe/bus/ContextCollector.hpp> 00041 00042 #include <WNS/pyconfig/View.hpp> 00043 00044 #include <list> 00045 00046 namespace wns { namespace ldk { namespace sar 00047 { 00053 class SoftCommand : 00054 public SARCommand, 00055 virtual public wns::ldk::ErrorRateProviderInterface 00056 { 00057 double PER; 00058 std::string info; 00059 public: 00060 SoftCommand(); 00061 virtual double getErrorRate() const; 00062 void setPER(const double _PER); 00063 00064 virtual std::string getInfo() const 00065 { return info; } 00066 00067 virtual void setInfo(const std::string& _info) 00068 { info = _info; } 00069 }; 00070 00078 class Soft : 00079 public wns::ldk::sar::SAR<SoftCommand>, 00080 public wns::ldk::HasReceptor<>, 00081 public wns::ldk::HasConnector<>, 00082 public wns::ldk::HasDeliverer<>, 00083 public wns::ldk::Delayed<Soft>, 00084 public wns::Cloneable<Soft> 00085 { 00086 public: 00087 Soft(wns::ldk::fun::FUN* fuNet, const wns::pyconfig::View& config); 00088 ~Soft(); 00089 00090 // 00091 // Completion of Processor interface 00092 // 00093 virtual void processIncoming(const wns::ldk::CompoundPtr& compound); 00094 00095 // To obtain a pointer to our PER Provider 00096 virtual void onFUNCreated(); 00097 00098 private: 00099 typedef std::pair<wns::ldk::CompoundPtr, double> PERStorageEntry; 00100 typedef std::list<PERStorageEntry> PERStorageContainer; 00101 00102 PERStorageContainer incoming; 00103 int fragmentNumber; 00104 00105 std::string PERProviderName; 00106 00107 struct Friends { 00108 wns::ldk::FunctionalUnit* PERProvider; 00109 } friends; 00110 00111 bool useProbe; 00112 std::string probeName; 00113 wns::probe::bus::ContextCollectorPtr perProbeBus; 00114 }; 00115 }}} 00116 00117 #endif // NOT defined WNS_LDK_SOFTSAR_HPP 00118 00119
1.5.5