A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
18
*/
19
20
#ifndef ENERGY_MODEL_HELPER_H
21
#define ENERGY_MODEL_HELPER_H
22
23
#include "
energy-source-container.h
"
24
25
#include "ns3/attribute.h"
26
#include "ns3/device-energy-model-container.h"
27
#include "ns3/device-energy-model.h"
28
#include "ns3/energy-source.h"
29
#include "ns3/net-device-container.h"
30
#include "ns3/net-device.h"
31
#include "ns3/node-container.h"
32
#include "ns3/object-factory.h"
33
#include "ns3/ptr.h"
34
35
namespace
ns3
36
{
37
46
class
EnergySourceHelper
47
{
48
public
:
49
virtual
~EnergySourceHelper
();
50
57
virtual
void
Set
(std::string name,
const
AttributeValue
& v) = 0;
58
65
EnergySourceContainer
Install
(
Ptr<Node>
node)
const
;
66
73
EnergySourceContainer
Install
(
NodeContainer
c)
const
;
74
81
EnergySourceContainer
Install
(std::string nodeName)
const
;
82
88
EnergySourceContainer
InstallAll
()
const
;
89
90
private
:
100
virtual
Ptr<EnergySource>
DoInstall
(
Ptr<Node>
node)
const
= 0;
101
};
102
114
class
DeviceEnergyModelHelper
115
{
116
public
:
117
virtual
~DeviceEnergyModelHelper
();
118
125
virtual
void
Set
(std::string name,
const
AttributeValue
& v) = 0;
126
135
DeviceEnergyModelContainer
Install
(
Ptr<NetDevice>
device,
Ptr<EnergySource>
source)
const
;
136
147
DeviceEnergyModelContainer
Install
(
NetDeviceContainer
deviceContainer,
148
EnergySourceContainer
sourceContainer)
const
;
149
150
private
:
161
virtual
Ptr<DeviceEnergyModel>
DoInstall
(
Ptr<NetDevice>
device,
162
Ptr<EnergySource>
source)
const
= 0;
163
};
164
165
}
// namespace ns3
166
167
#endif
/* ENERGY_MODEL_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::DeviceEnergyModelContainer
Holds a vector of ns3::DeviceEnergyModel pointers.
Definition:
device-energy-model-container.h:45
ns3::DeviceEnergyModelHelper
Creates DeviceEnergyModel objects.
Definition:
energy-model-helper.h:115
ns3::DeviceEnergyModelHelper::Install
DeviceEnergyModelContainer Install(Ptr< NetDevice > device, Ptr< EnergySource > source) const
Definition:
energy-model-helper.cc:92
ns3::DeviceEnergyModelHelper::~DeviceEnergyModelHelper
virtual ~DeviceEnergyModelHelper()
Definition:
energy-model-helper.cc:87
ns3::DeviceEnergyModelHelper::Set
virtual void Set(std::string name, const AttributeValue &v)=0
ns3::DeviceEnergyModelHelper::DoInstall
virtual Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const =0
ns3::EnergySourceContainer
Holds a vector of ns3::EnergySource pointers.
Definition:
energy-source-container.h:46
ns3::EnergySourceHelper
Creates EnergySource objects.
Definition:
energy-model-helper.h:47
ns3::EnergySourceHelper::~EnergySourceHelper
virtual ~EnergySourceHelper()
Definition:
energy-model-helper.cc:31
ns3::EnergySourceHelper::Install
EnergySourceContainer Install(Ptr< Node > node) const
Definition:
energy-model-helper.cc:36
ns3::EnergySourceHelper::Set
virtual void Set(std::string name, const AttributeValue &v)=0
ns3::EnergySourceHelper::DoInstall
virtual Ptr< EnergySource > DoInstall(Ptr< Node > node) const =0
ns3::EnergySourceHelper::InstallAll
EnergySourceContainer InstallAll() const
This function installs an EnergySource on all nodes in simulation.
Definition:
energy-model-helper.cc:79
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::Ptr< Node >
energy-source-container.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
energy
helper
energy-model-helper.h
Generated on Sun Mar 3 2024 17:10:57 for ns-3 by
1.9.1