A Discrete-Event Network Simulator
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 // --------------------------------------------
48 {
49  public:
54  static TypeId GetTypeId();
55 
57  ~RocketfuelTopologyReader() override;
58 
59  // Delete copy constructor and assignment operator to avoid misuse
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 
102  {
105  RF_UNKNOWN
106  };
107 
114  RF_FileType GetFileType(const std::string& buf);
115 
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 */
keep track of a set of node pointers.
Topology file reader (Rocketfuel-format type).
RF_FileType
Enum of the possible file types.
RocketfuelTopologyReader & operator=(const RocketfuelTopologyReader &)=delete
RocketfuelTopologyReader(const RocketfuelTopologyReader &)=delete
NodeContainer GenerateFromWeightsFile(const std::vector< std::string > &argv)
Topology read function from a file containing the nodes weights.
std::map< std::string, Ptr< Node > > m_nodeMap
Map of the nodes (name, node).
static TypeId GetTypeId()
Get the type ID.
RF_FileType GetFileType(const std::string &buf)
Classifies the file type according to its content.
NodeContainer GenerateFromMapsFile(const std::vector< std::string > &argv)
Topology read function from a file containing the nodes map.
NodeContainer Read() override
Main topology reading function.
Interface for input file readers management.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TopologyReader declaration.