34 BOOST_ASSERT(!m_timeoutEvent);
35 m_lastInterestName = interestName;
36 m_timeoutEvent =
getScheduler().schedule(m_rttEstimator.getEstimatedRto(), std::move(cb));
37 return m_rttEstimator.getEstimatedRto();
43 if (m_lastInterestName.isPrefixOf(prefix)) {
44 m_timeoutEvent.cancel();
54 auto it = m_fiMap.find(faceId);
55 return it != m_fiMap.end() ? &it->second :
nullptr;
61 auto [it, isNew] = m_fiMap.try_emplace(faceId, m_rttEstimatorOpts);
62 auto& faceInfo = it->second;
73 [=] { m_fiMap.erase(faceId); });
80 : m_measurements(measurements)
81 , m_rttEstimatorOpts(make_shared<
ndn::util::RttEstimator::Options>())
109 BOOST_ASSERT(info !=
nullptr);
116 auto* me = m_measurements.
get(fibEntry);
120 for (
size_t prefixLen = fibEntry.
getPrefix().size() + 1;
121 me ==
nullptr && prefixLen <= prefix.size();
123 me = m_measurements.
get(prefix.getPrefix(prefixLen));
127 BOOST_ASSERT(me !=
nullptr);
133 BOOST_ASSERT(info !=
nullptr);
Represents an entry in the FIB.
const Name & getPrefix() const noexcept
NamespaceInfo & getOrCreateNamespaceInfo(const fib::Entry &fibEntry, const Name &prefix)
AsfMeasurements(MeasurementsAccessor &measurements)
static constexpr time::microseconds MEASUREMENTS_LIFETIME
FaceInfo & getOrCreateFaceInfo(const fib::Entry &fibEntry, const Name &interestName, FaceId faceId)
FaceInfo * getFaceInfo(const fib::Entry &fibEntry, const Name &interestName, FaceId faceId)
NamespaceInfo * getNamespaceInfo(const Name &prefix)
Strategy information for each face in a namespace.
void cancelTimeout(const Name &prefix)
time::nanoseconds scheduleTimeout(const Name &interestName, ndn::scheduler::EventCallback cb)
Stores strategy information about each face in this namespace.
FaceInfo * getFaceInfo(FaceId faceId)
void extendFaceInfoLifetime(FaceInfo &info, FaceId faceId)
FaceInfo & getOrCreateFaceInfo(FaceId faceId)
Represents an entry in the Measurements table.
Allows fw::Strategy to access the portion of Measurements table under its namespace.
void extendLifetime(Entry &entry, const time::nanoseconds &lifetime)
Extend lifetime of an entry.
Entry * findLongestPrefixMatch(const Name &name, const EntryPredicate &pred=AnyEntry()) const
Perform a longest prefix match for name.
Entry * get(const Name &name)
Find or insert a Measurements entry for name.
uint64_t FaceId
Identifies a face.
ndn::Scheduler & getScheduler()
Returns the global Scheduler instance for the calling thread.