|
32 |
|
32 |
|
33 |
namespace ns3 { |
33 |
namespace ns3 { |
34 |
|
34 |
|
|
|
35 |
class NetDevice; |
36 |
|
35 |
/** |
37 |
/** |
36 |
* \ingroup topology |
38 |
* \ingroup topology |
37 |
* |
39 |
* |
|
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 |
*/ |
|
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 |
*/ |
|
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 |
*/ |
|
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 |
/** |
|
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 |
- |
|
|