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 (c) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ByteTagList::Iterator::HasNext (void) const | 82 ByteTagList::Iterator::HasNext (void) const |
83 { | 83 { |
84 NS_LOG_FUNCTION (this); | 84 NS_LOG_FUNCTION (this); |
85 return m_current < m_end; | 85 return m_current < m_end; |
86 } | 86 } |
87 struct ByteTagList::Iterator::Item | 87 struct ByteTagList::Iterator::Item |
88 ByteTagList::Iterator::Next (void) | 88 ByteTagList::Iterator::Next (void) |
89 { | 89 { |
90 NS_ASSERT (HasNext ()); | 90 NS_ASSERT (HasNext ()); |
91 struct Item item = Item (TagBuffer (m_current+16, m_end)); | 91 struct Item item = Item (TagBuffer (m_current+16, m_end)); |
92 item.tid.SetUid (static_cast<uint16_t>(m_nextTid)); | 92 item.tid.SetUid (static_cast<uint16_t> (m_nextTid)); |
93 item.size = m_nextSize; | 93 item.size = m_nextSize; |
94 item.start = std::max (m_nextStart, m_offsetStart); | 94 item.start = std::max (m_nextStart, m_offsetStart); |
95 item.end = std::min (m_nextEnd, m_offsetEnd); | 95 item.end = std::min (m_nextEnd, m_offsetEnd); |
96 m_current += 4 + 4 + 4 + 4 + item.size; | 96 m_current += 4 + 4 + 4 + 4 + item.size; |
97 item.buf.TrimAtEnd (static_cast<uint32_t>(m_end - m_current)); | 97 item.buf.TrimAtEnd (static_cast<uint32_t> (m_end - m_current)); |
98 PrepareForNext (); | 98 PrepareForNext (); |
99 return item; | 99 return item; |
100 } | 100 } |
101 void | 101 void |
102 ByteTagList::Iterator::PrepareForNext (void) | 102 ByteTagList::Iterator::PrepareForNext (void) |
103 { | 103 { |
104 NS_LOG_FUNCTION (this); | 104 NS_LOG_FUNCTION (this); |
105 while (m_current < m_end) | 105 while (m_current < m_end) |
106 { | 106 { |
107 TagBuffer buf = TagBuffer (m_current, m_end); | 107 TagBuffer buf = TagBuffer (m_current, m_end); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 { | 419 { |
420 uint8_t *buffer = (uint8_t *)data; | 420 uint8_t *buffer = (uint8_t *)data; |
421 delete [] buffer; | 421 delete [] buffer; |
422 } | 422 } |
423 } | 423 } |
424 | 424 |
425 #endif /* USE_FREE_LIST */ | 425 #endif /* USE_FREE_LIST */ |
426 | 426 |
427 | 427 |
428 } // namespace ns3 | 428 } // namespace ns3 |
LEFT | RIGHT |