A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lrwpan::LrWpanInterferenceHelper Class Reference

This class provides helper functions for LrWpan interference handling. More...

#include "lr-wpan-interference-helper.h"

+ Inheritance diagram for ns3::lrwpan::LrWpanInterferenceHelper:
+ Collaboration diagram for ns3::lrwpan::LrWpanInterferenceHelper:

Public Member Functions

 LrWpanInterferenceHelper (Ptr< const SpectrumModel > spectrumModel)
 Create a new interference helper for the given SpectrumModel.
 
 ~LrWpanInterferenceHelper ()
 
bool AddSignal (Ptr< const SpectrumValue > signal)
 Add the given signal to the set of accumulated signals.
 
void ClearSignals ()
 Remove all currently accumulated signals.
 
Ptr< SpectrumValueGetSignalPsd () const
 Get the sum of all accumulated signals.
 
Ptr< const SpectrumModelGetSpectrumModel () const
 Get the SpectrumModel used by the helper.
 
bool RemoveSignal (Ptr< const SpectrumValue > signal)
 Remove the given signal to the set of accumulated signals.
 
- Public Member Functions inherited from ns3::SimpleRefCount< LrWpanInterferenceHelper >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

Private Member Functions

 LrWpanInterferenceHelper (const LrWpanInterferenceHelper &)
 Copy constructor - defined and not implemented.
 
LrWpanInterferenceHelperoperator= (const LrWpanInterferenceHelper &)
 Copy constructor - defined and not implemented.
 

Private Attributes

bool m_dirty
 Mark m_signal as dirty, whenever a signal is added or removed.
 
Ptr< SpectrumValuem_signal
 The precomputed sum of all accumulated signals.
 
std::set< Ptr< const SpectrumValue > > m_signals
 The set of accumulated signals.
 
Ptr< const SpectrumModelm_spectrumModel
 The helpers SpectrumModel.
 

Detailed Description

This class provides helper functions for LrWpan interference handling.

Definition at line 31 of file lr-wpan-interference-helper.h.

Constructor & Destructor Documentation

◆ LrWpanInterferenceHelper() [1/2]

ns3::lrwpan::LrWpanInterferenceHelper::LrWpanInterferenceHelper ( Ptr< const SpectrumModel > spectrumModel)

Create a new interference helper for the given SpectrumModel.

Parameters
spectrumModelthe SpectrumModel to be used

Definition at line 22 of file lr-wpan-interference-helper.cc.

References ns3::Create(), m_signal, and m_spectrumModel.

+ Here is the call graph for this function:

◆ ~LrWpanInterferenceHelper()

ns3::lrwpan::LrWpanInterferenceHelper::~LrWpanInterferenceHelper ( )

Definition at line 29 of file lr-wpan-interference-helper.cc.

References m_signal, m_signals, and m_spectrumModel.

◆ LrWpanInterferenceHelper() [2/2]

ns3::lrwpan::LrWpanInterferenceHelper::LrWpanInterferenceHelper ( const LrWpanInterferenceHelper & )
private

Copy constructor - defined and not implemented.

Member Function Documentation

◆ AddSignal()

bool ns3::lrwpan::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.

Parameters
signalthe signal to be added
Returns
false, if the signal was not added because the SpectrumModel of the signal does not match the one of the helper, true otherwise.

Definition at line 37 of file lr-wpan-interference-helper.cc.

References m_dirty, m_signal, m_signals, m_spectrumModel, and NS_LOG_FUNCTION.

◆ ClearSignals()

void ns3::lrwpan::LrWpanInterferenceHelper::ClearSignals ( )

Remove all currently accumulated signals.

Definition at line 73 of file lr-wpan-interference-helper.cc.

References m_dirty, m_signals, and NS_LOG_FUNCTION.

◆ GetSignalPsd()

Ptr< SpectrumValue > ns3::lrwpan::LrWpanInterferenceHelper::GetSignalPsd ( ) const

Get the sum of all accumulated signals.

Returns
the sum of the signals

Definition at line 82 of file lr-wpan-interference-helper.cc.

References ns3::Create(), m_dirty, m_signal, m_signals, m_spectrumModel, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetSpectrumModel()

Ptr< const SpectrumModel > ns3::lrwpan::LrWpanInterferenceHelper::GetSpectrumModel ( ) const

Get the SpectrumModel used by the helper.

Returns
the helpers SpectrumModel

◆ operator=()

LrWpanInterferenceHelper & ns3::lrwpan::LrWpanInterferenceHelper::operator= ( const LrWpanInterferenceHelper & )
private

Copy constructor - defined and not implemented.

Returns

◆ RemoveSignal()

bool ns3::lrwpan::LrWpanInterferenceHelper::RemoveSignal ( Ptr< const SpectrumValue > signal)

Remove the given signal to the set of accumulated signals.

Parameters
signalthe signal to be removed
Returns
false, if the signal was not removed (because it was not added before), true otherwise.

Definition at line 55 of file lr-wpan-interference-helper.cc.

References m_dirty, m_signals, m_spectrumModel, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_dirty

bool ns3::lrwpan::LrWpanInterferenceHelper::m_dirty
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 112 of file lr-wpan-interference-helper.h.

Referenced by AddSignal(), ClearSignals(), GetSignalPsd(), and RemoveSignal().

◆ m_signal

Ptr<SpectrumValue> ns3::lrwpan::LrWpanInterferenceHelper::m_signal
mutableprivate

The precomputed sum of all accumulated signals.

Definition at line 106 of file lr-wpan-interference-helper.h.

Referenced by LrWpanInterferenceHelper(), ~LrWpanInterferenceHelper(), AddSignal(), and GetSignalPsd().

◆ m_signals

std::set<Ptr<const SpectrumValue> > ns3::lrwpan::LrWpanInterferenceHelper::m_signals
private

The set of accumulated signals.

Definition at line 101 of file lr-wpan-interference-helper.h.

Referenced by ~LrWpanInterferenceHelper(), AddSignal(), ClearSignals(), GetSignalPsd(), and RemoveSignal().

◆ m_spectrumModel

Ptr<const SpectrumModel> ns3::lrwpan::LrWpanInterferenceHelper::m_spectrumModel
private

The documentation for this class was generated from the following files: