OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2009, 2010 Centre Tecnologic de Telecomunicacions de Catalunya
(CTTC) |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Nicola Baldo <nbaldo@cttc.es> |
| 19 * Modified by : Marco Miozzo <mmiozzo@cttc.es> |
| 20 * (move from CQI to Ctrl and Data SINR Chunk processors) |
| 21 * Modified by : Piotr Gawlowicz <gawlowicz.p@gmail.com> |
| 22 * (removed all Lte***ChunkProcessor implementations |
| 23 * and created generic NistLteChunkProcessor) |
| 24 */ |
| 25 |
| 26 |
| 27 #ifndef NIST_LTE_CHUNK_PROCESSOR_H |
| 28 #define NIST_LTE_CHUNK_PROCESSOR_H |
| 29 |
| 30 #include <ns3/ptr.h> |
| 31 #include <ns3/nstime.h> |
| 32 #include <ns3/object.h> |
| 33 |
| 34 namespace ns3 { |
| 35 |
| 36 class SpectrumValue; |
| 37 |
| 38 typedef Callback< void, const SpectrumValue& > NistLteChunkProcessorCallback; |
| 39 |
| 40 /**· |
| 41 * This abstract class is used to process the time-vs-frequency |
| 42 * SINR/interference/power chunk of a received LTE signal |
| 43 * which was calculated by the NistLteInterference object. |
| 44 */ |
| 45 class NistLteChunkProcessor : public SimpleRefCount<NistLteChunkProcessor> |
| 46 { |
| 47 public: |
| 48 NistLteChunkProcessor (); |
| 49 virtual ~NistLteChunkProcessor (); |
| 50 |
| 51 /** |
| 52 * \brief Add callback to list |
| 53 * |
| 54 * This function adds callback c to list. Each callback pass |
| 55 * calculated value to its object and is called in |
| 56 * NistLteChunkProcessor::End(). |
| 57 */ |
| 58 virtual void AddCallback (NistLteChunkProcessorCallback c); |
| 59 |
| 60 /** |
| 61 * \brief Clear internal variables |
| 62 * |
| 63 * This function clears internal variables in the beginning of |
| 64 * calculation |
| 65 */ |
| 66 virtual void Start (); |
| 67 |
| 68 /** |
| 69 * \brief Collect SpectrumValue and duration of signal |
| 70 * |
| 71 * Passed values are collected in m_sumValues and m_totDuration variables. |
| 72 */ |
| 73 virtual void EvaluateChunk (const SpectrumValue& sinr, Time duration); |
| 74 |
| 75 /** |
| 76 * \brief Finish calculation and inform interested objects about calculated v
alue |
| 77 * |
| 78 * During this function all callbacks from list are executed |
| 79 * to inform interested object about calculated value. This |
| 80 * function is called at the end of calculation. |
| 81 */ |
| 82 virtual void End (); |
| 83 |
| 84 private: |
| 85 Ptr<SpectrumValue> m_sumValues; |
| 86 Time m_totDuration; |
| 87 |
| 88 std::vector<NistLteChunkProcessorCallback> m_lteChunkProcessorCallbacks; |
| 89 }; |
| 90 |
| 91 } // namespace ns3 |
| 92 |
| 93 |
| 94 |
| 95 #endif /* NIST_LTE_CHUNK_PROCESSOR_H */ |
OLD | NEW |