A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
wifi-radio-energy-model-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 Network Security Lab, University of Washington, Seattle.
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
7
*/
8
9
#ifndef WIFI_RADIO_ENERGY_MODEL_HELPER_H
10
#define WIFI_RADIO_ENERGY_MODEL_HELPER_H
11
12
#include "ns3/energy-model-helper.h"
13
#include "ns3/wifi-radio-energy-model.h"
14
15
namespace
ns3
16
{
17
18
/**
19
* \ingroup energy
20
* \brief Assign WifiRadioEnergyModel to wifi devices.
21
*
22
* This installer installs WifiRadioEnergyModel for only WifiNetDevice objects.
23
*
24
*/
25
class
WifiRadioEnergyModelHelper
:
public
DeviceEnergyModelHelper
26
{
27
public
:
28
/**
29
* Construct a helper which is used to add a radio energy model to a node
30
*/
31
WifiRadioEnergyModelHelper
();
32
33
/**
34
* Destroy a RadioEnergy Helper
35
*/
36
~WifiRadioEnergyModelHelper
()
override
;
37
38
/**
39
* \param name the name of the attribute to set
40
* \param v the value of the attribute
41
*
42
* Sets an attribute of the underlying PHY object.
43
*/
44
void
Set
(std::string name,
const
AttributeValue
& v)
override
;
45
46
/**
47
* \param callback Callback function for energy depletion handling.
48
*
49
* Sets the callback to be invoked when energy is depleted.
50
*/
51
void
SetDepletionCallback
(
WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback
callback);
52
53
/**
54
* \param callback Callback function for energy recharged handling.
55
*
56
* Sets the callback to be invoked when energy is recharged.
57
*/
58
void
SetRechargedCallback
(
WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback
callback);
59
60
/**
61
* \tparam Ts \deduced Argument types
62
* \param name the name of the model to set
63
* \param [in] args Name and AttributeValue pairs to set.
64
*
65
* Configure a Transmission Current model for this EnergySource.
66
*/
67
template
<
typename
... Ts>
68
void
SetTxCurrentModel
(std::string name, Ts&&... args);
69
70
private
:
71
/**
72
* \param device Pointer to the NetDevice to install DeviceEnergyModel.
73
* \param source Pointer to EnergySource to install.
74
* \returns Ptr<DeviceEnergyModel>
75
*
76
* Implements DeviceEnergyModel::Install.
77
*/
78
Ptr<energy::DeviceEnergyModel>
DoInstall
(
Ptr<NetDevice>
device,
79
Ptr<energy::EnergySource>
source)
const override
;
80
81
private
:
82
ObjectFactory
m_radioEnergy
;
///< radio energy
83
WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback
84
m_depletionCallback
;
///< radio energy depletion callback
85
WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback
86
m_rechargedCallback
;
///< radio energy recharged callback
87
ObjectFactory
m_txCurrentModel
;
///< transmit current model
88
};
89
90
/***************************************************************
91
* Implementation of the templates declared above.
92
***************************************************************/
93
94
template
<
typename
... Ts>
95
void
96
WifiRadioEnergyModelHelper::SetTxCurrentModel
(std::string name, Ts&&... args)
97
{
98
m_txCurrentModel
=
ObjectFactory
(name, std::forward<Ts>(args)...);
99
}
100
101
}
// namespace ns3
102
103
#endif
/* WIFI_RADIO_ENERGY_MODEL_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::Callback< void >
ns3::DeviceEnergyModelHelper
Creates DeviceEnergyModel objects.
Definition
energy-model-helper.h:104
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::WifiRadioEnergyModelHelper
Assign WifiRadioEnergyModel to wifi devices.
Definition
wifi-radio-energy-model-helper.h:26
ns3::WifiRadioEnergyModelHelper::~WifiRadioEnergyModelHelper
~WifiRadioEnergyModelHelper() override
Destroy a RadioEnergy Helper.
Definition
wifi-radio-energy-model-helper.cc:25
ns3::WifiRadioEnergyModelHelper::SetRechargedCallback
void SetRechargedCallback(WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback callback)
Definition
wifi-radio-energy-model-helper.cc:43
ns3::WifiRadioEnergyModelHelper::SetDepletionCallback
void SetDepletionCallback(WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback callback)
Definition
wifi-radio-energy-model-helper.cc:36
ns3::WifiRadioEnergyModelHelper::DoInstall
Ptr< energy::DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const override
Definition
wifi-radio-energy-model-helper.cc:54
ns3::WifiRadioEnergyModelHelper::m_rechargedCallback
WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback m_rechargedCallback
radio energy recharged callback
Definition
wifi-radio-energy-model-helper.h:86
ns3::WifiRadioEnergyModelHelper::WifiRadioEnergyModelHelper
WifiRadioEnergyModelHelper()
Construct a helper which is used to add a radio energy model to a node.
Definition
wifi-radio-energy-model-helper.cc:18
ns3::WifiRadioEnergyModelHelper::m_depletionCallback
WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback m_depletionCallback
radio energy depletion callback
Definition
wifi-radio-energy-model-helper.h:84
ns3::WifiRadioEnergyModelHelper::Set
void Set(std::string name, const AttributeValue &v) override
Definition
wifi-radio-energy-model-helper.cc:30
ns3::WifiRadioEnergyModelHelper::m_radioEnergy
ObjectFactory m_radioEnergy
radio energy
Definition
wifi-radio-energy-model-helper.h:82
ns3::WifiRadioEnergyModelHelper::m_txCurrentModel
ObjectFactory m_txCurrentModel
transmit current model
Definition
wifi-radio-energy-model-helper.h:87
ns3::WifiRadioEnergyModelHelper::SetTxCurrentModel
void SetTxCurrentModel(std::string name, Ts &&... args)
Definition
wifi-radio-energy-model-helper.h:96
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
wifi
helper
wifi-radio-energy-model-helper.h
Generated on Fri Nov 8 2024 13:59:07 for ns-3 by
1.11.0