A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
21
namespace
ns3
22
{
23
24
class
SpectrumValue;
25
26
/// Chunk processor callback typedef
27
typedef
Callback<void, const SpectrumValue&>
LteChunkProcessorCallback
;
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
*/
34
class
LteChunkProcessor
:
public
SimpleRefCount
<LteChunkProcessor>
35
{
36
public
:
37
LteChunkProcessor
();
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
*/
49
virtual
void
AddCallback
(
LteChunkProcessorCallback
c);
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
:
79
Ptr<SpectrumValue>
m_sumValues
;
///< sum values
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
*/
91
class
LteSpectrumValueCatcher
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
*/
106
Ptr<SpectrumValue>
GetValue
();
107
108
private
:
109
Ptr<SpectrumValue>
m_value
;
///< spectrum value
110
};
111
112
}
// namespace ns3
113
114
#endif
/* LTE_CHUNK_PROCESSOR_H */
ns3::Callback
Callback template class.
Definition
callback.h:422
ns3::LteChunkProcessor
This abstract class is used to process the time-vs-frequency SINR/interference/power chunk of a recei...
Definition
lte-chunk-processor.h:35
ns3::LteChunkProcessor::Start
virtual void Start()
Clear internal variables.
Definition
lte-chunk-processor.cc:39
ns3::LteChunkProcessor::AddCallback
virtual void AddCallback(LteChunkProcessorCallback c)
Add callback to list.
Definition
lte-chunk-processor.cc:32
ns3::LteChunkProcessor::~LteChunkProcessor
virtual ~LteChunkProcessor()
Definition
lte-chunk-processor.cc:26
ns3::LteChunkProcessor::EvaluateChunk
virtual void EvaluateChunk(const SpectrumValue &sinr, Time duration)
Collect SpectrumValue and duration of signal.
Definition
lte-chunk-processor.cc:47
ns3::LteChunkProcessor::m_sumValues
Ptr< SpectrumValue > m_sumValues
sum values
Definition
lte-chunk-processor.h:79
ns3::LteChunkProcessor::LteChunkProcessor
LteChunkProcessor()
Definition
lte-chunk-processor.cc:21
ns3::LteChunkProcessor::m_totDuration
Time m_totDuration
total duration
Definition
lte-chunk-processor.h:80
ns3::LteChunkProcessor::m_lteChunkProcessorCallbacks
std::vector< LteChunkProcessorCallback > m_lteChunkProcessorCallbacks
chunk processor callback
Definition
lte-chunk-processor.h:83
ns3::LteChunkProcessor::End
virtual void End()
Finish calculation and inform interested objects about calculated value.
Definition
lte-chunk-processor.cc:59
ns3::LteSpectrumValueCatcher
A sink to be plugged to the callback of LteChunkProcessor allowing to save and later retrieve the lat...
Definition
lte-chunk-processor.h:92
ns3::LteSpectrumValueCatcher::m_value
Ptr< SpectrumValue > m_value
spectrum value
Definition
lte-chunk-processor.h:109
ns3::LteSpectrumValueCatcher::GetValue
Ptr< SpectrumValue > GetValue()
Definition
lte-chunk-processor.cc:84
ns3::LteSpectrumValueCatcher::ReportValue
void ReportValue(const SpectrumValue &value)
function to be plugged to LteChunkProcessor::AddCallback ()
Definition
lte-chunk-processor.cc:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SimpleRefCount
A template-based reference counting class.
Definition
simple-ref-count.h:70
ns3::SpectrumValue
Set of values corresponding to a given SpectrumModel.
Definition
spectrum-value.h:50
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::LteChunkProcessorCallback
Callback< void, const SpectrumValue & > LteChunkProcessorCallback
Chunk processor callback typedef.
Definition
lte-chunk-processor.h:27
src
lte
model
lte-chunk-processor.h
Generated on Wed Dec 11 2024 09:20:51 for ns-3 by
1.11.0