A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
rocketfuel-topology-reader.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 Hajime Tazaki
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: Hajime Tazaki (tazaki@sfc.wide.ad.jp)
18
*/
19
20
#ifndef ROCKETFUEL_TOPOLOGY_READER_H
21
#define ROCKETFUEL_TOPOLOGY_READER_H
22
23
#include "
topology-reader.h
"
24
31
namespace
ns3
32
{
33
34
// ------------------------------------------------------------
35
// --------------------------------------------
47
class
RocketfuelTopologyReader
:
public
TopologyReader
48
{
49
public
:
54
static
TypeId
GetTypeId
();
55
56
RocketfuelTopologyReader
();
57
~RocketfuelTopologyReader
()
override
;
58
59
// Delete copy constructor and assignment operator to avoid misuse
60
RocketfuelTopologyReader
(
const
RocketfuelTopologyReader
&) =
delete
;
61
RocketfuelTopologyReader
&
operator=
(
const
RocketfuelTopologyReader
&) =
delete
;
62
73
NodeContainer
Read
()
override
;
74
75
private
:
85
NodeContainer
GenerateFromMapsFile
(
const
std::vector<std::string>& argv);
86
96
NodeContainer
GenerateFromWeightsFile
(
const
std::vector<std::string>& argv);
97
101
enum
RF_FileType
102
{
103
RF_MAPS
,
104
RF_WEIGHTS
,
105
RF_UNKNOWN
106
};
107
114
RF_FileType
GetFileType
(
const
std::string& buf);
115
116
int
m_linksNumber
;
117
int
m_nodesNumber
;
118
std::map<std::string, Ptr<Node>>
m_nodeMap
;
119
120
// end class RocketfuelTopologyReader
121
};
122
123
// end namespace ns3
124
};
// namespace ns3
125
126
#endif
/* ROCKETFUEL_TOPOLOGY_READER_H */
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::RocketfuelTopologyReader
Topology file reader (Rocketfuel-format type).
Definition:
rocketfuel-topology-reader.h:48
ns3::RocketfuelTopologyReader::RF_FileType
RF_FileType
Enum of the possible file types.
Definition:
rocketfuel-topology-reader.h:102
ns3::RocketfuelTopologyReader::RF_MAPS
@ RF_MAPS
Definition:
rocketfuel-topology-reader.h:103
ns3::RocketfuelTopologyReader::RF_UNKNOWN
@ RF_UNKNOWN
Definition:
rocketfuel-topology-reader.h:105
ns3::RocketfuelTopologyReader::RF_WEIGHTS
@ RF_WEIGHTS
Definition:
rocketfuel-topology-reader.h:104
ns3::RocketfuelTopologyReader::operator=
RocketfuelTopologyReader & operator=(const RocketfuelTopologyReader &)=delete
ns3::RocketfuelTopologyReader::RocketfuelTopologyReader
RocketfuelTopologyReader()
Definition:
rocketfuel-topology-reader.cc:55
ns3::RocketfuelTopologyReader::RocketfuelTopologyReader
RocketfuelTopologyReader(const RocketfuelTopologyReader &)=delete
ns3::RocketfuelTopologyReader::GenerateFromWeightsFile
NodeContainer GenerateFromWeightsFile(const std::vector< std::string > &argv)
Topology read function from a file containing the nodes weights.
Definition:
rocketfuel-topology-reader.cc:254
ns3::RocketfuelTopologyReader::m_nodeMap
std::map< std::string, Ptr< Node > > m_nodeMap
Map of the nodes (name, node).
Definition:
rocketfuel-topology-reader.h:118
ns3::RocketfuelTopologyReader::m_nodesNumber
int m_nodesNumber
Number of nodes.
Definition:
rocketfuel-topology-reader.h:117
ns3::RocketfuelTopologyReader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
rocketfuel-topology-reader.cc:46
ns3::RocketfuelTopologyReader::GetFileType
RF_FileType GetFileType(const std::string &buf)
Classifies the file type according to its content.
Definition:
rocketfuel-topology-reader.cc:323
ns3::RocketfuelTopologyReader::GenerateFromMapsFile
NodeContainer GenerateFromMapsFile(const std::vector< std::string > &argv)
Topology read function from a file containing the nodes map.
Definition:
rocketfuel-topology-reader.cc:127
ns3::RocketfuelTopologyReader::~RocketfuelTopologyReader
~RocketfuelTopologyReader() override
Definition:
rocketfuel-topology-reader.cc:62
ns3::RocketfuelTopologyReader::Read
NodeContainer Read() override
Main topology reading function.
Definition:
rocketfuel-topology-reader.cc:342
ns3::RocketfuelTopologyReader::m_linksNumber
int m_linksNumber
Number of links.
Definition:
rocketfuel-topology-reader.h:116
ns3::TopologyReader
Interface for input file readers management.
Definition:
topology-reader.h:51
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
topology-reader.h
ns3::TopologyReader declaration.
src
topology-read
model
rocketfuel-topology-reader.h
Generated on Sun Mar 3 2024 17:11:09 for ns-3 by
1.9.1