A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
inet-topology-reader.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 Universita' di Firenze, Italy
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Tommaso Pecorella (tommaso.pecorella@unifi.it)
7
* Author: Valerio Sartini (valesar@gmail.com)
8
*/
9
10
#ifndef INET_TOPOLOGY_READER_H
11
#define INET_TOPOLOGY_READER_H
12
13
#include "
topology-reader.h
"
14
15
/**
16
* \file
17
* \ingroup topology
18
* ns3::InetTopologyReader declaration.
19
*/
20
21
namespace
ns3
22
{
23
24
// ------------------------------------------------------------
25
// --------------------------------------------
26
/**
27
* \ingroup topology
28
*
29
* \brief Topology file reader (Inet-format type).
30
*
31
* This class takes an input file in Inet format and extracts all
32
* the information needed to build the topology
33
* (i.e.number of nodes, links and links structure).
34
* It have been tested with Inet 3.0
35
* https://web.archive.org/web/20210308100536/http://topology.eecs.umich.edu/inet/
36
*
37
* It might set a link attribute named "Weight", corresponding to
38
* the euclidean distance between two nodes, the nodes being randomly positioned.
39
*/
40
class
InetTopologyReader
:
public
TopologyReader
41
{
42
public
:
43
/**
44
* \brief Get the type ID.
45
* \return the object TypeId.
46
*/
47
static
TypeId
GetTypeId
();
48
49
InetTopologyReader
();
50
~InetTopologyReader
()
override
;
51
52
// Delete copy constructor and assignment operator to avoid misuse
53
InetTopologyReader
(
const
InetTopologyReader
&) =
delete
;
54
InetTopologyReader
&
operator=
(
const
InetTopologyReader
&) =
delete
;
55
56
/**
57
* \brief Main topology reading function.
58
*
59
* This method opens an input stream and reads the Inet-format file.
60
* From the first line it takes the total number of nodes and links.
61
* Then discards a number of rows equals to total nodes (containing
62
* useless geographical information).
63
* Then reads until the end of the file (total links number rows) and saves
64
* the structure of every single link in the topology.
65
*
66
* \return The container of the nodes created (or empty container if there was an error)
67
*/
68
NodeContainer
Read
()
override
;
69
70
// end class InetTopologyReader
71
};
72
73
// end namespace ns3
74
};
// namespace ns3
75
76
#endif
/* INET_TOPOLOGY_READER_H */
ns3::InetTopologyReader
Topology file reader (Inet-format type).
Definition
inet-topology-reader.h:41
ns3::InetTopologyReader::InetTopologyReader
InetTopologyReader(const InetTopologyReader &)=delete
ns3::InetTopologyReader::Read
NodeContainer Read() override
Main topology reading function.
Definition
inet-topology-reader.cc:53
ns3::InetTopologyReader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
inet-topology-reader.cc:33
ns3::InetTopologyReader::InetTopologyReader
InetTopologyReader()
Definition
inet-topology-reader.cc:42
ns3::InetTopologyReader::~InetTopologyReader
~InetTopologyReader() override
Definition
inet-topology-reader.cc:47
ns3::InetTopologyReader::operator=
InetTopologyReader & operator=(const InetTopologyReader &)=delete
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::TopologyReader
Interface for input file readers management.
Definition
topology-reader.h:40
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
topology-reader.h
ns3::TopologyReader declaration.
src
topology-read
model
inet-topology-reader.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0