blob: 2b73c115f97bdac204db28f442db9e6fb193cf61 [file] [log] [blame]
Ilya Moiseenko58d26672011-12-08 13:48:06 -08001/* -*- 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 * Ilya Moiseenko <iliamo@cs.ucla.edu>
20 */
21
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080022#ifndef ROCKETFUEL_TOPOLOGY_WEIGHTS_READER_H
23#define ROCKETFUEL_TOPOLOGY_WEIGHTS_READER_H
Ilya Moiseenko58d26672011-12-08 13:48:06 -080024
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080025#include "annotated-topology-reader.h"
Alexander Afanasyev07827182011-12-13 01:07:32 -080026#include "ns3/net-device-container.h"
Ilya Moiseenko58d26672011-12-08 13:48:06 -080027
28namespace ns3 {
29
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080030// ------------------------------------------------------------
31// --------------------------------------------
32/**
33 * \brief Topology file reader (extension of Rocketfuel-format type).
34 *
35 * http://www.cs.washington.edu/research/networking/rocketfuel/
36 *
37 * Only weights and latencies file is supported
38 */
39class RocketfuelWeightsReader : public AnnotatedTopologyReader
40{
41public:
42 RocketfuelWeightsReader ();
43 virtual ~RocketfuelWeightsReader ();
44
45 void
46 SetFileType (uint8_t inputType);
47
48 /**
49 * \brief Main topology reading function.
50 *
51 * This method opens an input stream and reads the Rocketfuel-format file.
52 * Every row represents a topology link (the ids of a couple of nodes),
53 * so the input file is read line by line to figure out how many links
54 * and nodes are in the topology.
55 *
56 * \return the container of the nodes created (or empty container if there was an error)
57 */
58 virtual NodeContainer Read (void);
59
60 enum
Ilya Moiseenko58d26672011-12-08 13:48:06 -080061 {
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080062 WEIGHTS,
63 LATENCIES
Ilya Moiseenko58d26672011-12-08 13:48:06 -080064 };
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080065
66private:
67 RocketfuelWeightsReader (const RocketfuelWeightsReader&);
68 RocketfuelWeightsReader& operator= (const RocketfuelWeightsReader&);
69
70private:
71 uint8_t m_inputType;
72
73}; // end class RocketfuelWeightsReader
74
75}; // end namespace ns3
Ilya Moiseenko58d26672011-12-08 13:48:06 -080076
77
Alexander Afanasyevae3b7c32011-12-13 13:20:06 -080078#endif /* ROCKETFUEL_TOPOLOGY_WEIGHTS_READER_H */