A Discrete-Event Network Simulator
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"
34 
35 namespace ns3 {
36 
46 {
47 public:
48  virtual ~EnergySourceHelper ();
49 
56  virtual void Set (std::string name, const AttributeValue &v) = 0;
57 
65 
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 
117 {
118 public:
119  virtual ~DeviceEnergyModelHelper ();
120 
127  virtual void Set (std::string name, const AttributeValue &v) = 0;
128 
138  Ptr<EnergySource> source) const;
139 
151  EnergySourceContainer sourceContainer) const;
152 
153 
154 private:
166  Ptr<EnergySource> source) const = 0;
167 
168 };
169 
170 } // namespace ns3
171 
172 #endif /* ENERGY_MODEL_HELPER_H */
Hold a value for an Attribute.
Definition: attribute.h:69
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
EnergySourceContainer InstallAll(void) const
This function installs an EnergySource on all nodes in simulation.
virtual void Set(std::string name, const AttributeValue &v)=0
virtual Ptr< EnergySource > DoInstall(Ptr< Node > node) const =0
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.