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
lora-radio-energy-model-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Romagnolo Stefano <romagnolostefano93@gmail.com>
7
*/
8
9
#ifndef LORA_RADIO_ENERGY_MODEL_HELPER_H
10
#define LORA_RADIO_ENERGY_MODEL_HELPER_H
11
12
#include "ns3/energy-model-helper.h"
13
14
namespace
ns3
15
{
16
namespace
lorawan
17
{
18
19
/**
20
* @ingroup lorawan
21
*
22
* Installs LoraRadioEnergyModel on devices.
23
*
24
* This installer installs LoraRadioEnergyModel for only LoraNetDevice objects.
25
*/
26
class
LoraRadioEnergyModelHelper
:
public
DeviceEnergyModelHelper
27
{
28
public
:
29
LoraRadioEnergyModelHelper
();
//!< Default constructor
30
~LoraRadioEnergyModelHelper
()
override
;
//!< Destructor
31
32
/**
33
* @param name The name of the attribute to set.
34
* @param v The value of the attribute.
35
*
36
* Sets an attribute of the underlying PHY object.
37
*/
38
void
Set
(std::string name,
const
AttributeValue
&
v
)
override
;
39
40
/**
41
* @tparam Ts \deduced Argument types
42
* @param name the name of the model to set
43
* @param [in] args Name and AttributeValue pairs to set.
44
*
45
* Configure a Transmission Current model for this EnergySource.
46
*/
47
template
<
typename
... Ts>
48
void
SetTxCurrentModel
(std::string name, Ts&&... args);
49
50
private
:
51
/**
52
* @param device Pointer to the NetDevice to install DeviceEnergyModel.
53
* @param source Pointer to EnergySource to install.
54
* @return Ptr<DeviceEnergyModel>.
55
*
56
* Implements DeviceEnergyModel::Install.
57
*/
58
Ptr<energy::DeviceEnergyModel>
DoInstall
(
Ptr<NetDevice>
device,
59
Ptr<energy::EnergySource>
source)
const override
;
60
61
private
:
62
ObjectFactory
m_radioEnergy
;
///< radio energy
63
ObjectFactory
m_txCurrentModel
;
///< transmit current model
64
};
65
66
template
<
typename
... Ts>
67
void
68
LoraRadioEnergyModelHelper::SetTxCurrentModel
(std::string name, Ts&&... args)
69
{
70
m_txCurrentModel
=
ObjectFactory
(name, std::forward<Ts>(args)...);
71
}
72
73
}
// namespace lorawan
74
}
// namespace ns3
75
76
#endif
/* LORA_RADIO_ENERGY_MODEL_HELPER_H */
v
uint32_t v
Definition
cairo-wideint.c:749
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
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
ptr.h:70
ns3::lorawan::LoraRadioEnergyModelHelper::m_radioEnergy
ObjectFactory m_radioEnergy
radio energy
Definition
lora-radio-energy-model-helper.h:62
ns3::lorawan::LoraRadioEnergyModelHelper::Set
void Set(std::string name, const AttributeValue &v) override
Definition
lora-radio-energy-model-helper.cc:30
ns3::lorawan::LoraRadioEnergyModelHelper::m_txCurrentModel
ObjectFactory m_txCurrentModel
transmit current model
Definition
lora-radio-energy-model-helper.h:63
ns3::lorawan::LoraRadioEnergyModelHelper::~LoraRadioEnergyModelHelper
~LoraRadioEnergyModelHelper() override
Destructor.
Definition
lora-radio-energy-model-helper.cc:25
ns3::lorawan::LoraRadioEnergyModelHelper::DoInstall
Ptr< energy::DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< energy::EnergySource > source) const override
Definition
lora-radio-energy-model-helper.cc:40
ns3::lorawan::LoraRadioEnergyModelHelper::SetTxCurrentModel
void SetTxCurrentModel(std::string name, Ts &&... args)
Definition
lora-radio-energy-model-helper.h:68
ns3::lorawan::LoraRadioEnergyModelHelper::LoraRadioEnergyModelHelper
LoraRadioEnergyModelHelper()
Default constructor.
Definition
lora-radio-energy-model-helper.cc:20
ns3::lorawan
Definition
forwarder-helper.cc:19
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
helper
lora-radio-energy-model-helper.h
Generated on
for ns-3 by
1.16.1