A Discrete-Event Network Simulator
API
device-energy-model-container.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 INRIA
4  * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu>
21  */
22 
23 #ifndef DEVICE_ENERGY_MODEL_CONTAINER_H
24 #define DEVICE_ENERGY_MODEL_CONTAINER_H
25 
26 #include "ns3/device-energy-model.h"
27 #include <vector>
28 #include <stdint.h>
29 
30 namespace ns3 {
31 
44 {
45 public:
47  typedef std::vector< Ptr<DeviceEnergyModel> >::const_iterator Iterator;
48 
49 public:
54 
62 
70  DeviceEnergyModelContainer (std::string modelName);
71 
85 
105  Iterator Begin (void) const;
106 
126  Iterator End (void) const;
127 
133  uint32_t GetN (void) const;
134 
141  Ptr<DeviceEnergyModel> Get (uint32_t i) const;
142 
149  void Add (DeviceEnergyModelContainer container);
150 
156  void Add (Ptr<DeviceEnergyModel> model);
157 
164  void Add (std::string modelName);
165 
169  void Clear (void);
170 
171 private:
172  std::vector< Ptr<DeviceEnergyModel> > m_models;
173 
174 };
175 
176 } // namespace ns3
177 
178 #endif /* DEVICE_ENERGY_MODEL_CONTAINER_H */
Holds a vector of ns3::DeviceEnergyModel pointers.
DeviceEnergyModelContainer()
Creates an empty DeviceEnergyModelContainer.
Iterator End(void) const
Get an iterator which refers to the last DeviceEnergyModel pointer in the container.
void Add(DeviceEnergyModelContainer container)
std::vector< Ptr< DeviceEnergyModel > > m_models
Container of Energy models.
Iterator Begin(void) const
Get an iterator which refers to the first DeviceEnergyModel pointer in the container.
std::vector< Ptr< DeviceEnergyModel > >::const_iterator Iterator
Const iterator of DeviceEnergyModel container.
uint32_t GetN(void) const
Get the number of Ptr<DeviceEnergyModel> stored in this container.
void Clear(void)
Removes all elements in the container.
Ptr< DeviceEnergyModel > Get(uint32_t i) const
Get the i-th Ptr<DeviceEnergyModel> stored in this container.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Every class exported by the ns3 library is enclosed in the ns3 namespace.