A Discrete-Event Network Simulator
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 
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 
47 {
48  public:
49  virtual ~EnergySourceHelper();
50 
57  virtual void Set(std::string name, const AttributeValue& v) = 0;
58 
66 
74 
81  EnergySourceContainer Install(std::string nodeName) const;
82 
89 
90  private:
100  virtual Ptr<EnergySource> DoInstall(Ptr<Node> node) const = 0;
101 };
102 
115 {
116  public:
117  virtual ~DeviceEnergyModelHelper();
118 
125  virtual void Set(std::string name, const AttributeValue& v) = 0;
126 
136 
148  EnergySourceContainer sourceContainer) const;
149 
150  private:
162  Ptr<EnergySource> source) const = 0;
163 };
164 
165 } // namespace ns3
166 
167 #endif /* ENERGY_MODEL_HELPER_H */
Hold a value for an Attribute.
Definition: attribute.h:70
Holds a vector of ns3::DeviceEnergyModel pointers.
Creates DeviceEnergyModel objects.
DeviceEnergyModelContainer Install(Ptr< NetDevice > device, Ptr< EnergySource > source) const
virtual void Set(std::string name, const AttributeValue &v)=0
virtual Ptr< DeviceEnergyModel > DoInstall(Ptr< NetDevice > device, Ptr< EnergySource > source) const =0
Holds a vector of ns3::EnergySource pointers.
Creates EnergySource objects.
EnergySourceContainer Install(Ptr< Node > node) const
virtual void Set(std::string name, const AttributeValue &v)=0
virtual Ptr< EnergySource > DoInstall(Ptr< Node > node) const =0
EnergySourceContainer InstallAll() const
This function installs an EnergySource on all nodes in simulation.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Every class exported by the ns3 library is enclosed in the ns3 namespace.