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
li-ion-energy-source-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Wireless Communications and Networking Group (WCNG),
3
* University of Rochester, Rochester, NY, USA.
4
*
5
* SPDX-License-Identifier: GPL-2.0-only
6
*
7
* Authors: Hoda Ayatollahi <hayatoll@ur.rochester.edu>
8
* Cristiano Tapparello <cristiano.tapparello@rochester.edu>
9
*/
10
11
#include "
li-ion-energy-source-helper.h
"
12
13
#include "ns3/energy-source.h"
14
15
namespace
ns3
16
{
17
18
LiIonEnergySourceHelper::LiIonEnergySourceHelper
()
19
{
20
m_liIonEnergySource
.
SetTypeId
(
"ns3::energy::LiIonEnergySource"
);
21
}
22
23
LiIonEnergySourceHelper::~LiIonEnergySourceHelper
()
24
{
25
}
26
27
void
28
LiIonEnergySourceHelper::Set
(std::string name,
const
AttributeValue
& v)
29
{
30
m_liIonEnergySource
.
Set
(name, v);
31
}
32
33
Ptr<energy::EnergySource>
34
LiIonEnergySourceHelper::DoInstall
(
Ptr<Node>
node)
const
35
{
36
NS_ASSERT
(node);
37
Ptr<energy::EnergySource>
source =
m_liIonEnergySource
.
Create
<
energy::EnergySource
>();
38
NS_ASSERT
(source);
39
source->SetNode(node);
40
return
source;
41
}
42
43
}
// namespace ns3
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::LiIonEnergySourceHelper::m_liIonEnergySource
ObjectFactory m_liIonEnergySource
LiIon Battery factory.
Definition
li-ion-energy-source-helper.h:38
ns3::LiIonEnergySourceHelper::~LiIonEnergySourceHelper
~LiIonEnergySourceHelper() override
Definition
li-ion-energy-source-helper.cc:23
ns3::LiIonEnergySourceHelper::DoInstall
Ptr< energy::EnergySource > DoInstall(Ptr< Node > node) const override
Definition
li-ion-energy-source-helper.cc:34
ns3::LiIonEnergySourceHelper::Set
void Set(std::string name, const AttributeValue &v) override
Definition
li-ion-energy-source-helper.cc:28
ns3::LiIonEnergySourceHelper::LiIonEnergySourceHelper
LiIonEnergySourceHelper()
Definition
li-ion-energy-source-helper.cc:18
ns3::ObjectFactory::Create
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
Definition
object-factory.cc:82
ns3::ObjectFactory::Set
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Definition
object-factory.h:213
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Definition
object-factory.cc:31
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::energy::EnergySource
Energy source base class.
Definition
energy-source.h:77
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition
assert.h:55
li-ion-energy-source-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
energy
helper
li-ion-energy-source-helper.cc
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0