A Discrete-Event Network Simulator
API
lr-wpan-interference-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Fraunhofer FKIE
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author:
19  * Sascha Alexander Jopen <jopen@cs.uni-bonn.de>
20  */
21 #ifndef LR_WPAN_INTERFERENCE_HELPER_H
22 #define LR_WPAN_INTERFERENCE_HELPER_H
23 
24 #include <ns3/simple-ref-count.h>
25 #include <ns3/ptr.h>
26 #include <set>
27 
28 namespace ns3 {
29 
30 class SpectrumValue;
31 class SpectrumModel;
32 
38 class LrWpanInterferenceHelper : public SimpleRefCount<LrWpanInterferenceHelper>
39 {
40 public:
47 
49 
59  bool AddSignal (Ptr<const SpectrumValue> signal);
60 
69 
73  void ClearSignals (void);
74 
80  Ptr<SpectrumValue> GetSignalPsd (void) const;
81 
88 private:
89  // Disable implicit copy constructors
103 
107  std::set<Ptr<const SpectrumValue> > m_signals;
108 
113 
118  mutable bool m_dirty;
119 };
120 
121 }
122 
123 #endif /* LR_WPAN_INTERFERENCE_HELPER_H */
LrWpanInterferenceHelper & operator=(LrWpanInterferenceHelper const &)
Copy constructor - defined and not implemented.
std::set< Ptr< const SpectrumValue > > m_signals
The set of accumulated signals.
Ptr< SpectrumValue > GetSignalPsd(void) const
Get the sum of all accumulated signals.
Ptr< SpectrumValue > m_signal
The precomputed sum of all accumulated signals.
LrWpanInterferenceHelper(Ptr< const SpectrumModel > spectrumModel)
Create a new interference helper for the given SpectrumModel.
Ptr< const SpectrumModel > m_spectrumModel
The helpers SpectrumModel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const SpectrumModel > GetSpectrumModel(void) const
Get the SpectrumModel used by the helper.
bool RemoveSignal(Ptr< const SpectrumValue > signal)
Remove the given signal to the set of accumulated signals.
bool m_dirty
Mark m_signal as dirty, whenever a signal is added or removed.
bool AddSignal(Ptr< const SpectrumValue > signal)
Add the given signal to the set of accumulated signals.
void ClearSignals(void)
Remove all currently accumulated signals.
A template-based reference counting class.
This class provides helper functions for LrWpan interference handling.