NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
rocketfuel-weights-reader.h
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  * Ilya Moiseenko <iliamo@cs.ucla.edu>
20  */
21 
22 #ifndef ROCKETFUEL_TOPOLOGY_WEIGHTS_READER_H
23 #define ROCKETFUEL_TOPOLOGY_WEIGHTS_READER_H
24 
25 #include "annotated-topology-reader.h"
26 #include "ns3/net-device-container.h"
27 
28 namespace ns3 {
29 
30 // ------------------------------------------------------------
31 // --------------------------------------------
40 {
41 public:
42  RocketfuelWeightsReader (const std::string &path="", double scale=1.0);
43  virtual ~RocketfuelWeightsReader ();
44 
45  void
46  SetFileType (uint8_t inputType);
47 
58  virtual NodeContainer
59  Read (void);
60 
61  void
62  Commit ();
63 
64  enum
65  {
66  LINKS,
67  WEIGHTS,
68  LATENCIES,
69  POSITIONS
70  };
71 
72  inline void
73  SetDefaultBandwidth (const std::string &bw);
74 
75  inline std::string
76  GetDefaultBandwidth () const;
77 
78  inline void
79  SetDefaultQueue (const std::string &queue);
80 
81  inline std::string
82  GetDefaultQueue () const;
83 
84 private:
87 
88 private:
89  uint8_t m_inputType;
90  std::string m_defaultBandwidth; // since the topology files don't provide bandwidth parameter
91  std::string m_queue;
92 
93 }; // end class RocketfuelWeightsReader
94 
95 inline void
96 RocketfuelWeightsReader::SetDefaultBandwidth (const std::string &bw)
97 {
98  m_defaultBandwidth = bw;
99 }
100 
101 inline std::string
102 RocketfuelWeightsReader::GetDefaultBandwidth () const
103 {
104  return m_defaultBandwidth;
105 }
106 
107 inline void
108 RocketfuelWeightsReader::SetDefaultQueue (const std::string &queue)
109 {
110  m_queue = queue;
111 }
112 
113 inline std::string
114 RocketfuelWeightsReader::GetDefaultQueue () const
115 {
116  return m_queue;
117 }
118 
119 
120 }; // end namespace ns3
121 
122 
123 #endif /* ROCKETFUEL_TOPOLOGY_WEIGHTS_READER_H */
Topology file reader (extension of Rocketfuel-format type).
virtual NodeContainer Read(void)
Main topology reading function.
This class reads annotated topology and apply settings to the corresponding nodes and links...