A Discrete-Event Network Simulator
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
21namespace 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 */
41{
42 public:
43 /**
44 * \brief Get the type ID.
45 * \return the object TypeId.
46 */
47 static TypeId GetTypeId();
48
50 ~InetTopologyReader() override;
51
52 // Delete copy constructor and assignment operator to avoid misuse
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 */
Topology file reader (Inet-format type).
InetTopologyReader(const InetTopologyReader &)=delete
NodeContainer Read() override
Main topology reading function.
static TypeId GetTypeId()
Get the type ID.
InetTopologyReader & operator=(const InetTopologyReader &)=delete
keep track of a set of node pointers.
Interface for input file readers management.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TopologyReader declaration.