View | Details | Raw Unified | Return to bug 1413
Collapse All | Expand All

(-)a/src/topology-read/model/topology-reader.cc (+17 lines)
 Lines 106-117   TopologyReader::Link::Link () Link Here 
106
{
106
{
107
}
107
}
108
108
109
void
110
TopologyReader::Link::SetNetDevices (Ptr<NetDevice> from, Ptr<NetDevice> to)
111
{
112
  m_fromNetDevice = from;
113
  m_toNetDevice = to;
114
}
109
115
110
Ptr<Node> TopologyReader::Link::GetFromNode (void) const
116
Ptr<Node> TopologyReader::Link::GetFromNode (void) const
111
{
117
{
112
  return m_fromPtr;
118
  return m_fromPtr;
113
}
119
}
114
120
121
Ptr<NetDevice> TopologyReader::Link::GetFromNetDevice (void) const
122
{
123
  return m_fromNetDevice;
124
}
125
115
std::string
126
std::string
116
TopologyReader::Link::GetFromNodeName (void) const
127
TopologyReader::Link::GetFromNodeName (void) const
117
{
128
{
 Lines 124-129   TopologyReader::Link::GetToNode (void) const Link Here 
124
  return m_toPtr;
135
  return m_toPtr;
125
}
136
}
126
137
138
Ptr<NetDevice>
139
TopologyReader::Link::GetToNetDevice (void) const
140
{
141
  return m_toNetDevice;
142
}
143
127
std::string
144
std::string
128
TopologyReader::Link::GetToNodeName (void) const
145
TopologyReader::Link::GetToNodeName (void) const
129
{
146
{
(-)a/src/topology-read/model/topology-reader.h (-7 / +29 lines)
 Lines 32-37    Link Here 
32
32
33
namespace ns3 {
33
namespace ns3 {
34
34
35
class NetDevice;
36
35
/**
37
/**
36
 * \ingroup topology
38
 * \ingroup topology
37
 *
39
 *
 Lines 53-59   public: Link Here 
53
   */
55
   */
54
  class Link
56
  class Link
55
  {
57
  {
56
public:
58
  public:
57
  /**
59
  /**
58
   * \brief Constant iterator to scan the map of link attributes.
60
   * \brief Constant iterator to scan the map of link attributes.
59
   */
61
   */
 Lines 66-79   public: Link Here 
66
     * \param toPtr Ptr to the node the link is directed to
68
     * \param toPtr Ptr to the node the link is directed to
67
     * \param toName name of the node the link is directed to
69
     * \param toName name of the node the link is directed to
68
     */
70
     */
69
    Link ( Ptr<Node> fromPtr, const std::string &fromName, Ptr<Node> toPtr, const std::string &toName );
71
    Link (Ptr<Node> fromPtr, const std::string &fromName, Ptr<Node> toPtr, const std::string &toName);
70
72
71
    /**
73
    /**
74
     * \brief Set netdevices associated with the link
75
     * \param from NetDevice associated with From node
76
     * \param to NetDevice associated with To node
77
     */
78
    void
79
    SetNetDevices (Ptr<NetDevice> from, Ptr<NetDevice> to);
80
    
81
    /**
72
     * \brief Returns a Ptr<Node> to the "from" node of the link
82
     * \brief Returns a Ptr<Node> to the "from" node of the link
73
     * \return a Ptr<Node> to the "from" node of the link
83
     * \return a Ptr<Node> to the "from" node of the link
74
     */
84
     */
75
    Ptr<Node> GetFromNode (void) const;
85
    Ptr<Node> GetFromNode (void) const;
76
    /**
86
    /**
87
     * \brief Returns a Ptr<NetDevice> of the "from" node of the link
88
     * \return a Ptr<NetDevice> of the "from" node of the link
89
     */
90
    Ptr<NetDevice> GetFromNetDevice (void) const;
91
    /**
77
     * \brief Returns the name of the "from" node of the link
92
     * \brief Returns the name of the "from" node of the link
78
     * \return the name of the "from" node of the link
93
     * \return the name of the "from" node of the link
79
     */
94
     */
 Lines 84-89   public: Link Here 
84
     */
99
     */
85
    Ptr<Node> GetToNode (void) const;
100
    Ptr<Node> GetToNode (void) const;
86
    /**
101
    /**
102
     * \brief Returns a Ptr<NetDevice> of the "to" node of the link
103
     * \return a Ptr<NetDevice> of the "to" node of the link
104
     */
105
    Ptr<NetDevice> GetToNetDevice (void) const;
106
    /**
87
     * \brief Returns the name of the "to" node of the link
107
     * \brief Returns the name of the "to" node of the link
88
     * \return the name of the "to" node of the link
108
     * \return the name of the "to" node of the link
89
     */
109
     */
 Lines 127-133   private: Link Here 
127
    Ptr< Node > m_fromPtr;
147
    Ptr< Node > m_fromPtr;
128
    std::string m_toName;
148
    std::string m_toName;
129
    Ptr< Node > m_toPtr;
149
    Ptr< Node > m_toPtr;
130
    std::map<std::string, std::string> m_linkAttr;
150
    Ptr< NetDevice > m_fromNetDevice;
151
    Ptr< NetDevice > m_toNetDevice;
152
    std::map<std::string, std::string > m_linkAttr;
131
  };
153
  };
132
154
133
  /**
155
  /**
 Lines 195-207   private: Link Here 
195
   */
217
   */
196
  void AddLink (Link link);
218
  void AddLink (Link link);
197
219
220
protected:
221
  std::string m_fileName;
222
  std::list<Link> m_linksList;
223
198
private:
224
private:
199
  TopologyReader (const TopologyReader&);
225
  TopologyReader (const TopologyReader&);
200
  TopologyReader& operator= (const TopologyReader&);
226
  TopologyReader& operator= (const TopologyReader&);
201
227
202
  std::string m_fileName;
203
  std::list<Link> m_linksList;
204
205
  // end class TopologyReader
228
  // end class TopologyReader
206
};
229
};
207
230
208
- 

Return to bug 1413