A Discrete-Event Network Simulator
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
10
11#include "ns3/energy-source.h"
12
13namespace ns3
14{
15
17{
18 m_rvBatteryModel.SetTypeId("ns3::energy::RvBatteryModel");
19}
20
24
25void
26RvBatteryModelHelper::Set(std::string name, const AttributeValue& v)
27{
28 m_rvBatteryModel.Set(name, v);
29}
30
33{
34 NS_ASSERT(node);
36 NS_ASSERT(source);
37 source->SetNode(node);
38 return source;
39}
40
41} // namespace ns3
Hold a value for an Attribute.
Definition attribute.h:59
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Smart pointer class similar to boost::intrusive_ptr.
Ptr< energy::EnergySource > DoInstall(Ptr< Node > node) const override
ObjectFactory m_rvBatteryModel
RV Battery factory.
void Set(std::string name, const AttributeValue &v) override
Energy source base class.
#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
Every class exported by the ns3 library is enclosed in the ns3 namespace.