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
lr-wpan-interference-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 Fraunhofer FKIE
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author:
7
* Sascha Alexander Jopen <jopen@cs.uni-bonn.de>
8
*/
9
#ifndef LR_WPAN_INTERFERENCE_HELPER_H
10
#define LR_WPAN_INTERFERENCE_HELPER_H
11
12
#include <ns3/ptr.h>
13
#include <ns3/simple-ref-count.h>
14
15
#include <set>
16
17
namespace
ns3
18
{
19
20
class
SpectrumValue;
21
class
SpectrumModel;
22
23
namespace
lrwpan
24
{
25
26
/**
27
* \ingroup lr-wpan
28
*
29
* \brief This class provides helper functions for LrWpan interference handling.
30
*/
31
class
LrWpanInterferenceHelper
:
public
SimpleRefCount
<LrWpanInterferenceHelper>
32
{
33
public
:
34
/**
35
* Create a new interference helper for the given SpectrumModel.
36
*
37
* \param spectrumModel the SpectrumModel to be used
38
*/
39
LrWpanInterferenceHelper
(
Ptr<const SpectrumModel>
spectrumModel);
40
41
~LrWpanInterferenceHelper
();
42
43
/**
44
* Add the given signal to the set of accumulated signals. Never add the same
45
* signal more than once. The SpectrumModels of the signal and the one used
46
* for instantiation of the helper have to be the same.
47
*
48
* \param signal the signal to be added
49
* \return false, if the signal was not added because the SpectrumModel of the
50
* signal does not match the one of the helper, true otherwise.
51
*/
52
bool
AddSignal
(
Ptr<const SpectrumValue>
signal);
53
54
/**
55
* Remove the given signal to the set of accumulated signals.
56
*
57
* \param signal the signal to be removed
58
* \return false, if the signal was not removed (because it was not added
59
* before), true otherwise.
60
*/
61
bool
RemoveSignal
(
Ptr<const SpectrumValue>
signal);
62
63
/**
64
* Remove all currently accumulated signals.
65
*/
66
void
ClearSignals
();
67
68
/**
69
* Get the sum of all accumulated signals.
70
*
71
* \return the sum of the signals
72
*/
73
Ptr<SpectrumValue>
GetSignalPsd
()
const
;
74
75
/**
76
* Get the SpectrumModel used by the helper.
77
*
78
* \return the helpers SpectrumModel
79
*/
80
Ptr<const SpectrumModel>
GetSpectrumModel
()
const
;
81
82
private
:
83
// Disable implicit copy constructors
84
/**
85
* \brief Copy constructor - defined and not implemented.
86
*/
87
LrWpanInterferenceHelper
(
const
LrWpanInterferenceHelper
&);
88
/**
89
* \brief Copy constructor - defined and not implemented.
90
* \returns
91
*/
92
LrWpanInterferenceHelper
&
operator=
(
const
LrWpanInterferenceHelper
&);
93
/**
94
* The helpers SpectrumModel.
95
*/
96
Ptr<const SpectrumModel>
m_spectrumModel
;
97
98
/**
99
* The set of accumulated signals.
100
*/
101
std::set<Ptr<const SpectrumValue>>
m_signals
;
102
103
/**
104
* The precomputed sum of all accumulated signals.
105
*/
106
mutable
Ptr<SpectrumValue>
m_signal
;
107
108
/**
109
* Mark m_signal as dirty, whenever a signal is added or removed. m_signal has
110
* to be recomputed before next use.
111
*/
112
mutable
bool
m_dirty
;
113
};
114
115
}
// namespace lrwpan
116
}
// namespace ns3
117
118
#endif
/* LR_WPAN_INTERFERENCE_HELPER_H */
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::lrwpan::LrWpanInterferenceHelper
This class provides helper functions for LrWpan interference handling.
Definition
lr-wpan-interference-helper.h:32
ns3::lrwpan::LrWpanInterferenceHelper::GetSignalPsd
Ptr< SpectrumValue > GetSignalPsd() const
Get the sum of all accumulated signals.
Definition
lr-wpan-interference-helper.cc:82
ns3::lrwpan::LrWpanInterferenceHelper::LrWpanInterferenceHelper
LrWpanInterferenceHelper(const LrWpanInterferenceHelper &)
Copy constructor - defined and not implemented.
ns3::lrwpan::LrWpanInterferenceHelper::AddSignal
bool AddSignal(Ptr< const SpectrumValue > signal)
Add the given signal to the set of accumulated signals.
Definition
lr-wpan-interference-helper.cc:37
ns3::lrwpan::LrWpanInterferenceHelper::ClearSignals
void ClearSignals()
Remove all currently accumulated signals.
Definition
lr-wpan-interference-helper.cc:73
ns3::lrwpan::LrWpanInterferenceHelper::GetSpectrumModel
Ptr< const SpectrumModel > GetSpectrumModel() const
Get the SpectrumModel used by the helper.
ns3::lrwpan::LrWpanInterferenceHelper::operator=
LrWpanInterferenceHelper & operator=(const LrWpanInterferenceHelper &)
Copy constructor - defined and not implemented.
ns3::lrwpan::LrWpanInterferenceHelper::~LrWpanInterferenceHelper
~LrWpanInterferenceHelper()
Definition
lr-wpan-interference-helper.cc:29
ns3::lrwpan::LrWpanInterferenceHelper::m_signals
std::set< Ptr< const SpectrumValue > > m_signals
The set of accumulated signals.
Definition
lr-wpan-interference-helper.h:101
ns3::lrwpan::LrWpanInterferenceHelper::m_signal
Ptr< SpectrumValue > m_signal
The precomputed sum of all accumulated signals.
Definition
lr-wpan-interference-helper.h:106
ns3::lrwpan::LrWpanInterferenceHelper::m_dirty
bool m_dirty
Mark m_signal as dirty, whenever a signal is added or removed.
Definition
lr-wpan-interference-helper.h:112
ns3::lrwpan::LrWpanInterferenceHelper::LrWpanInterferenceHelper
LrWpanInterferenceHelper(Ptr< const SpectrumModel > spectrumModel)
Create a new interference helper for the given SpectrumModel.
Definition
lr-wpan-interference-helper.cc:22
ns3::lrwpan::LrWpanInterferenceHelper::m_spectrumModel
Ptr< const SpectrumModel > m_spectrumModel
The helpers SpectrumModel.
Definition
lr-wpan-interference-helper.h:96
ns3::lrwpan::LrWpanInterferenceHelper::RemoveSignal
bool RemoveSignal(Ptr< const SpectrumValue > signal)
Remove the given signal to the set of accumulated signals.
Definition
lr-wpan-interference-helper.cc:55
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lr-wpan
model
lr-wpan-interference-helper.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0