NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
retx-suppression.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #include "retx-suppression.hpp"
27 
28 namespace nfd {
29 namespace fw {
30 
33 {
34  const pit::OutRecordCollection& outRecords = pitEntry.getOutRecords();
35  pit::OutRecordCollection::const_iterator lastOutgoing = std::max_element(
36  outRecords.begin(), outRecords.end(),
37  [] (const pit::OutRecord& a, const pit::OutRecord& b) {
38  return a.getLastRenewed() < b.getLastRenewed();
39  });
40  BOOST_ASSERT(lastOutgoing != outRecords.end()); // otherwise it's new PIT entry
41 
42  return lastOutgoing->getLastRenewed();
43 }
44 
45 } // namespace fw
46 } // namespace nfd
time_point TimePoint
Definition: time.hpp:108
time::steady_clock::TimePoint getLastOutgoing(const pit::Entry &pitEntry) const
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
represents a PIT entry
Definition: pit-entry.hpp:69
const OutRecordCollection & getOutRecords() const
Definition: pit-entry.hpp:204
std::list< OutRecord > OutRecordCollection
represents an unordered collection of OutRecords
Definition: pit-entry.hpp:51
contains information about an Interest toward an outgoing face
time::steady_clock::TimePoint getLastRenewed() const