A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
buildings
helper
building-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) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (original node-container.h)
20
* Nicola Baldo (wrote building-container.h based on node-container.h)
21
*/
22
#ifndef BUILDING_CONTAINER_H
23
#define BUILDING_CONTAINER_H
24
25
#include <stdint.h>
26
#include <vector>
27
#include <ns3/building.h>
28
29
namespace
ns3
{
30
40
class
BuildingContainer
41
{
42
public
:
43
typedef
std::vector<Ptr<Building> >::const_iterator
Iterator
;
44
48
BuildingContainer
();
49
56
BuildingContainer
(
Ptr<Building>
building);
57
65
BuildingContainer
(std::string buildingName);
66
86
Iterator
Begin
(
void
)
const
;
87
107
Iterator
End
(
void
)
const
;
108
129
uint32_t
GetN
(
void
)
const
;
130
152
Ptr<Building>
Get
(uint32_t i)
const
;
153
164
void
Create
(uint32_t
n
);
165
172
void
Add
(
BuildingContainer
other);
173
179
void
Add
(
Ptr<Building>
building);
180
187
void
Add
(std::string buildingName);
188
200
static
BuildingContainer
GetGlobal
(
void
);
201
202
private
:
203
std::vector<Ptr<Building> >
m_buildings
;
204
};
205
206
}
// namespace ns3
207
208
#endif
/* BUILDING_CONTAINER_H */
ns3::BuildingContainer::BuildingContainer
BuildingContainer()
Create an empty BuildingContainer.
Definition:
building-container.cc:28
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::BuildingContainer::Add
void Add(BuildingContainer other)
Append the contents of another BuildingContainer to the end of this container.
Definition:
building-container.cc:72
ns3::BuildingContainer::GetGlobal
static BuildingContainer GetGlobal(void)
Create a BuildingContainer that contains a list of all buildings stored in the ns3::BuildingList.
Definition:
building-container.cc:92
sample-rng-plot.n
n
Definition:
sample-rng-plot.py:37
ns3::BuildingContainer
keep track of a set of building pointers.
Definition:
building-container.h:40
ns3::BuildingContainer::Iterator
std::vector< Ptr< Building > >::const_iterator Iterator
Definition:
building-container.h:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::BuildingContainer::Create
void Create(uint32_t n)
Create n buildings and append pointers to them to the end of this BuildingContainer.
Definition:
building-container.cc:64
ns3::BuildingContainer::End
Iterator End(void) const
Get an iterator which indicates past-the-last Building in the container.
Definition:
building-container.cc:48
ns3::BuildingContainer::m_buildings
std::vector< Ptr< Building > > m_buildings
Definition:
building-container.h:203
ns3::BuildingContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first Building in the container.
Definition:
building-container.cc:43
ns3::BuildingContainer::GetN
uint32_t GetN(void) const
Get the number of Ptr<Building> stored in this container.
Definition:
building-container.cc:54
ns3::BuildingContainer::Get
Ptr< Building > Get(uint32_t i) const
Get the Ptr<Building> stored in this container at a given index.
Definition:
building-container.cc:59
Generated on Wed Nov 7 2018 10:01:48 for ns-3 by
1.8.14