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 * Copyright (c) 2011 Yufei Cheng | 3 * Copyright (c) 2011 Yufei Cheng |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 28 matching lines...) Expand all Loading... |
39 namespace ns3 { | 39 namespace ns3 { |
40 | 40 |
41 NS_LOG_COMPONENT_DEFINE ("DsrMaintainBuffer"); | 41 NS_LOG_COMPONENT_DEFINE ("DsrMaintainBuffer"); |
42 | 42 |
43 namespace dsr { | 43 namespace dsr { |
44 | 44 |
45 uint32_t | 45 uint32_t |
46 DsrMaintainBuffer::GetSize () | 46 DsrMaintainBuffer::GetSize () |
47 { | 47 { |
48 Purge (); | 48 Purge (); |
49 return m_maintainBuffer.size (); | 49 return static_cast<uint32_t> (m_maintainBuffer.size ()); |
50 } | 50 } |
51 | 51 |
52 bool | 52 bool |
53 DsrMaintainBuffer::Enqueue (DsrMaintainBuffEntry & entry) | 53 DsrMaintainBuffer::Enqueue (DsrMaintainBuffEntry & entry) |
54 { | 54 { |
55 Purge (); | 55 Purge (); |
56 for (std::vector<DsrMaintainBuffEntry>::const_iterator i = m_maintainBuffer.be
gin (); i | 56 for (std::vector<DsrMaintainBuffEntry>::const_iterator i = m_maintainBuffer.be
gin (); i |
57 != m_maintainBuffer.end (); ++i) | 57 != m_maintainBuffer.end (); ++i) |
58 { | 58 { |
59 // NS_LOG_INFO ("nexthop " << i->GetNextHop () << " " << entry.GetNextHop (
) << " our add " << i->GetOurAdd () << " " << entry.GetOurAdd () | 59 // NS_LOG_INFO ("nexthop " << i->GetNextHop () << " " << entry.GetNextHop (
) << " our add " << i->GetOurAdd () << " " << entry.GetOurAdd () |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 DsrMaintainBuffer::Purge () | 229 DsrMaintainBuffer::Purge () |
230 { | 230 { |
231 NS_LOG_DEBUG ("Purging Maintenance Buffer"); | 231 NS_LOG_DEBUG ("Purging Maintenance Buffer"); |
232 IsExpired pred; | 232 IsExpired pred; |
233 m_maintainBuffer.erase (std::remove_if (m_maintainBuffer.begin (), m_maintainB
uffer.end (), pred), | 233 m_maintainBuffer.erase (std::remove_if (m_maintainBuffer.begin (), m_maintainB
uffer.end (), pred), |
234 m_maintainBuffer.end ()); | 234 m_maintainBuffer.end ()); |
235 } | 235 } |
236 | 236 |
237 } // namespace dsr | 237 } // namespace dsr |
238 } // namespace ns3 | 238 } // namespace ns3 |
OLD | NEW |