A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
node-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
*
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef NODE_CONTAINER_H
21
#define NODE_CONTAINER_H
22
23
#include <stdint.h>
24
#include <vector>
25
#include "ns3/node.h"
26
27
namespace
ns3
{
28
38
class
NodeContainer
39
{
40
public
:
42
typedef
std::vector<Ptr<Node> >::const_iterator
Iterator
;
43
47
NodeContainer
();
48
55
NodeContainer
(
Ptr<Node>
node);
56
64
NodeContainer
(std::string nodeName);
65
78
NodeContainer
(uint32_t n, uint32_t systemId = 0);
79
95
NodeContainer
(
const
NodeContainer
&a,
const
NodeContainer
&b);
96
113
NodeContainer
(
const
NodeContainer
&a,
const
NodeContainer
&b,
const
NodeContainer
&c);
114
132
NodeContainer
(
const
NodeContainer
&a,
const
NodeContainer
&b,
const
NodeContainer
&c,
const
NodeContainer
&d);
133
152
NodeContainer
(
const
NodeContainer
&a,
const
NodeContainer
&b,
const
NodeContainer
&c,
const
NodeContainer
&d,
153
const
NodeContainer
&e);
154
174
Iterator
Begin
(
void
)
const
;
175
195
Iterator
End
(
void
)
const
;
196
217
uint32_t
GetN
(
void
)
const
;
218
240
Ptr<Node>
Get
(uint32_t i)
const
;
241
252
void
Create
(uint32_t n);
253
266
void
Create
(uint32_t n, uint32_t systemId);
267
274
void
Add
(
NodeContainer
other);
275
281
void
Add
(
Ptr<Node>
node);
282
289
void
Add
(std::string nodeName);
290
303
static
NodeContainer
GetGlobal
(
void
);
304
311
bool
Contains
(uint32_t
id
)
const
;
312
313
private
:
314
std::vector<Ptr<Node> >
m_nodes
;
315
};
316
317
}
// namespace ns3
318
319
#endif
/* NODE_CONTAINER_H */
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:39
ns3::NodeContainer::m_nodes
std::vector< Ptr< Node > > m_nodes
Nodes smart pointers.
Definition:
node-container.h:314
ns3::NodeContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
Definition:
node-container.cc:77
ns3::NodeContainer::GetN
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
Definition:
node-container.cc:88
ns3::NodeContainer::End
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Definition:
node-container.cc:82
ns3::NodeContainer::GetGlobal
static NodeContainer GetGlobal(void)
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and ...
Definition:
node-container.cc:134
ns3::NodeContainer::Create
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Definition:
node-container.cc:98
ns3::NodeContainer::Contains
bool Contains(uint32_t id) const
Return true if container contains a Node with index id.
Definition:
node-container.cc:145
ns3::NodeContainer::Iterator
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Definition:
node-container.h:42
ns3::NodeContainer::Add
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
Definition:
node-container.cc:114
ns3::NodeContainer::NodeContainer
NodeContainer()
Create an empty NodeContainer.
Definition:
node-container.cc:26
ns3::NodeContainer::Get
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Definition:
node-container.cc:93
ns3::Ptr< Node >
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
helper
node-container.h
Generated on Tue Feb 6 2024 19:21:25 for ns-3 by
1.9.1