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:
46  typedef std::vector< Ptr<DeviceEnergyModel> >::const_iterator Iterator;
47 
48 public:
53 
61 
69  DeviceEnergyModelContainer (std::string modelName);
70 
84 
104  Iterator Begin (void) const;
105 
125  Iterator End (void) const;
126 
132  uint32_t GetN (void) const;
133 
140  Ptr<DeviceEnergyModel> Get (uint32_t i) const;
141 
148  void Add (DeviceEnergyModelContainer container);
149 
155  void Add (Ptr<DeviceEnergyModel> model);
156 
163  void Add (std::string modelName);
164 
168  void Clear (void);
169 
170 private:
171  std::vector< Ptr<DeviceEnergyModel> > m_models;
172 
173 };
174 
175 } // namespace ns3
176 
177 #endif /* DEVICE_ENERGY_MODEL_CONTAINER_H */
std::vector< Ptr< DeviceEnergyModel > >::const_iterator Iterator
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void Add(DeviceEnergyModelContainer container)
Holds a vector of ns3::DeviceEnergyModel pointers.
Ptr< DeviceEnergyModel > Get(uint32_t i) const
Get the i-th Ptr<DeviceEnergyModel> stored in this container.
uint32_t GetN(void) const
Get the number of Ptr<DeviceEnergyModel> stored in this container.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Iterator End(void) const
Get an iterator which refers to the last DeviceEnergyModel pointer in the container.
Iterator Begin(void) const
Get an iterator which refers to the first DeviceEnergyModel pointer in the container.
std::vector< Ptr< DeviceEnergyModel > > m_models
DeviceEnergyModelContainer()
Creates an empty DeviceEnergyModelContainer.
void Clear(void)
Removes all elements in the container.