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
// Delete copy constructor and assignment operator to avoid misuse
44
LrWpanInterferenceHelper
(
const
LrWpanInterferenceHelper
&) =
delete
;
45
LrWpanInterferenceHelper
&
operator=
(
const
LrWpanInterferenceHelper
&) =
delete
;
46
47
/**
48
* Add the given signal to the set of accumulated signals. Never add the same
49
* signal more than once. The SpectrumModels of the signal and the one used
50
* for instantiation of the helper have to be the same.
51
*
52
* @param signal the signal to be added
53
* @return false, if the signal was not added because the SpectrumModel of the
54
* signal does not match the one of the helper, true otherwise.
55
*/
56
bool
AddSignal
(
Ptr<const SpectrumValue>
signal);
57
58
/**
59
* Remove the given signal to the set of accumulated signals.
60
*
61
* @param signal the signal to be removed
62
* @return false, if the signal was not removed (because it was not added
63
* before), true otherwise.
64
*/
65
bool
RemoveSignal
(
Ptr<const SpectrumValue>
signal);
66
67
/**
68
* Remove all currently accumulated signals.
69
*/
70
void
ClearSignals
();
71
72
/**
73
* Get the sum of all accumulated signals.
74
*
75
* @return the sum of the signals
76
*/
77
Ptr<SpectrumValue>
GetSignalPsd
()
const
;
78
79
/**
80
* Get the SpectrumModel used by the helper.
81
*
82
* @return the helpers SpectrumModel
83
*/
84
Ptr<const SpectrumModel>
GetSpectrumModel
()
const
;
85
86
private
:
87
/**
88
* The helpers SpectrumModel.
89
*/
90
Ptr<const SpectrumModel>
m_spectrumModel
;
91
92
/**
93
* The set of accumulated signals.
94
*/
95
std::set<Ptr<const SpectrumValue>>
m_signals
;
96
97
/**
98
* The precomputed sum of all accumulated signals.
99
*/
100
mutable
Ptr<SpectrumValue>
m_signal
;
101
102
/**
103
* Mark m_signal as dirty, whenever a signal is added or removed. m_signal has
104
* to be recomputed before next use.
105
*/
106
mutable
bool
m_dirty
;
107
};
108
109
}
// namespace lrwpan
110
}
// namespace ns3
111
112
#endif
/* LR_WPAN_INTERFERENCE_HELPER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::SimpleRefCount< LrWpanInterferenceHelper >::SimpleRefCount
SimpleRefCount()
Definition
simple-ref-count.h:79
ns3::SpectrumModel
Set of frequency values implementing the domain of the functions in the Function Space defined by Spe...
Definition
spectrum-model.h:62
ns3::SpectrumValue
Set of values corresponding to a given SpectrumModel.
Definition
spectrum-value.h:50
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::operator=
LrWpanInterferenceHelper & operator=(const LrWpanInterferenceHelper &)=delete
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::~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:95
ns3::lrwpan::LrWpanInterferenceHelper::m_signal
Ptr< SpectrumValue > m_signal
The precomputed sum of all accumulated signals.
Definition
lr-wpan-interference-helper.h:100
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:106
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:90
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::lrwpan::LrWpanInterferenceHelper::LrWpanInterferenceHelper
LrWpanInterferenceHelper(const LrWpanInterferenceHelper &)=delete
ns3::lrwpan
Definition
lr-wpan-constants.h:23
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
for ns-3 by
1.15.0