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
rv-battery-model-helper.cc
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
* Authors: Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
7
*/
8
9
#include "
rv-battery-model-helper.h
"
10
11
#include "ns3/energy-source.h"
12
13
namespace
ns3
14
{
15
16
RvBatteryModelHelper::RvBatteryModelHelper
()
17
{
18
m_rvBatteryModel
.
SetTypeId
(
"ns3::energy::RvBatteryModel"
);
19
}
20
21
RvBatteryModelHelper::~RvBatteryModelHelper
()
22
{
23
}
24
25
void
26
RvBatteryModelHelper::Set
(std::string name,
const
AttributeValue
& v)
27
{
28
m_rvBatteryModel
.
Set
(name, v);
29
}
30
31
Ptr<energy::EnergySource>
32
RvBatteryModelHelper::DoInstall
(
Ptr<Node>
node)
const
33
{
34
NS_ASSERT
(node);
35
Ptr<energy::EnergySource>
source =
m_rvBatteryModel
.
Create
<
energy::EnergySource
>();
36
NS_ASSERT
(source);
37
source->SetNode(node);
38
return
source;
39
}
40
41
}
// namespace ns3
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
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::RvBatteryModelHelper::RvBatteryModelHelper
RvBatteryModelHelper()
Definition
rv-battery-model-helper.cc:16
ns3::RvBatteryModelHelper::DoInstall
Ptr< energy::EnergySource > DoInstall(Ptr< Node > node) const override
Definition
rv-battery-model-helper.cc:32
ns3::RvBatteryModelHelper::m_rvBatteryModel
ObjectFactory m_rvBatteryModel
RV Battery factory.
Definition
rv-battery-model-helper.h:36
ns3::RvBatteryModelHelper::Set
void Set(std::string name, const AttributeValue &v) override
Definition
rv-battery-model-helper.cc:26
ns3::RvBatteryModelHelper::~RvBatteryModelHelper
~RvBatteryModelHelper() override
Definition
rv-battery-model-helper.cc:21
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
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
rv-battery-model-helper.h
src
energy
helper
rv-battery-model-helper.cc
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0