39 BOOST_ASSERT(!m_timeoutEvent);
40 m_lastInterestName = interestName;
41 m_timeoutEvent =
getScheduler().schedule(m_rttEstimator.getEstimatedRto(), std::move(cb));
42 return m_rttEstimator.getEstimatedRto();
48 if (m_lastInterestName.isPrefixOf(prefix)) {
49 m_timeoutEvent.cancel();
59 auto it = m_fiMap.find(faceId);
60 return it != m_fiMap.end() ? &it->second :
nullptr;
66 auto ret = m_fiMap.emplace(std::piecewise_construct,
67 std::forward_as_tuple(faceId),
68 std::forward_as_tuple(m_rttEstimatorOpts));
69 auto& faceInfo = ret.first->second;
80 [=] { m_fiMap.erase(faceId); });
89 : m_measurements(measurements)
90 , m_rttEstimatorOpts(make_shared<
ndn::util::RttEstimator::Options>())
118 BOOST_ASSERT(info !=
nullptr);
125 auto* me = m_measurements.
get(fibEntry);
129 for (
size_t prefixLen = fibEntry.
getPrefix().size() + 1;
130 me ==
nullptr && prefixLen <= prefix.size();
132 me = m_measurements.
get(prefix.getPrefix(prefixLen));
136 BOOST_ASSERT(me !=
nullptr);
142 BOOST_ASSERT(info !=
nullptr);
const Name & getPrefix() const
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)
static const time::nanoseconds RTT_TIMEOUT
static const time::nanoseconds RTT_NO_MEASUREMENT
time::nanoseconds scheduleTimeout(const Name &interestName, 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 a Measurements entry.
allows Strategy to access 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
Copyright (c) 2014-2017, Regents of the University of California, Arizona Board of Regents,...
uint64_t FaceId
Identifies a face.
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents,...
Scheduler & getScheduler()
Returns the global Scheduler instance for the calling thread.