![]() |
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_TOOLS_PERPROVIDERSTUB_HPP 00029 #define WNS_LDK_TOOLS_PERPROVIDERSTUB_HPP 00030 00031 #include <WNS/ldk/tools/Stub.hpp> 00032 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00033 #include <WNS/ldk/HasReceptor.hpp> 00034 #include <WNS/ldk/HasConnector.hpp> 00035 #include <WNS/ldk/HasDeliverer.hpp> 00036 #include <WNS/ldk/ErrorRateProviderInterface.hpp> 00037 00038 #include <WNS/Cloneable.hpp> 00039 #include <WNS/pyconfig/View.hpp> 00040 00041 #include <deque> 00042 00043 00044 namespace wns { namespace ldk { namespace tools { 00045 00046 // begin example "wns.ldk.tools.PERProviderCommand.example" 00051 class PERProviderPCI : 00052 public EmptyCommand, 00053 public ErrorRateProviderInterface 00054 { 00055 public: 00056 PERProviderPCI() 00057 : PER(0.0) 00058 {}; 00059 void 00060 setPER(double _PER){ PER = _PER; }; 00061 00062 virtual double 00063 getErrorRate() const { return PER; } 00064 private: 00065 double PER; 00066 }; // PERProviderPCI 00067 // end example 00068 00069 // begin example "wns.ldk.tools.PERProviderStub.example" 00070 class PERProviderStub : 00071 public StubBase, 00072 public CommandTypeSpecifier<PERProviderPCI>, 00073 public Cloneable<PERProviderStub> 00074 // end example 00075 { 00076 public: 00081 PERProviderStub(fun::FUN* fuNet, const pyconfig::View& config); 00082 00083 // begin example "wns.ldk.tools.PERProviderStub.calculateSizes.example" 00084 // we need a unique overrider 00085 virtual void 00086 calculateSizes(const CommandPool* commandPool, Bit& commandPoolSize, Bit& dataSize) const 00087 { 00088 StubBase::calculateSizes(commandPool, commandPoolSize, dataSize); 00089 } // calculateSizes 00090 // end example 00091 private: 00092 virtual void 00093 doOnData(const CompoundPtr& compound); 00094 00095 double fixedPER; 00096 }; // PERProviderStub 00097 00098 }}} 00099 00100 00101 #endif // NOT defined WNS_LDK_TOOLS_PERPROVIDERSTUB_HPP 00102 00103
1.5.5