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
AnnotatedTopologyReader(const std::string &path="", double scale=1.0)
Constructor.
This class reads annotated topology and apply settings to the corresponding nodes and links...
virtual void ApplyOspfMetric()
Apply OSPF metric on Ipv4 (if exists) and Ccnx (if exists) stacks.
virtual void SetMobilityModel(const std::string &model)
Set mobility model to be used on nodes.
virtual void AssignIpv4Addresses(Ipv4Address base)
Assign IPv4 addresses to all links.
virtual void SaveTopology(const std::string &file)
Save positions (e.g., after manual modification using visualizer)
void ApplySettings()
This method applies setting to corresponding nodes and links NetDeviceContainer must be allocated Nod...
Copyright (c) 2011-2015 Regents of the University of California.
virtual void SetBoundingBox(double ulx, double uly, double lrx, double lry)
Set bounding box where nodes will be randomly places (if positions are unspecified) ...
virtual NodeContainer Read()
Main annotated topology reading function.
virtual const std::list< Link > & GetLinks() const
Get links read by the reader.
virtual void SaveGraphviz(const std::string &file)
Save topology in graphviz format (.dot file)
Ptr< Node > CreateNode(const std::string name, uint32_t systemId)
virtual NodeContainer GetNodes() const
Get nodes read by the reader.