NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
annotated-topology-reader.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 // Based on the code by Hajime Tazaki <tazaki@sfc.wide.ad.jp>
21 
22 #ifndef __ANNOTATED_TOPOLOGY_READER_H__
23 #define __ANNOTATED_TOPOLOGY_READER_H__
24 
25 #include "ns3/topology-reader.h"
26 #include "ns3/random-variable-stream.h"
27 #include "ns3/object-factory.h"
28 #include "ns3/node-container.h"
29 
30 namespace ns3 {
31 
37 class AnnotatedTopologyReader : public TopologyReader {
38 public:
47  AnnotatedTopologyReader(const std::string& path = "", double scale = 1.0);
48  virtual ~AnnotatedTopologyReader();
49 
57  virtual NodeContainer
58  Read();
59 
63  virtual NodeContainer
64  GetNodes() const;
65 
69  virtual const std::list<Link>&
70  GetLinks() const;
71 
81  virtual void
82  AssignIpv4Addresses(Ipv4Address base);
83 
91  virtual void
92  SetBoundingBox(double ulx, double uly, double lrx, double lry);
93 
98  virtual void
99  SetMobilityModel(const std::string& model);
100 
104  virtual void
105  ApplyOspfMetric();
106 
110  virtual void
111  SaveTopology(const std::string& file);
112 
116  virtual void
117  SaveGraphviz(const std::string& file);
118 
119 protected:
120  Ptr<Node>
121  CreateNode(const std::string name, uint32_t systemId);
122 
123  Ptr<Node>
124  CreateNode(const std::string name, double posX, double posY, uint32_t systemId);
125 
126 protected:
132  void
133  ApplySettings();
134 
135 protected:
136  std::string m_path;
137  NodeContainer m_nodes;
138 
139 private:
142  operator=(const AnnotatedTopologyReader&);
143 
144  Ptr<UniformRandomVariable> m_randX;
145  Ptr<UniformRandomVariable> m_randY;
146 
147  ObjectFactory m_mobilityFactory;
148  double m_scale;
149 
150  uint32_t m_requiredPartitions;
151 };
152 }
153 
154 #endif
ns3::AnnotatedTopologyReader::Read
virtual NodeContainer Read()
Main annotated topology reading function.
Definition: annotated-topology-reader.cpp:154
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-app-link-service.cpp:32
ns3::AnnotatedTopologyReader::ApplyOspfMetric
virtual void ApplyOspfMetric()
Apply OSPF metric on Ipv4 (if exists) and Ccnx (if exists) stacks.
Definition: annotated-topology-reader.cpp:282
ns3::AnnotatedTopologyReader::GetNodes
virtual NodeContainer GetNodes() const
Get nodes read by the reader.
Definition: annotated-topology-reader.cpp:142
ns3::AnnotatedTopologyReader::AnnotatedTopologyReader
AnnotatedTopologyReader(const std::string &path="", double scale=1.0)
Constructor.
Definition: annotated-topology-reader.cpp:66
ns3::AnnotatedTopologyReader::ApplySettings
void ApplySettings()
This method applies setting to corresponding nodes and links NetDeviceContainer must be allocated Nod...
Definition: annotated-topology-reader.cpp:327
ns3::AnnotatedTopologyReader::GetLinks
virtual const std::list< Link > & GetLinks() const
Get links read by the reader.
Definition: annotated-topology-reader.cpp:148
ns3::AnnotatedTopologyReader::m_nodes
NodeContainer m_nodes
Definition: annotated-topology-reader.hpp:137
ns3::AnnotatedTopologyReader::CreateNode
Ptr< Node > CreateNode(const std::string name, uint32_t systemId)
Definition: annotated-topology-reader.cpp:109
ns3::AnnotatedTopologyReader::SetMobilityModel
virtual void SetMobilityModel(const std::string &model)
Set mobility model to be used on nodes.
Definition: annotated-topology-reader.cpp:97
ns3::AnnotatedTopologyReader::~AnnotatedTopologyReader
virtual ~AnnotatedTopologyReader()
Definition: annotated-topology-reader.cpp:103
ns3::AnnotatedTopologyReader::AssignIpv4Addresses
virtual void AssignIpv4Addresses(Ipv4Address base)
Assign IPv4 addresses to all links.
Definition: annotated-topology-reader.cpp:269
ns3::AnnotatedTopologyReader::SaveTopology
virtual void SaveTopology(const std::string &file)
Save positions (e.g., after manual modification using visualizer)
Definition: annotated-topology-reader.cpp:435
ns3::AnnotatedTopologyReader::SetBoundingBox
virtual void SetBoundingBox(double ulx, double uly, double lrx, double lry)
Set bounding box where nodes will be randomly places (if positions are unspecified)
Definition: annotated-topology-reader.cpp:85
ns3::AnnotatedTopologyReader
This class reads annotated topology and apply settings to the corresponding nodes and links.
Definition: annotated-topology-reader.hpp:37
ns3::AnnotatedTopologyReader::m_path
std::string m_path
Definition: annotated-topology-reader.hpp:136
ndn::name
Definition: name-component-types.hpp:33
ns3::AnnotatedTopologyReader::SaveGraphviz
virtual void SaveGraphviz(const std::string &file)
Save topology in graphviz format (.dot file)
Definition: annotated-topology-reader.cpp:538