OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
11 * | 11 * |
12 * You should have received a copy of the GNU General Public License | 12 * You should have received a copy of the GNU General Public License |
13 * along with this program; if not, write to the Free Software | 13 * along with this program; if not, write to the Free Software |
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 *· | 15 *· |
16 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 16 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
17 */ | 17 */ |
18 · | 18 · |
19 #include "attribute-iterator.h" | 19 #include "attribute-iterator.h" |
20 #include "ns3/config.h" | 20 #include "ns3/config.h" |
21 #include "ns3/log.h" | 21 #include "ns3/log.h" |
22 #include "ns3/pointer.h" | 22 #include "ns3/pointer.h" |
23 #include "ns3/object-ptr-container.h" | 23 #include "ns3/object-ptr-container.h" |
24 #include "ns3/string.h" | 24 #include "ns3/string.h" |
| 25 #include "ns3/unused.h" |
25 #include <fstream> | 26 #include <fstream> |
26 | 27 |
27 | 28 |
28 namespace ns3 { | 29 namespace ns3 { |
29 | 30 |
30 NS_LOG_COMPONENT_DEFINE ("AttributeIterator"); | 31 NS_LOG_COMPONENT_DEFINE ("AttributeIterator"); |
31 | 32 |
32 AttributeIterator::AttributeIterator () | 33 AttributeIterator::AttributeIterator () |
33 { | 34 { |
34 } | 35 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 AttributeIterator::DoStartVisitPointerAttribute (Ptr<Object> object, std::string
name, Ptr<Object> item) | 104 AttributeIterator::DoStartVisitPointerAttribute (Ptr<Object> object, std::string
name, Ptr<Object> item) |
104 { | 105 { |
105 } | 106 } |
106 void· | 107 void· |
107 AttributeIterator::DoEndVisitPointerAttribute (void) | 108 AttributeIterator::DoEndVisitPointerAttribute (void) |
108 { | 109 { |
109 } | 110 } |
110 void· | 111 void· |
111 AttributeIterator::DoStartVisitArrayAttribute (Ptr<Object> object, std::string n
ame, const ObjectPtrContainerValue &vector) | 112 AttributeIterator::DoStartVisitArrayAttribute (Ptr<Object> object, std::string n
ame, const ObjectPtrContainerValue &vector) |
112 { | 113 { |
| 114 NS_UNUSED (vector); |
113 } | 115 } |
114 void· | 116 void· |
115 AttributeIterator::DoEndVisitArrayAttribute (void) | 117 AttributeIterator::DoEndVisitArrayAttribute (void) |
116 { | 118 { |
117 } | 119 } |
118 void· | 120 void· |
119 AttributeIterator::DoStartVisitArrayItem (const ObjectPtrContainerValue &vector,
uint32_t index, Ptr<Object> item) | 121 AttributeIterator::DoStartVisitArrayItem (const ObjectPtrContainerValue &vector,
uint32_t index, Ptr<Object> item) |
120 { | 122 { |
| 123 NS_UNUSED (vector); |
| 124 NS_UNUSED (index); |
121 } | 125 } |
122 void· | 126 void· |
123 AttributeIterator::DoEndVisitArrayItem (void) | 127 AttributeIterator::DoEndVisitArrayItem (void) |
124 { | 128 { |
125 } | 129 } |
126 | 130 |
127 void· | 131 void· |
128 AttributeIterator::VisitAttribute (Ptr<Object> object, std::string name) | 132 AttributeIterator::VisitAttribute (Ptr<Object> object, std::string name) |
129 { | 133 { |
130 m_currentPath.push_back (name); | 134 m_currentPath.push_back (name); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const Ob
jectPtrContainerChecker *> (PeekPointer (info.checker)); | 229 const ObjectPtrContainerChecker *vectorChecker = dynamic_cast<const Ob
jectPtrContainerChecker *> (PeekPointer (info.checker)); |
226 if (vectorChecker != 0) | 230 if (vectorChecker != 0) |
227 { | 231 { |
228 NS_LOG_DEBUG ("ObjectPtrContainer attribute " << info.name); | 232 NS_LOG_DEBUG ("ObjectPtrContainer attribute " << info.name); |
229 ObjectPtrContainerValue vector; | 233 ObjectPtrContainerValue vector; |
230 object->GetAttribute (info.name, vector); | 234 object->GetAttribute (info.name, vector); |
231 StartVisitArrayAttribute (object, info.name, vector); | 235 StartVisitArrayAttribute (object, info.name, vector); |
232 ObjectPtrContainerValue::Iterator it; | 236 ObjectPtrContainerValue::Iterator it; |
233 for (it = vector.Begin (); it != vector.End (); ++it) | 237 for (it = vector.Begin (); it != vector.End (); ++it) |
234 { | 238 { |
235 uint32_t j = (*it).first; | 239 uint32_t j = static_cast<uint32_t> ((*it).first); |
236 NS_LOG_DEBUG ("ObjectPtrContainer attribute item " << j); | 240 NS_LOG_DEBUG ("ObjectPtrContainer attribute item " << j); |
237 Ptr<Object> tmp = (*it).second; | 241 Ptr<Object> tmp = (*it).second; |
238 if (tmp) | 242 if (tmp) |
239 { | 243 { |
240 StartVisitArrayItem (vector, j, tmp); | 244 StartVisitArrayItem (vector, j, tmp); |
241 m_examined.push_back (object); | 245 m_examined.push_back (object); |
242 DoIterate (tmp); | 246 DoIterate (tmp); |
243 m_examined.pop_back (); | 247 m_examined.pop_back (); |
244 EndVisitArrayItem (); | 248 EndVisitArrayItem (); |
245 } | 249 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 m_examined.push_back (object); | 282 m_examined.push_back (object); |
279 DoIterate (tmp); | 283 DoIterate (tmp); |
280 m_examined.pop_back (); | 284 m_examined.pop_back (); |
281 EndVisitObject (); | 285 EndVisitObject (); |
282 } | 286 } |
283 } | 287 } |
284 } | 288 } |
285 | 289 |
286 | 290 |
287 } // namespace ns3 | 291 } // namespace ns3 |
OLD | NEW |