Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2012 University of California, Los Angeles |
| 4 | * |
| 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 |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | */ |
| 20 | |
| 21 | #include "ndn-pit-queue.h" |
| 22 | |
| 23 | #include "ns3/ndn-face.h" |
| 24 | #include "ns3/ndn-pit-entry.h" |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 25 | #include "ns3/log.h" |
Alexander Afanasyev | c23a3e3 | 2012-08-28 00:16:23 -0700 | [diff] [blame^] | 26 | #include "ns3/simulator.h" |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 27 | |
| 28 | #include "ns3/assert.h" |
| 29 | |
| 30 | using namespace std; |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 31 | using namespace boost; |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 32 | |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 33 | NS_LOG_COMPONENT_DEFINE ("ndn.PitQueue"); |
| 34 | |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 35 | namespace ns3 { |
| 36 | namespace ndn { |
| 37 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 38 | const double MIN_WEIGHT = 0.01; |
| 39 | |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 40 | PitQueue::PitQueue () |
Alexander Afanasyev | 372cbab | 2012-08-22 09:43:53 -0700 | [diff] [blame] | 41 | // : m_maxQueueSize (20) |
| 42 | : m_lastQueue (m_queues.end ()) |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 43 | { |
| 44 | } |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 45 | |
Alexander Afanasyev | 372cbab | 2012-08-22 09:43:53 -0700 | [diff] [blame] | 46 | // void |
| 47 | // PitQueue::SetMaxQueueSize (uint32_t size) |
| 48 | // { |
| 49 | // m_maxQueueSize = size; |
| 50 | // } |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 51 | |
Alexander Afanasyev | 372cbab | 2012-08-22 09:43:53 -0700 | [diff] [blame] | 52 | // uint32_t |
| 53 | // PitQueue::GetMaxQueueSize () const |
| 54 | // { |
| 55 | // return m_maxQueueSize; |
| 56 | // } |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 57 | |
| 58 | |
| 59 | bool |
| 60 | PitQueue::Enqueue (Ptr<Face> inFace, |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 61 | Ptr<pit::Entry> pitEntry, |
| 62 | double updatedWeight) |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 63 | { |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 64 | if (updatedWeight < MIN_WEIGHT) updatedWeight = MIN_WEIGHT; |
| 65 | |
Alexander Afanasyev | ed449cc | 2012-08-21 11:10:33 -0700 | [diff] [blame] | 66 | PerInFaceQueue::iterator queue = m_queues.find (inFace); |
| 67 | if (queue == m_queues.end ()) |
| 68 | { |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 69 | pair<PerInFaceQueue::iterator, bool> itemPair = |
| 70 | m_queues.insert (make_pair (inFace, boost::make_shared< WeightedQueue > (make_tuple (Queue (), updatedWeight, 0)))); |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 71 | m_lastQueue = m_queues.end (); // for some reason end() iterator is invalidated when new item is inserted |
Alexander Afanasyev | ed449cc | 2012-08-21 11:10:33 -0700 | [diff] [blame] | 72 | NS_ASSERT (itemPair.second == true); |
| 73 | |
| 74 | queue = itemPair.first; |
| 75 | } |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 76 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 77 | if ((inFace->GetLimits ().GetMaxLimit () == 0 && queue->second->get<0> ().size () > 100) || |
| 78 | (inFace->GetLimits ().GetMaxLimit () != 0 && queue->second->get<0> ().size () >= 0.5 * inFace->GetLimits ().GetMaxLimit ())) |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 79 | { |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 80 | return false; |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 81 | } |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 82 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 83 | Queue::iterator itemIterator = queue->second->get<0> ().insert (queue->second->get<0> ().end (), pitEntry); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 84 | |
| 85 | shared_ptr<fw::PitQueueTag> tag = pitEntry->GetFwTag<fw::PitQueueTag> (); |
| 86 | if (tag == shared_ptr<fw::PitQueueTag> ()) |
| 87 | { |
| 88 | tag = make_shared<fw::PitQueueTag> (); |
| 89 | pitEntry->AddFwTag (tag); |
| 90 | } |
| 91 | tag->InsertQueue (queue->second, itemIterator); |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 92 | |
| 93 | UpdateWeightedRounds (); |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 94 | return true; |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 95 | } |
| 96 | |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 97 | |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 98 | Ptr<pit::Entry> |
| 99 | PitQueue::Pop () |
| 100 | { |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 101 | PerInFaceQueue::iterator queue = m_lastQueue; |
| 102 | |
Alexander Afanasyev | c23a3e3 | 2012-08-28 00:16:23 -0700 | [diff] [blame^] | 103 | if (queue != m_queues.end () && |
| 104 | true) |
| 105 | { |
| 106 | queue ++; // actually implement round robin... |
| 107 | } |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 108 | |
| 109 | while (queue != m_queues.end () && queue->second->get<0> ().size () == 0) // advance iterator |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 110 | { |
| 111 | queue ++; |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 112 | m_serviceCounter = 0; |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | if (queue == m_queues.end ()) |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 116 | { |
| 117 | queue = m_queues.begin (); // circle to the beginning |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 118 | m_serviceCounter = 0; |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 119 | } |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 120 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 121 | while (queue != m_queues.end () && queue->second->get<0> ().size () == 0) // advance iterator |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 122 | { |
| 123 | queue ++; |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 124 | m_serviceCounter = 0; |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | if (queue == m_queues.end ()) // e.g., begin () == end () |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 128 | return 0; |
| 129 | |
Alexander Afanasyev | c23a3e3 | 2012-08-28 00:16:23 -0700 | [diff] [blame^] | 130 | // if (Simulator::GetContext () == 7) |
| 131 | // { |
| 132 | // for (PerInFaceQueue::const_iterator somequeue = m_queues.begin (); |
| 133 | // somequeue != m_queues.end (); |
| 134 | // somequeue ++) |
| 135 | // { |
| 136 | // if (somequeue == queue) cout << "*"; |
| 137 | // cout << somequeue->second->get<0> ().size () << " "; |
| 138 | // } |
| 139 | // cout << endl; |
| 140 | // } |
| 141 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 142 | NS_ASSERT_MSG (queue->second->get<0> ().size () != 0, "Logic error"); |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 143 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 144 | Ptr<pit::Entry> entry = *queue->second->get<0> ().begin (); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 145 | shared_ptr<fw::PitQueueTag> tag = entry->GetFwTag<fw::PitQueueTag> (); |
| 146 | NS_ASSERT (tag != shared_ptr<fw::PitQueueTag> ()); |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 147 | |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 148 | #ifdef NS3_LOG_ENABLE |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 149 | size_t queueSize = queue->second->get<0> ().size (); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 150 | #endif |
| 151 | tag->RemoveFromQueue (queue->second); |
| 152 | #ifdef NS3_LOG_ENABLE |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 153 | NS_ASSERT_MSG (queue->second->get<0> ().size () == queueSize-1, "Queue size should be reduced by one"); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 154 | #endif |
| 155 | |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 156 | m_lastQueue = queue; |
| 157 | return entry; |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | void |
| 161 | PitQueue::Remove (Ptr<Face> face) |
| 162 | { |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 163 | if (m_lastQueue->first == face) |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 164 | { |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 165 | m_lastQueue++; |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 166 | } |
Alexander Afanasyev | ec1e395 | 2012-08-20 13:48:15 -0700 | [diff] [blame] | 167 | |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 168 | PerInFaceQueue::iterator queue = m_queues.find (face); |
| 169 | if (queue == m_queues.end ()) |
| 170 | return; |
| 171 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 172 | for (Queue::iterator pitEntry = queue->second->get<0> ().begin (); |
| 173 | pitEntry != queue->second->get<0> ().end (); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 174 | pitEntry ++) |
| 175 | { |
| 176 | shared_ptr<fw::PitQueueTag> tag = (*pitEntry)->GetFwTag<fw::PitQueueTag> (); |
| 177 | NS_ASSERT (tag != shared_ptr<fw::PitQueueTag> ()); |
| 178 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 179 | tag->RemoveFromQueuesExcept (queue->second); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 180 | } |
| 181 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 182 | NS_ASSERT_MSG (queue->second->get<0> ().size () == 0, "Queue size should be 0 by now"); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 183 | m_queues.erase (queue); |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | void |
| 187 | PitQueue::Remove (Ptr<pit::Entry> entry) |
| 188 | { |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 189 | shared_ptr<fw::PitQueueTag> tag = entry->GetFwTag<fw::PitQueueTag> (); |
| 190 | if (tag == shared_ptr<fw::PitQueueTag> ()) |
| 191 | return; |
| 192 | |
| 193 | tag->RemoveFromAllQueues (); |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 194 | } |
| 195 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 196 | bool |
| 197 | PitQueue::IsEmpty () const |
| 198 | { |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 199 | bool isEmpty = true; |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 200 | |
| 201 | for (PerInFaceQueue::const_iterator queue = m_queues.begin (); |
| 202 | queue != m_queues.end (); |
| 203 | queue ++) |
| 204 | { |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 205 | isEmpty &= (queue->second->get<0> ().size () == 0); |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | return isEmpty; |
| 209 | } |
| 210 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 211 | bool |
| 212 | PitQueue::IsEmpty (Ptr<Face> inFace) const |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 213 | { |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 214 | PerInFaceQueue::const_iterator queue = m_queues.find (inFace); |
| 215 | if (queue == m_queues.end ()) |
| 216 | return true; |
| 217 | |
| 218 | return queue->second->get<0> ().size () == 0; |
| 219 | } |
| 220 | |
| 221 | |
| 222 | void |
| 223 | PitQueue::UpdateWeightedRounds () |
| 224 | { |
| 225 | double minWeight = 100.0; |
| 226 | for (PerInFaceQueue::const_iterator queue = m_queues.begin (); |
| 227 | queue != m_queues.end (); |
| 228 | queue ++) |
| 229 | { |
| 230 | if (queue->second->get<1> () < minWeight) |
| 231 | minWeight = queue->second->get<1> (); |
| 232 | } |
| 233 | |
| 234 | for (PerInFaceQueue::const_iterator queue = m_queues.begin (); |
| 235 | queue != m_queues.end (); |
| 236 | queue ++) |
| 237 | { |
| 238 | queue->second->get<2> () = static_cast<uint32_t>((queue->second->get<1> () + 0.5) / minWeight); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | |
| 243 | //////////////////////////////////////////////////////////////////////////////// |
| 244 | |
| 245 | void |
| 246 | fw::PitQueueTag::InsertQueue (boost::shared_ptr<PitQueue::WeightedQueue> queue, PitQueue::Queue::iterator iterator) |
| 247 | { |
| 248 | // std::cerr << "size before: " << m_items.size () << " item: " << (*iterator)->GetPrefix (); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 249 | pair<MapOfItems::iterator, bool> item = m_items.insert (make_pair (queue, iterator)); |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 250 | // std::cerr << " and after: " << m_items.size () << std::endl; |
| 251 | NS_ASSERT_MSG (item.second == true, "Should be a new tag for PIT entry, but something is wrong"); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | void |
| 255 | fw::PitQueueTag::RemoveFromAllQueues () |
| 256 | { |
| 257 | for (MapOfItems::iterator item = m_items.begin (); |
| 258 | item != m_items.end (); |
| 259 | item ++) |
| 260 | { |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 261 | item->first->get<0> ().erase (item->second); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 262 | } |
| 263 | m_items.clear (); |
| 264 | } |
| 265 | |
| 266 | void |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 267 | fw::PitQueueTag::RemoveFromQueue (boost::shared_ptr<PitQueue::WeightedQueue> queue) |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 268 | { |
| 269 | MapOfItems::iterator item = m_items.find (queue); |
| 270 | if (item == m_items.end ()) |
| 271 | return; |
| 272 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 273 | item->first->get<0> ().erase (item->second); |
Alexander Afanasyev | 38ba9b2 | 2012-08-21 13:32:43 -0700 | [diff] [blame] | 274 | m_items.erase (item); |
| 275 | } |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 276 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 277 | void |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 278 | fw::PitQueueTag::RemoveFromQueuesExcept (boost::shared_ptr<PitQueue::WeightedQueue> queue) |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 279 | { |
| 280 | for (MapOfItems::iterator item = m_items.begin (); |
| 281 | item != m_items.end (); ) |
| 282 | { |
| 283 | if (item->first == queue) |
| 284 | { |
| 285 | item ++; |
| 286 | continue; |
| 287 | } |
| 288 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 289 | item->first->get<0> ().erase (item->second); |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 290 | |
| 291 | MapOfItems::iterator itemToDelete = item; |
| 292 | item ++; |
| 293 | m_items.erase (itemToDelete); |
| 294 | } |
| 295 | } |
| 296 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 297 | bool |
| 298 | fw::PitQueueTag::IsLastOneInQueues () const |
| 299 | { |
| 300 | bool lastOne = true; |
| 301 | |
| 302 | for (MapOfItems::const_iterator item = m_items.begin (); |
| 303 | item != m_items.end (); |
| 304 | item ++) |
| 305 | { |
| 306 | lastOne &= (item->first->get<0> ().size () == 1); |
| 307 | } |
| 308 | |
| 309 | return lastOne; |
| 310 | } |
| 311 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 312 | |
Alexander Afanasyev | 048ae42 | 2012-08-17 17:33:02 -0700 | [diff] [blame] | 313 | } // namespace ndn |
| 314 | } // namespace ns3 |