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

Assign WifiRadioEnergyModel to wifi devices. More...

#include "wifi-radio-energy-model-helper.h"

+ Inheritance diagram for ns3::WifiRadioEnergyModelHelper:
+ Collaboration diagram for ns3::WifiRadioEnergyModelHelper:

Public Member Functions

 WifiRadioEnergyModelHelper ()
 Construct a helper which is used to add a radio energy model to a node.
 
 ~WifiRadioEnergyModelHelper () override
 Destroy a RadioEnergy Helper.
 
void Set (std::string name, const AttributeValue &v) override
 
void SetDepletionCallback (WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback callback)
 
void SetRechargedCallback (WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback)
 
template<typename... Ts>
void SetTxCurrentModel (std::string name, Ts &&... args)
 
- Public Member Functions inherited from ns3::DeviceEnergyModelHelper
virtual ~DeviceEnergyModelHelper ()
 
energy::DeviceEnergyModelContainer Install (NetDeviceContainer deviceContainer, energy::EnergySourceContainer sourceContainer) const
 
energy::DeviceEnergyModelContainer Install (Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const
 

Private Member Functions

Ptr< energy::DeviceEnergyModelDoInstall (Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const override
 

Private Attributes

WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback m_depletionCallback
 radio energy depletion callback
 
ObjectFactory m_radioEnergy
 radio energy
 
WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback m_rechargedCallback
 radio energy recharged callback
 
ObjectFactory m_txCurrentModel
 transmit current model
 

Detailed Description

Assign WifiRadioEnergyModel to wifi devices.

This installer installs WifiRadioEnergyModel for only WifiNetDevice objects.

Definition at line 25 of file wifi-radio-energy-model-helper.h.

Constructor & Destructor Documentation

◆ WifiRadioEnergyModelHelper()

ns3::WifiRadioEnergyModelHelper::WifiRadioEnergyModelHelper ( )

Construct a helper which is used to add a radio energy model to a node.

Definition at line 18 of file wifi-radio-energy-model-helper.cc.

References m_depletionCallback, m_radioEnergy, m_rechargedCallback, ns3::Callback< R, UArgs >::Nullify(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ ~WifiRadioEnergyModelHelper()

ns3::WifiRadioEnergyModelHelper::~WifiRadioEnergyModelHelper ( )
override

Destroy a RadioEnergy Helper.

Definition at line 25 of file wifi-radio-energy-model-helper.cc.

Member Function Documentation

◆ DoInstall()

Ptr< energy::DeviceEnergyModel > ns3::WifiRadioEnergyModelHelper::DoInstall ( Ptr< NetDevice > device,
Ptr< energy::EnergySource > source ) const
overrideprivatevirtual
Parameters
devicePointer to the NetDevice to install DeviceEnergyModel.
sourcePointer to EnergySource to install.
Returns
Ptr<DeviceEnergyModel>

Implements DeviceEnergyModel::Install.

Implements ns3::DeviceEnergyModelHelper.

Definition at line 54 of file wifi-radio-energy-model-helper.cc.

References ns3::ObjectFactory::Create(), ns3::DynamicCast(), ns3::Object::GetObject(), ns3::ObjectFactory::GetTypeId(), ns3::TypeId::GetUid(), ns3::Callback< R, UArgs >::IsNull(), m_depletionCallback, m_radioEnergy, m_rechargedCallback, m_txCurrentModel, ns3::MakeCallback(), NS_ASSERT, NS_FATAL_ERROR, ns3::WifiPhy::ResumeFromOff(), and ns3::WifiPhy::SetOffMode().

+ Here is the call graph for this function:

◆ Set()

void ns3::WifiRadioEnergyModelHelper::Set ( std::string name,
const AttributeValue & v )
overridevirtual
Parameters
namethe name of the attribute to set
vthe value of the attribute

Sets an attribute of the underlying PHY object.

Implements ns3::DeviceEnergyModelHelper.

Definition at line 30 of file wifi-radio-energy-model-helper.cc.

References m_radioEnergy, and ns3::ObjectFactory::Set().

Referenced by BatteryLifetimeTest::ConstantLoadTest(), and BatteryLifetimeTest::VariableLoadTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDepletionCallback()

void ns3::WifiRadioEnergyModelHelper::SetDepletionCallback ( WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback callback)
Parameters
callbackCallback function for energy depletion handling.

Sets the callback to be invoked when energy is depleted.

Definition at line 36 of file wifi-radio-energy-model-helper.cc.

References m_depletionCallback.

Referenced by BasicEnergyDepletionTest::DepletionTestCase().

+ Here is the caller graph for this function:

◆ SetRechargedCallback()

void ns3::WifiRadioEnergyModelHelper::SetRechargedCallback ( WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback)
Parameters
callbackCallback function for energy recharged handling.

Sets the callback to be invoked when energy is recharged.

Definition at line 43 of file wifi-radio-energy-model-helper.cc.

References m_rechargedCallback.

◆ SetTxCurrentModel()

template<typename... Ts>
void ns3::WifiRadioEnergyModelHelper::SetTxCurrentModel ( std::string name,
Ts &&... args )
Template Parameters
Ts[deduced] Argument types
Parameters
namethe name of the model to set
[in]argsName and AttributeValue pairs to set.

Configure a Transmission Current model for this EnergySource.

Definition at line 96 of file wifi-radio-energy-model-helper.h.

References m_txCurrentModel.

Member Data Documentation

◆ m_depletionCallback

WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback ns3::WifiRadioEnergyModelHelper::m_depletionCallback
private

radio energy depletion callback

Definition at line 84 of file wifi-radio-energy-model-helper.h.

Referenced by WifiRadioEnergyModelHelper(), DoInstall(), and SetDepletionCallback().

◆ m_radioEnergy

ObjectFactory ns3::WifiRadioEnergyModelHelper::m_radioEnergy
private

radio energy

Definition at line 82 of file wifi-radio-energy-model-helper.h.

Referenced by WifiRadioEnergyModelHelper(), DoInstall(), and Set().

◆ m_rechargedCallback

WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback ns3::WifiRadioEnergyModelHelper::m_rechargedCallback
private

radio energy recharged callback

Definition at line 86 of file wifi-radio-energy-model-helper.h.

Referenced by WifiRadioEnergyModelHelper(), DoInstall(), and SetRechargedCallback().

◆ m_txCurrentModel

ObjectFactory ns3::WifiRadioEnergyModelHelper::m_txCurrentModel
private

transmit current model

Definition at line 87 of file wifi-radio-energy-model-helper.h.

Referenced by DoInstall(), and SetTxCurrentModel().


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