wifi: Make InterferenceHelper inherit from Object

This commit is contained in:
Sebastien Deronne
2022-04-26 19:45:30 +02:00
committed by Stefano Avallone
parent a1afa86410
commit 679ce12636
2 changed files with 33 additions and 6 deletions

View File

@@ -34,6 +34,8 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("InterferenceHelper");
NS_OBJECT_ENSURE_REGISTERED (InterferenceHelper);
/****************************************************************
* PHY event class
****************************************************************/
@@ -178,10 +180,29 @@ InterferenceHelper::InterferenceHelper ()
m_numRxAntennas (1),
m_rxing (false)
{
NS_LOG_FUNCTION (this);
}
InterferenceHelper::~InterferenceHelper ()
{
NS_LOG_FUNCTION (this);
}
TypeId
InterferenceHelper::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::InterferenceHelper")
.SetParent<ns3::Object> ()
.SetGroupName ("Wifi")
.AddConstructor<InterferenceHelper> ()
;
return tid;
}
void
InterferenceHelper::DoDispose (void)
{
NS_LOG_FUNCTION (this);
RemoveBands ();
m_errorRateModel = 0;
}

View File

@@ -129,11 +129,17 @@ std::ostream& operator<< (std::ostream& os, const Event &event);
* \ingroup wifi
* \brief handles interference calculations
*/
class InterferenceHelper
class InterferenceHelper : public Object
{
public:
InterferenceHelper ();
~InterferenceHelper ();
virtual ~InterferenceHelper ();
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
/**
* Add a frequency band.
@@ -268,8 +274,9 @@ public:
*/
void UpdateEvent (Ptr<Event> event, const RxPowerWattPerChannelBand& rxPower);
protected:
void DoDispose (void) override;
/**
* Calculate SNR (linear ratio) from the given signal power and noise+interference power.
*
@@ -313,7 +320,7 @@ private:
*/
class NiChange
{
public:
public:
/**
* Create a NiChange at the given time and the amount of NI change.
*
@@ -341,8 +348,7 @@ public:
*/
Ptr<Event> GetEvent (void) const;
private:
private:
double m_power; ///< power in watts
Ptr<Event> m_event; ///< event
};