A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-chunk-processor.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009, 2010 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 * Modified by : Marco Miozzo <mmiozzo@cttc.es>
8 * (move from CQI to Ctrl and Data SINR Chunk processors)
9 * Modified by : Piotr Gawlowicz <gawlowicz.p@gmail.com>
10 * (removed all Lte***ChunkProcessor implementations
11 * and created generic LteChunkProcessor)
12 */
13
14#ifndef LTE_CHUNK_PROCESSOR_H
15#define LTE_CHUNK_PROCESSOR_H
16
17#include <ns3/nstime.h>
18#include <ns3/object.h>
19#include <ns3/ptr.h>
20
21namespace ns3
22{
23
24class SpectrumValue;
25
26/// Chunk processor callback typedef
28
29/**
30 * This abstract class is used to process the time-vs-frequency
31 * SINR/interference/power chunk of a received LTE signal
32 * which was calculated by the LteInterference object.
33 */
34class LteChunkProcessor : public SimpleRefCount<LteChunkProcessor>
35{
36 public:
38 virtual ~LteChunkProcessor();
39
40 /**
41 * \brief Add callback to list
42 *
43 * This function adds callback c to list. Each callback pass
44 * calculated value to its object and is called in
45 * LteChunkProcessor::End().
46 *
47 * \param c callback function
48 */
50
51 /**
52 * \brief Clear internal variables
53 *
54 * This function clears internal variables in the beginning of
55 * calculation
56 */
57 virtual void Start();
58
59 /**
60 * \brief Collect SpectrumValue and duration of signal
61 *
62 * Passed values are collected in m_sumValues and m_totDuration variables.
63 *
64 * \param sinr the SINR
65 * \param duration the duration
66 */
67 virtual void EvaluateChunk(const SpectrumValue& sinr, Time duration);
68
69 /**
70 * \brief Finish calculation and inform interested objects about calculated value
71 *
72 * During this function all callbacks from list are executed
73 * to inform interested object about calculated value. This
74 * function is called at the end of calculation.
75 */
76 virtual void End();
77
78 private:
80 Time m_totDuration; ///< total duration
81
82 std::vector<LteChunkProcessorCallback>
83 m_lteChunkProcessorCallbacks; ///< chunk processor callback
84};
85
86/**
87 * A sink to be plugged to the callback of LteChunkProcessor allowing
88 * to save and later retrieve the latest reported value
89 *
90 */
92{
93 public:
94 /**
95 * function to be plugged to LteChunkProcessor::AddCallback ()
96 *
97 * \param value
98 */
99 void ReportValue(const SpectrumValue& value);
100
101 /**
102 *
103 *
104 * \return the latest value reported by the LteChunkProcessor
105 */
107
108 private:
109 Ptr<SpectrumValue> m_value; ///< spectrum value
110};
111
112} // namespace ns3
113
114#endif /* LTE_CHUNK_PROCESSOR_H */
Callback template class.
Definition callback.h:422
This abstract class is used to process the time-vs-frequency SINR/interference/power chunk of a recei...
virtual void Start()
Clear internal variables.
virtual void AddCallback(LteChunkProcessorCallback c)
Add callback to list.
virtual void EvaluateChunk(const SpectrumValue &sinr, Time duration)
Collect SpectrumValue and duration of signal.
Ptr< SpectrumValue > m_sumValues
sum values
Time m_totDuration
total duration
std::vector< LteChunkProcessorCallback > m_lteChunkProcessorCallbacks
chunk processor callback
virtual void End()
Finish calculation and inform interested objects about calculated value.
A sink to be plugged to the callback of LteChunkProcessor allowing to save and later retrieve the lat...
Ptr< SpectrumValue > m_value
spectrum value
Ptr< SpectrumValue > GetValue()
void ReportValue(const SpectrumValue &value)
function to be plugged to LteChunkProcessor::AddCallback ()
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
Set of values corresponding to a given SpectrumModel.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< void, const SpectrumValue & > LteChunkProcessorCallback
Chunk processor callback typedef.