This class provides helper functions for LrWpan interference handling. More...
#include "lr-wpan-interference-helper.h"
Public Member Functions | |
LrWpanInterferenceHelper (Ptr< const SpectrumModel > spectrumModel) | |
Create a new interference helper for the given SpectrumModel. More... | |
~LrWpanInterferenceHelper () | |
bool | AddSignal (Ptr< const SpectrumValue > signal) |
Add the given signal to the set of accumulated signals. More... | |
void | ClearSignals () |
Remove all currently accumulated signals. More... | |
Ptr< SpectrumValue > | GetSignalPsd () const |
Get the sum of all accumulated signals. More... | |
Ptr< const SpectrumModel > | GetSpectrumModel () const |
Get the SpectrumModel used by the helper. More... | |
bool | RemoveSignal (Ptr< const SpectrumValue > signal) |
Remove the given signal to the set of accumulated signals. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< LrWpanInterferenceHelper > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Private Member Functions | |
LrWpanInterferenceHelper (const LrWpanInterferenceHelper &) | |
Copy constructor - defined and not implemented. More... | |
LrWpanInterferenceHelper & | operator= (const LrWpanInterferenceHelper &) |
Copy constructor - defined and not implemented. More... | |
Private Attributes | |
bool | m_dirty |
Mark m_signal as dirty, whenever a signal is added or removed. More... | |
Ptr< SpectrumValue > | m_signal |
The precomputed sum of all accumulated signals. More... | |
std::set< Ptr< const SpectrumValue > > | m_signals |
The set of accumulated signals. More... | |
Ptr< const SpectrumModel > | m_spectrumModel |
The helpers SpectrumModel. More... | |
This class provides helper functions for LrWpan interference handling.
Definition at line 39 of file lr-wpan-interference-helper.h.
ns3::LrWpanInterferenceHelper::LrWpanInterferenceHelper | ( | Ptr< const SpectrumModel > | spectrumModel | ) |
Create a new interference helper for the given SpectrumModel.
spectrumModel | the SpectrumModel to be used |
Definition at line 31 of file lr-wpan-interference-helper.cc.
References m_signal, and m_spectrumModel.
ns3::LrWpanInterferenceHelper::~LrWpanInterferenceHelper | ( | ) |
Definition at line 38 of file lr-wpan-interference-helper.cc.
References m_signal, m_signals, and m_spectrumModel.
|
private |
Copy constructor - defined and not implemented.
bool ns3::LrWpanInterferenceHelper::AddSignal | ( | Ptr< const SpectrumValue > | signal | ) |
Add the given signal to the set of accumulated signals.
Never add the same signal more than once. The SpectrumModels of the signal and the one used for instantiation of the helper have to be the same.
signal | the signal to be added |
Definition at line 46 of file lr-wpan-interference-helper.cc.
References m_dirty, m_signal, m_signals, m_spectrumModel, and NS_LOG_FUNCTION.
void ns3::LrWpanInterferenceHelper::ClearSignals | ( | ) |
Remove all currently accumulated signals.
Definition at line 82 of file lr-wpan-interference-helper.cc.
References m_dirty, m_signals, and NS_LOG_FUNCTION.
Ptr< SpectrumValue > ns3::LrWpanInterferenceHelper::GetSignalPsd | ( | ) | const |
Get the sum of all accumulated signals.
Definition at line 91 of file lr-wpan-interference-helper.cc.
References ns3::SpectrumValue::Copy(), m_dirty, m_signal, m_signals, m_spectrumModel, and NS_LOG_FUNCTION.
Ptr<const SpectrumModel> ns3::LrWpanInterferenceHelper::GetSpectrumModel | ( | ) | const |
Get the SpectrumModel used by the helper.
|
private |
Copy constructor - defined and not implemented.
bool ns3::LrWpanInterferenceHelper::RemoveSignal | ( | Ptr< const SpectrumValue > | signal | ) |
Remove the given signal to the set of accumulated signals.
signal | the signal to be removed |
Definition at line 64 of file lr-wpan-interference-helper.cc.
References m_dirty, m_signals, m_spectrumModel, and NS_LOG_FUNCTION.
|
mutableprivate |
Mark m_signal as dirty, whenever a signal is added or removed.
m_signal has to be recomputed before next use.
Definition at line 120 of file lr-wpan-interference-helper.h.
Referenced by AddSignal(), ClearSignals(), GetSignalPsd(), and RemoveSignal().
|
mutableprivate |
The precomputed sum of all accumulated signals.
Definition at line 114 of file lr-wpan-interference-helper.h.
Referenced by LrWpanInterferenceHelper(), ~LrWpanInterferenceHelper(), AddSignal(), and GetSignalPsd().
|
private |
The set of accumulated signals.
Definition at line 109 of file lr-wpan-interference-helper.h.
Referenced by ~LrWpanInterferenceHelper(), AddSignal(), ClearSignals(), GetSignalPsd(), and RemoveSignal().
|
private |
The helpers SpectrumModel.
Definition at line 104 of file lr-wpan-interference-helper.h.
Referenced by LrWpanInterferenceHelper(), ~LrWpanInterferenceHelper(), AddSignal(), GetSignalPsd(), and RemoveSignal().