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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author:
18
* Sascha Alexander Jopen <jopen@cs.uni-bonn.de>
19
*/
20
#ifndef LR_WPAN_INTERFERENCE_HELPER_H
21
#define LR_WPAN_INTERFERENCE_HELPER_H
22
23
#include <ns3/ptr.h>
24
#include <ns3/simple-ref-count.h>
25
26
#include <set>
27
28
namespace
ns3
29
{
30
31
class
SpectrumValue;
32
class
SpectrumModel;
33
34
namespace
lrwpan
35
{
36
37
/**
38
* \ingroup lr-wpan
39
*
40
* \brief This class provides helper functions for LrWpan interference handling.
41
*/
42
class
LrWpanInterferenceHelper
:
public
SimpleRefCount
<LrWpanInterferenceHelper>
43
{
44
public
:
45
/**
46
* Create a new interference helper for the given SpectrumModel.
47
*
48
* \param spectrumModel the SpectrumModel to be used
49
*/
50
LrWpanInterferenceHelper
(
Ptr<const SpectrumModel>
spectrumModel);
51
52
~LrWpanInterferenceHelper
();
53
54
/**
55
* Add the given signal to the set of accumulated signals. Never add the same
56
* signal more than once. The SpectrumModels of the signal and the one used
57
* for instantiation of the helper have to be the same.
58
*
59
* \param signal the signal to be added
60
* \return false, if the signal was not added because the SpectrumModel of the
61
* signal does not match the one of the helper, true otherwise.
62
*/
63
bool
AddSignal
(
Ptr<const SpectrumValue>
signal);
64
65
/**
66
* Remove the given signal to the set of accumulated signals.
67
*
68
* \param signal the signal to be removed
69
* \return false, if the signal was not removed (because it was not added
70
* before), true otherwise.
71
*/
72
bool
RemoveSignal
(
Ptr<const SpectrumValue>
signal);
73
74
/**
75
* Remove all currently accumulated signals.
76
*/
77
void
ClearSignals
();
78
79
/**
80
* Get the sum of all accumulated signals.
81
*
82
* \return the sum of the signals
83
*/
84
Ptr<SpectrumValue>
GetSignalPsd
()
const
;
85
86
/**
87
* Get the SpectrumModel used by the helper.
88
*
89
* \return the helpers SpectrumModel
90
*/
91
Ptr<const SpectrumModel>
GetSpectrumModel
()
const
;
92
93
private
:
94
// Disable implicit copy constructors
95
/**
96
* \brief Copy constructor - defined and not implemented.
97
*/
98
LrWpanInterferenceHelper
(
const
LrWpanInterferenceHelper
&);
99
/**
100
* \brief Copy constructor - defined and not implemented.
101
* \returns
102
*/
103
LrWpanInterferenceHelper
&
operator=
(
const
LrWpanInterferenceHelper
&);
104
/**
105
* The helpers SpectrumModel.
106
*/
107
Ptr<const SpectrumModel>
m_spectrumModel
;
108
109
/**
110
* The set of accumulated signals.
111
*/
112
std::set<Ptr<const SpectrumValue>>
m_signals
;
113
114
/**
115
* The precomputed sum of all accumulated signals.
116
*/
117
mutable
Ptr<SpectrumValue>
m_signal
;
118
119
/**
120
* Mark m_signal as dirty, whenever a signal is added or removed. m_signal has
121
* to be recomputed before next use.
122
*/
123
mutable
bool
m_dirty
;
124
};
125
126
}
// namespace lrwpan
127
}
// namespace ns3
128
129
#endif
/* LR_WPAN_INTERFERENCE_HELPER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:81
ns3::lrwpan::LrWpanInterferenceHelper
This class provides helper functions for LrWpan interference handling.
Definition:
lr-wpan-interference-helper.h:43
ns3::lrwpan::LrWpanInterferenceHelper::GetSignalPsd
Ptr< SpectrumValue > GetSignalPsd() const
Get the sum of all accumulated signals.
Definition:
lr-wpan-interference-helper.cc:93
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:48
ns3::lrwpan::LrWpanInterferenceHelper::ClearSignals
void ClearSignals()
Remove all currently accumulated signals.
Definition:
lr-wpan-interference-helper.cc:84
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:40
ns3::lrwpan::LrWpanInterferenceHelper::m_signals
std::set< Ptr< const SpectrumValue > > m_signals
The set of accumulated signals.
Definition:
lr-wpan-interference-helper.h:112
ns3::lrwpan::LrWpanInterferenceHelper::m_signal
Ptr< SpectrumValue > m_signal
The precomputed sum of all accumulated signals.
Definition:
lr-wpan-interference-helper.h:117
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:123
ns3::lrwpan::LrWpanInterferenceHelper::m_spectrumModel
Ptr< const SpectrumModel > m_spectrumModel
The helpers SpectrumModel.
Definition:
lr-wpan-interference-helper.h:107
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:66
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 Tue May 28 2024 23:36:50 for ns-3 by
1.9.6