LEFT | RIGHT |
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 * Copyright 2007 University of Washington | 3 * Copyright 2007 University of Washington |
4 * Copyright (C) 1999, 2000 Kunihiro Ishiguro, Toshiaki Takada | 4 * Copyright (C) 1999, 2000 Kunihiro Ishiguro, Toshiaki Takada |
5 *· | 5 *· |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 // find this node from all its parents and remove the entry of this node | 133 // find this node from all its parents and remove the entry of this node |
134 // from all its parents | 134 // from all its parents |
135 for (ListOfSPFVertex_t::iterator piter = m_parents.begin ();· | 135 for (ListOfSPFVertex_t::iterator piter = m_parents.begin ();· |
136 piter != m_parents.end (); | 136 piter != m_parents.end (); |
137 piter++) | 137 piter++) |
138 { | 138 { |
139 // remove the current vertex from its parent's children list. Check | 139 // remove the current vertex from its parent's children list. Check |
140 // if the size of the list is reduced, or the child<->parent relation | 140 // if the size of the list is reduced, or the child<->parent relation |
141 // is not bidirectional | 141 // is not bidirectional |
142 uint32_t orgCount = (*piter)->m_children.size (); | 142 uint32_t orgCount = static_cast<uint32_t> ((*piter)->m_children.size ()); |
143 (*piter)->m_children.remove (this); | 143 (*piter)->m_children.remove (this); |
144 uint32_t newCount = (*piter)->m_children.size (); | 144 uint32_t newCount = static_cast<uint32_t> ((*piter)->m_children.size ()); |
145 if (orgCount > newCount) | 145 if (orgCount > newCount) |
146 { | 146 { |
147 NS_ASSERT_MSG (orgCount > newCount, "Unable to find the current vertex
from its parents --- impossible!"); | 147 NS_ASSERT_MSG (orgCount > newCount, "Unable to find the current vertex
from its parents --- impossible!"); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 // delete children | 151 // delete children |
152 while (m_children.size () > 0) | 152 while (m_children.size () > 0) |
153 { | 153 { |
154 // pop out children one by one. Some children may disapper· | 154 // pop out children one by one. Some children may disapper· |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } | 345 } |
346 m_ecmpRootExits.clear (); | 346 m_ecmpRootExits.clear (); |
347 m_ecmpRootExits.insert (m_ecmpRootExits.end (),· | 347 m_ecmpRootExits.insert (m_ecmpRootExits.end (),· |
348 vertex->m_ecmpRootExits.begin (), vertex->m_ecmpRootEx
its.end ()); | 348 vertex->m_ecmpRootExits.begin (), vertex->m_ecmpRootEx
its.end ()); |
349 } | 349 } |
350 | 350 |
351 uint32_t· | 351 uint32_t· |
352 SPFVertex::GetNRootExitDirections () const | 352 SPFVertex::GetNRootExitDirections () const |
353 { | 353 { |
354 NS_LOG_FUNCTION (this); | 354 NS_LOG_FUNCTION (this); |
355 return m_ecmpRootExits.size (); | 355 return static_cast<uint32_t> (m_ecmpRootExits.size ()); |
356 } | 356 } |
357 | 357 |
358 uint32_t· | 358 uint32_t· |
359 SPFVertex::GetNChildren (void) const | 359 SPFVertex::GetNChildren (void) const |
360 { | 360 { |
361 NS_LOG_FUNCTION (this); | 361 NS_LOG_FUNCTION (this); |
362 return m_children.size (); | 362 return static_cast<uint32_t> (m_children.size ()); |
363 } | 363 } |
364 | 364 |
365 SPFVertex* | 365 SPFVertex* |
366 SPFVertex::GetChild (uint32_t n) const | 366 SPFVertex::GetChild (uint32_t n) const |
367 { | 367 { |
368 NS_LOG_FUNCTION (this << n); | 368 NS_LOG_FUNCTION (this << n); |
369 uint32_t j = 0; | 369 uint32_t j = 0; |
370 | 370 |
371 for ( ListOfSPFVertex_t::const_iterator i = m_children.begin (); | 371 for ( ListOfSPFVertex_t::const_iterator i = m_children.begin (); |
372 i != m_children.end (); | 372 i != m_children.end (); |
373 i++, j++) | 373 i++, j++) |
374 { | 374 { |
375 if (j == n) | 375 if (j == n) |
376 { | 376 { |
377 return *i; | 377 return *i; |
378 } | 378 } |
379 } | 379 } |
380 NS_ASSERT_MSG (false, "Index <n> out of range."); | 380 NS_ASSERT_MSG (false, "Index <n> out of range."); |
381 return 0; | 381 return 0; |
382 } | 382 } |
383 | 383 |
384 uint32_t | 384 uint32_t |
385 SPFVertex::AddChild (SPFVertex* child) | 385 SPFVertex::AddChild (SPFVertex* child) |
386 { | 386 { |
387 NS_LOG_FUNCTION (this << child); | 387 NS_LOG_FUNCTION (this << child); |
388 m_children.push_back (child); | 388 m_children.push_back (child); |
389 return m_children.size (); | 389 return static_cast<uint32_t> (m_children.size ()); |
390 } | 390 } |
391 | 391 |
392 void· | 392 void· |
393 SPFVertex::SetVertexProcessed (bool value) | 393 SPFVertex::SetVertexProcessed (bool value) |
394 { | 394 { |
395 NS_LOG_FUNCTION (this << value); | 395 NS_LOG_FUNCTION (this << value); |
396 m_vertexProcessed = value; | 396 m_vertexProcessed = value; |
397 } | 397 } |
398 | 398 |
399 bool· | 399 bool· |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 GlobalRouteManagerLSDB::GetExtLSA (uint32_t index) const | 478 GlobalRouteManagerLSDB::GetExtLSA (uint32_t index) const |
479 { | 479 { |
480 NS_LOG_FUNCTION (this << index); | 480 NS_LOG_FUNCTION (this << index); |
481 return m_extdatabase.at (index); | 481 return m_extdatabase.at (index); |
482 } | 482 } |
483 | 483 |
484 uint32_t | 484 uint32_t |
485 GlobalRouteManagerLSDB::GetNumExtLSAs () const | 485 GlobalRouteManagerLSDB::GetNumExtLSAs () const |
486 { | 486 { |
487 NS_LOG_FUNCTION (this); | 487 NS_LOG_FUNCTION (this); |
488 return m_extdatabase.size (); | 488 return static_cast<uint32_t> (m_extdatabase.size ()); |
489 } | 489 } |
490 | 490 |
491 GlobalRoutingLSA* | 491 GlobalRoutingLSA* |
492 GlobalRouteManagerLSDB::GetLSA (Ipv4Address addr) const | 492 GlobalRouteManagerLSDB::GetLSA (Ipv4Address addr) const |
493 { | 493 { |
494 NS_LOG_FUNCTION (this << addr); | 494 NS_LOG_FUNCTION (this << addr); |
495 // | 495 // |
496 // Look up an LSA by its address. | 496 // Look up an LSA by its address. |
497 // | 497 // |
498 LSDBMap_t::const_iterator i; | 498 LSDBMap_t::const_iterator i; |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 SPFVertex* parent; | 2199 SPFVertex* parent; |
2200 // check if all parents of vertex v | 2200 // check if all parents of vertex v |
2201 if ((parent = v->GetParent (i++)) == 0) break; | 2201 if ((parent = v->GetParent (i++)) == 0) break; |
2202 parent->AddChild (v); | 2202 parent->AddChild (v); |
2203 } | 2203 } |
2204 } | 2204 } |
2205 | 2205 |
2206 } // namespace ns3 | 2206 } // namespace ns3 |
2207 | 2207 |
2208 | 2208 |
LEFT | RIGHT |