A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
energy-model-helper.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Network Security Lab, University of Washington, Seattle.
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Authors: Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
19
*/
20
21
#ifndef ENERGY_MODEL_HELPER_H
22
#define ENERGY_MODEL_HELPER_H
23
24
#include "ns3/attribute.h"
25
#include "ns3/object-factory.h"
26
#include "ns3/node-container.h"
27
#include "ns3/ptr.h"
28
#include "ns3/net-device.h"
29
#include "ns3/net-device-container.h"
30
#include "ns3/energy-source.h"
31
#include "ns3/device-energy-model.h"
32
#include "ns3/device-energy-model-container.h"
33
#include "
energy-source-container.h
"
34
35
namespace
ns3
{
36
45
class
EnergySourceHelper
46
{
47
public
:
48
virtual
~EnergySourceHelper
();
49
56
virtual
void
Set
(std::string name,
const
AttributeValue
&v) = 0;
57
64
EnergySourceContainer
Install
(
Ptr<Node>
node)
const
;
65
72
EnergySourceContainer
Install
(
NodeContainer
c)
const
;
73
80
EnergySourceContainer
Install
(std::string nodeName)
const
;
81
87
EnergySourceContainer
InstallAll
(
void
)
const
;
88
89
90
private
:
100
virtual
Ptr<EnergySource>
DoInstall
(
Ptr<Node>
node)
const
= 0;
101
102
};
103
104
116
class
DeviceEnergyModelHelper
117
{
118
public
:
119
virtual
~DeviceEnergyModelHelper
();
120
127
virtual
void
Set
(std::string name,
const
AttributeValue
&v) = 0;
128
137
DeviceEnergyModelContainer
Install
(
Ptr<NetDevice>
device,
138
Ptr<EnergySource>
source)
const
;
139
150
DeviceEnergyModelContainer
Install
(
NetDeviceContainer
deviceContainer,
151
EnergySourceContainer
sourceContainer)
const
;
152
153
154
private
:
165
virtual
Ptr<DeviceEnergyModel>
DoInstall
(
Ptr<NetDevice>
device,
166
Ptr<EnergySource>
source)
const
= 0;
167
168
};
169
170
}
// namespace ns3
171
172
#endif
/* ENERGY_MODEL_HELPER_H */
ns3::DeviceEnergyModelHelper
Creates DeviceEnergyModel objects.
Definition:
energy-model-helper.h:116
ns3::Ptr< Node >
ns3::EnergySourceHelper::~EnergySourceHelper
virtual ~EnergySourceHelper()
Definition:
energy-model-helper.cc:30
ns3::DeviceEnergyModelHelper::~DeviceEnergyModelHelper
virtual ~DeviceEnergyModelHelper()
Definition:
energy-model-helper.cc:86
ns3::EnergySourceContainer
Holds a vector of ns3::EnergySource pointers.
Definition:
energy-source-container.h:44
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:68
ns3::EnergySourceHelper::DoInstall
virtual Ptr< EnergySource > DoInstall(Ptr< Node > node) const =0
energy-source-container.h
ns3::DeviceEnergyModelContainer
Holds a vector of ns3::DeviceEnergyModel pointers.
Definition:
device-energy-model-container.h:43
ns3::EnergySourceHelper::Set
virtual void Set(std::string name, const AttributeValue &v)=0
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:41
ns3::EnergySourceHelper
Creates EnergySource objects.
Definition:
energy-model-helper.h:45
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:38
ns3::EnergySourceHelper::InstallAll
EnergySourceContainer InstallAll(void) const
This function installs an EnergySource on all nodes in simulation.
Definition:
energy-model-helper.cc:78
ns3::DeviceEnergyModelHelper::Set
virtual void Set(std::string name, const AttributeValue &v)=0
ns3::EnergySourceHelper::Install
EnergySourceContainer Install(Ptr< Node > node) const
Definition:
energy-model-helper.cc:35
ns3::DeviceEnergyModelHelper::DoInstall
virtual Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const =0
ns3::DeviceEnergyModelHelper::Install
DeviceEnergyModelContainer Install(Ptr< NetDevice > device, Ptr< EnergySource > source) const
Definition:
energy-model-helper.cc:91
src
energy
helper
energy-model-helper.h
Generated on Sat Jan 9 2021 14:08:18 for ns-3 by
1.8.14