Feature #2314
closed
Measurements::findLongestPrefixMatch(pit::Entry) and MeasurementsAccessor::findLongestPrefixMatch
Added by Junxiao Shi almost 10 years ago.
Updated almost 10 years ago.
Description
Implement:
Measurements::findLongestPrefixMatch(const pit::Entry&)
MeasurementsAccessor::findLongestPrefixMatch(const Name&)
MeasurementsAccessor::findLongestPrefixMatch(const pit::Entry&)
so that Strategy can perform longest prefix match lookup on Measurements table efficiently.
- Subject changed from Measurements::findLongestPrefixMatch(pit::Entr) and MeasurementsAccessor::findLongestPrefixMatch to Measurements::findLongestPrefixMatch(pit::Entry) and MeasurementsAccessor::findLongestPrefixMatch
- Estimated time changed from 2.00 h to 1.50 h
One related question: sometimes strategy needs to find a longest prefix match that satisfy certain condition, such as the existence of a certain type of StrategyInfo
.
Which design is better?
- add a
predicate
parameter to findLongestPrefixMatch
functions
- add
findLongestPrefixMatch(const measurements::Entry&)
overload; if the strategy thinks the initial match doesn't satisfy the requirement, it could call this overload to find a longest prefix match of the parent of passed Entry
The first design is cleaner, but it's hard to pass information from the predicate to the caller.
For example, if the predicate calls getStrategyInfo<T>
, the caller (who calls findLongestPrefixMatch
) will have to call getStrategyInfo<T>
again.
20150107 conference call decides to use the first design in note-2. Alex hopes the common expression will be optimized by compiler.
- Status changed from New to In Progress
- % Done changed from 0 to 50
http://gerrit.named-data.net/1600 accepts predicate in Measurements::findLongestPrefixMatch
.
The next commit will expose findLongestPrefixMatch
operation to MeasurementsAccessor
.
- % Done changed from 50 to 70
http://gerrit.named-data.net/1606 adds findLongestPrefixMatch
and findExactMatch
to MeasurementsAccessor
.
However, I realize that I forgot to add Measurements::findLongestPrefixMatch(pit::Entry)
, which shall come before this Change.
- % Done changed from 70 to 90
- Status changed from In Progress to Code review
- % Done changed from 90 to 100
- Status changed from Code review to Closed
Also available in: Atom
PDF