Project

General

Profile

Feature #4316

Scoped expressed Interest

Added by Junxiao Shi about 2 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

Provide a type to hold a PendingInterestId. When exiting the scope containing an instance of that type, the pending Interest is cancelled.


Related issues

Related to ndn-cxx - Feature #4698: Improve ScopedEventIdClosed

Actions
Related to ndn-cxx - Feature #3919: Scoped prefix registrationClosed

Actions
Precedes ndn-cxx - Task #4885: Remove deprecated const Id* of face-related handlesNew08/29/2019

Actions

History

#1

Updated by Junxiao Shi over 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi
  • Target version set to v0.7
#2

Updated by Junxiao Shi over 1 year ago

From https://gerrit.named-data.net/c/ndn-cxx/+/4876/1/src/face-scoped-id.hpp#31

Ideally we should change the return type of registerPrefix and friends to return a (non-scoped) handle directly rather than a weird pointer type. The non-scoped handle type can be implicitly assigned to the scoped handle type. That would substantially improve usability for new API consumers because they don't have to separately construct the scoped handle passing a Face object, which is ugly. Backward compat for the new return type can be achieved by adding a conversion operator from the handle type to the current pointer type.

I agree and this applies to scheduler::ScopedEventId as well.

#3

Updated by Davide Pesavento over 1 year ago

#4

Updated by Junxiao Shi over 1 year ago

  • % Done changed from 0 to 10

Change 4876 patchset 2 attempts note-2 design, but it seems that the implicit conversion operator is ineffective:

../src/mgmt/dispatcher.cpp: In member function ‘void ndn::mgmt::Dispatcher::addTopPrefix(const ndn::Name&, bool, const ndn::security::SigningInfo&)’:
../src/mgmt/dispatcher.cpp:82:39: error: no match for ‘operator=’ (operand types are ‘nonstd::optional_lite::optional<const ndn::RegisteredPrefixId*>’ and ‘ndn::RegisteredPrefixHandle’)
#5

Updated by Davide Pesavento over 1 year ago

Junxiao Shi wrote:

Change 4876 patchset 2 attempts note-2 design, but it seems that the implicit conversion operator is ineffective:

Well, it's failing because the LHS is an optional type... Dispatcher::TopPrefixEntry is using optional<const RegisteredPrefixId*>, which is not something I was expecting since it doesn't make much sense (pointers are intrinsically nullable). I would get rid of the optional and not worry too much about these cases.

#6

Updated by Junxiao Shi 11 months ago

  • % Done changed from 10 to 50

https://gerrit.named-data.net/5163 implements the same design as scoped Interest filter.

After this is merged, I plan to do another round of refactoring to deprecate conversions of XHandle to const XId*.

#7

Updated by Junxiao Shi 11 months ago

  • % Done changed from 50 to 80

https://gerrit.named-data.net/5198 deprecates Id types in favor of Handle types.
NFD and PSync aren't affected.
https://gerrit.named-data.net/5199 updates ndn-tools.
https://gerrit.named-data.net/5200 updates repo-ng.
I will check ChronoSync, NLSR, and NAC later.

#9

Updated by Junxiao Shi 9 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100
#10

Updated by Davide Pesavento 7 months ago

  • Precedes Task #4885: Remove deprecated const Id* of face-related handles added
#11

Updated by Davide Pesavento 7 months ago

Also available in: Atom PDF