A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::DeviceEnergyModelHelper Class Referenceabstract

Creates DeviceEnergyModel objects. More...

#include <energy-model-helper.h>

+ Inheritance diagram for ns3::DeviceEnergyModelHelper:

Public Member Functions

virtual ~DeviceEnergyModelHelper ()
 
DeviceEnergyModelContainer Install (Ptr< NetDevice > device, Ptr< EnergySource > source) const
 
DeviceEnergyModelContainer Install (NetDeviceContainer deviceContainer, EnergySourceContainer sourceContainer) const
 
virtual void Set (std::string name, const AttributeValue &v)=0
 

Private Member Functions

virtual Ptr< DeviceEnergyModelDoInstall (Ptr< NetDevice > device, Ptr< EnergySource > source) const =0
 

Detailed Description

Creates DeviceEnergyModel objects.

This class helps to create and install DeviceEnergyModel onto NetDevice. A DeviceEnergyModel is connected to a NetDevice (or PHY object) by callbacks. Note that DeviceEnergyModel objects are not aggregated onto the node. They can be accessed through the EnergySource object, which is aggregated onto the node.

Definition at line 116 of file energy-model-helper.h.

Constructor & Destructor Documentation

ns3::DeviceEnergyModelHelper::~DeviceEnergyModelHelper ( )
virtual

Definition at line 86 of file energy-model-helper.cc.

Member Function Documentation

virtual Ptr<DeviceEnergyModel> ns3::DeviceEnergyModelHelper::DoInstall ( Ptr< NetDevice device,
Ptr< EnergySource source 
) const
privatepure virtual
Parameters
deviceThe net device corresponding to DeviceEnergyModel object.
sourceThe EnergySource the DeviceEnergyModel will be using.
Returns
Pointer to the created DeviceEnergyModel.

Child classes of DeviceEnergyModelHelper only have to implement this function, to create and aggregate an DeviceEnergyModel object onto a single node. The rest of the installation process (eg. installing EnergySource on set of nodes) is implemented in the DeviceEnergyModelHelper base class.

Implemented in ns3::AcousticModemEnergyModelHelper, and ns3::WifiRadioEnergyModelHelper.

Referenced by Install().

+ Here is the caller graph for this function:

DeviceEnergyModelContainer ns3::DeviceEnergyModelHelper::Install ( Ptr< NetDevice device,
Ptr< EnergySource source 
) const
Parameters
devicePointer to the NetDevice to install DeviceEnergyModel.
sourceThe EnergySource the DeviceEnergyModel will be using.
Returns
An DeviceEnergyModelContainer contains all the DeviceEnergyModels.

Installs an DeviceEnergyModel with a specified EnergySource onto a xNetDevice.

Definition at line 91 of file energy-model-helper.cc.

References DoInstall(), and NS_ASSERT.

Referenced by BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), ns3::AcousticModemEnergyTestCase::DoRun(), ns3::AcousticModemEnergyDepletionTestCase::DoRun(), main(), and BatteryLifetimeTest::VariableLoadTest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DeviceEnergyModelContainer ns3::DeviceEnergyModelHelper::Install ( NetDeviceContainer  deviceContainer,
EnergySourceContainer  sourceContainer 
) const
Parameters
deviceContainerList of NetDevices to be install DeviceEnergyModel objects.
sourceContainerList of EnergySource the DeviceEnergyModel will be using.
Returns
An DeviceEnergyModelContainer contains all the DeviceEnergyModels.

Installs DeviceEnergyModels with specified EnergySources onto a list of NetDevices.

Definition at line 103 of file energy-model-helper.cc.

References ns3::NetDeviceContainer::Begin(), ns3::EnergySourceContainer::Begin(), DoInstall(), ns3::NetDeviceContainer::End(), ns3::EnergySourceContainer::GetN(), ns3::NetDeviceContainer::GetN(), and NS_ASSERT.

+ Here is the call graph for this function:

virtual void ns3::DeviceEnergyModelHelper::Set ( std::string  name,
const AttributeValue v 
)
pure virtual
Parameters
nameName of attribute to set.
vValue of the attribute.

Sets one of the attributes of underlying DeviceEnergyModel.

Implemented in ns3::AcousticModemEnergyModelHelper, and ns3::WifiRadioEnergyModelHelper.


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