![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /****************************************************************************** 00002 * WNS (Wireless Network Simulator) * 00003 * __________________________________________________________________________ * 00004 * * 00005 * Copyright (C) 2004-2006 * 00006 * Chair of Communication Networks (ComNets) * 00007 * Kopernikusstr. 16, D-52074 Aachen, Germany * 00008 * phone: ++49-241-80-27910 (phone), fax: ++49-241-80-22242 * 00009 * email: wns@comnets.rwth-aachen.de * 00010 * www: http://wns.comnets.rwth-aachen.de * 00011 ******************************************************************************/ 00012 00013 #ifndef GLUE_BERMEASUREMENTREPORTING_HPP 00014 #define GLUE_BERMEASUREMENTREPORTING_HPP 00015 00016 #include <GLUE/BERConsumer.hpp> 00017 #include <GLUE/BERProvider.hpp> 00018 00019 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00020 #include <WNS/ldk/HasReceptor.hpp> 00021 #include <WNS/ldk/HasConnector.hpp> 00022 #include <WNS/ldk/HasDeliverer.hpp> 00023 #include <WNS/ldk/Processor.hpp> 00024 00025 #include <WNS/events/PeriodicTimeout.hpp> 00026 #include <WNS/Cloneable.hpp> 00027 #include <WNS/pyconfig/View.hpp> 00028 #include <WNS/logger/Logger.hpp> 00029 00030 namespace glue { 00031 00040 class BERMeasurementReportingCommand : 00041 public wns::ldk::Command 00042 { 00043 public: 00047 BERMeasurementReportingCommand() 00048 { 00049 peer.BER = 0.0; 00050 magic.packetSize = 0; 00051 } // BERMeasurementReportingCommand 00052 00053 struct {} local; 00054 struct { 00055 double BER; 00056 } peer; 00057 struct { 00058 int packetSize; 00059 } magic; 00060 00061 }; // BERMeasurementReportingCommand 00062 00063 00077 class BERMeasurementReporting : 00078 virtual public wns::ldk::FunctionalUnit, 00079 public wns::ldk::CommandTypeSpecifier<BERMeasurementReportingCommand>, 00080 public wns::ldk::HasReceptor<>, 00081 public wns::ldk::HasConnector<>, 00082 public wns::ldk::HasDeliverer<>, 00083 public wns::Cloneable<BERMeasurementReporting>, 00084 public wns::events::PeriodicTimeout, 00085 public BERConsumer, 00086 public BERProvider 00087 { 00088 public: 00092 explicit 00093 BERMeasurementReporting( 00094 wns::ldk::fun::FUN* fuNet, 00095 const wns::pyconfig::View& config); 00096 00097 00101 virtual 00102 ~BERMeasurementReporting(); 00103 00111 virtual void 00112 onBERProviderDeleted(); 00113 00117 virtual void 00118 onNewMeasurement(double BER, int packetSize); 00120 00125 virtual void 00126 periodically(); 00128 00129 private: 00143 virtual void 00144 doSendData(const wns::ldk::CompoundPtr&) 00145 { 00146 throw wns::Exception("doSendData of BERMeasurementReporting FU may not be called."); 00147 } // doSendData 00148 00152 virtual void 00153 doOnData(const wns::ldk::CompoundPtr& compound); 00154 00158 virtual void 00159 onFUNCreated(); 00160 00164 virtual void 00165 calculateSizes(const wns::ldk::CommandPool* commandPool, Bit& commandPoolSize, Bit& dataSize) const; 00166 00176 virtual bool 00177 doIsAccepting(const wns::ldk::CompoundPtr&) const 00178 { 00179 throw wns::Exception("doIsAccepting of BERMeasurementReporting FU may not be called."); 00180 } // doIsAccepting 00181 00185 virtual void 00186 doWakeup(); 00188 00189 struct Friends 00190 { 00191 BERProvider* berProvider; 00192 } friends; 00193 00197 int headerSize; 00198 00199 double summedBER; 00200 int summedPacketSize; 00201 int numberOfPackets; 00202 00203 bool hasSomethingToSend; 00204 wns::ldk::CompoundPtr compoundToBeSent; 00205 00206 wns::pyconfig::View config; 00207 wns::logger::Logger logger; 00208 }; 00209 00210 } // glue 00211 00212 #endif // NOT defined GLUE_BERMEASUREMENTREPORTING 00213 00214
1.5.5