A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
rocketfuel-topology-reader.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Hajime Tazaki
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: Hajime Tazaki (tazaki@sfc.wide.ad.jp)
19
*/
20
21
#ifndef ROCKETFUEL_TOPOLOGY_READER_H
22
#define ROCKETFUEL_TOPOLOGY_READER_H
23
24
#include "
topology-reader.h
"
25
32
namespace
ns3
{
33
34
35
// ------------------------------------------------------------
36
// --------------------------------------------
48
class
RocketfuelTopologyReader
:
public
TopologyReader
49
{
50
public
:
55
static
TypeId
GetTypeId
(
void
);
56
57
RocketfuelTopologyReader
();
58
virtual
~RocketfuelTopologyReader
();
59
60
// Delete copy constructor and assignment operator to avoid misuse
61
RocketfuelTopologyReader
(
const
RocketfuelTopologyReader
&) =
delete
;
62
RocketfuelTopologyReader
&
operator =
(
const
RocketfuelTopologyReader
&) =
delete
;
63
74
virtual
NodeContainer
Read
(
void
);
75
76
private
:
87
NodeContainer
GenerateFromMapsFile
(
int
argc,
char
*argv[]);
88
99
NodeContainer
GenerateFromWeightsFile
(
int
argc,
char
*argv[]);
100
104
enum
RF_FileType
105
{
106
RF_MAPS
,
107
RF_WEIGHTS
,
108
RF_UNKNOWN
109
};
110
111
118
enum
RF_FileType
GetFileType
(
const
char
*buf);
119
120
int
m_linksNumber
;
121
int
m_nodesNumber
;
122
std::map<std::string, Ptr<Node> >
m_nodeMap
;
123
124
// end class RocketfuelTopologyReader
125
};
126
127
// end namespace ns3
128
};
129
130
131
#endif
/* ROCKETFUEL_TOPOLOGY_READER_H */
132
133
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:39
ns3::RocketfuelTopologyReader
Topology file reader (Rocketfuel-format type).
Definition:
rocketfuel-topology-reader.h:49
ns3::RocketfuelTopologyReader::RF_FileType
RF_FileType
Enum of the possible file types.
Definition:
rocketfuel-topology-reader.h:105
ns3::RocketfuelTopologyReader::RF_MAPS
@ RF_MAPS
Definition:
rocketfuel-topology-reader.h:106
ns3::RocketfuelTopologyReader::RF_UNKNOWN
@ RF_UNKNOWN
Definition:
rocketfuel-topology-reader.h:108
ns3::RocketfuelTopologyReader::RF_WEIGHTS
@ RF_WEIGHTS
Definition:
rocketfuel-topology-reader.h:107
ns3::RocketfuelTopologyReader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
rocketfuel-topology-reader.cc:42
ns3::RocketfuelTopologyReader::GetFileType
enum RF_FileType GetFileType(const char *buf)
Classifies the file type according to its content.
Definition:
rocketfuel-topology-reader.cc:294
ns3::RocketfuelTopologyReader::operator=
RocketfuelTopologyReader & operator=(const RocketfuelTopologyReader &)=delete
ns3::RocketfuelTopologyReader::GenerateFromWeightsFile
NodeContainer GenerateFromWeightsFile(int argc, char *argv[])
Topology read function from a file containing the nodes weights.
Definition:
rocketfuel-topology-reader.cc:231
ns3::RocketfuelTopologyReader::RocketfuelTopologyReader
RocketfuelTopologyReader()
Definition:
rocketfuel-topology-reader.cc:52
ns3::RocketfuelTopologyReader::RocketfuelTopologyReader
RocketfuelTopologyReader(const RocketfuelTopologyReader &)=delete
ns3::RocketfuelTopologyReader::m_nodeMap
std::map< std::string, Ptr< Node > > m_nodeMap
Map of the nodes (name, node).
Definition:
rocketfuel-topology-reader.h:122
ns3::RocketfuelTopologyReader::m_nodesNumber
int m_nodesNumber
Number of nodes.
Definition:
rocketfuel-topology-reader.h:121
ns3::RocketfuelTopologyReader::GenerateFromMapsFile
NodeContainer GenerateFromMapsFile(int argc, char *argv[])
Topology read function from a file containing the nodes map.
Definition:
rocketfuel-topology-reader.cc:116
ns3::RocketfuelTopologyReader::~RocketfuelTopologyReader
virtual ~RocketfuelTopologyReader()
Definition:
rocketfuel-topology-reader.cc:59
ns3::RocketfuelTopologyReader::Read
virtual NodeContainer Read(void)
Main topology reading function.
Definition:
rocketfuel-topology-reader.cc:336
ns3::RocketfuelTopologyReader::m_linksNumber
int m_linksNumber
Number of links.
Definition:
rocketfuel-topology-reader.h:120
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 Tue Feb 6 2024 19:21:27 for ns-3 by
1.9.1