A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
building-list.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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 * Author: Jaume Nin <jaume.nin@cttc,cat>
18 * Based on NodeList implementation by Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 *
20 */
21
22#ifndef BUILDING_LIST_H_
23#define BUILDING_LIST_H_
24
25#include "ns3/ptr.h"
26
27#include <vector>
28
29namespace ns3
30{
31
32class Building;
33
34/**
35 * \ingroup buildings
36 *
37 * Container for Building class
38 */
40{
41 public:
42 /// Const Iterator
43 typedef std::vector<Ptr<Building>>::const_iterator Iterator;
44
45 /**
46 * \param building building to add
47 * \returns index of building in list.
48 *
49 * This method is called automatically from Building::Building so
50 * the user has little reason to call it himself.
51 */
52 static uint32_t Add(Ptr<Building> building);
53 /**
54 * \returns a C++ iterator located at the beginning of this
55 * list.
56 */
57 static Iterator Begin();
58 /**
59 * \returns a C++ iterator located at the end of this
60 * list.
61 */
62 static Iterator End();
63 /**
64 * \param n index of requested building.
65 * \returns the Building associated to index n.
66 */
68 /**
69 * \returns the number of buildings currently in the list.
70 */
71 static uint32_t GetNBuildings();
72};
73
74} // namespace ns3
75
76#endif /* BUILDING_LIST_H_ */
Container for Building class.
Definition: building-list.h:40
static Ptr< Building > GetBuilding(uint32_t n)
std::vector< Ptr< Building > >::const_iterator Iterator
Const Iterator.
Definition: building-list.h:43
static uint32_t GetNBuildings()
static Iterator End()
static uint32_t Add(Ptr< Building > building)
static Iterator Begin()
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Every class exported by the ns3 library is enclosed in the ns3 namespace.