Project

General

Profile

Feature #2295

Scheduler: ScopedEventId

Added by Junxiao Shi almost 5 years ago. Updated over 4 years ago.

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

100%

Estimated time:
2.00 h

Description

Develop a ScopedEventId type which stores an EventId and cancels it upon destruction.

  • ScopedEventId is default constructible; it doesn't contain an EventId when default constructed
  • ScopedEventId is implicitly constructible from EventId
  • ScopedEventId is assignable from EventId
  • when ScopedEventId is destructed, the EventId it holds is cancelled
  • when a different EventId is assigned to ScopedEventId, the EventId it previously holds is cancelled
  • ScopedEventId is noncopyable
  • ScopedEventId is moveable

Related issues

Blocks NFD - Feature #1999: Strategy for access routerClosed

History

#1 Updated by Junxiao Shi almost 5 years ago

#2 Updated by Junxiao Shi almost 5 years ago

  • Description updated (diff)

#3 Updated by Davide Pesavento almost 5 years ago

Sounds good to me.

#4 Updated by Junxiao Shi almost 5 years ago

  • Status changed from New to In Progress

#5 Updated by Junxiao Shi almost 5 years ago

  • Project changed from ndn-cxx to NFD
  • Category changed from Utils to Core
  • Target version changed from v0.3 to v0.3

I quickly realize that this Feature is unfeasible in ndn-cxx, because EventId does not reference Scheduler, and Scheduler is not global.

Therefore, I'll implement this in NFD, given that it's only used in NFD strategy.

#6 Updated by Junxiao Shi almost 5 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100

#7 Updated by Alex Afanasyev almost 5 years ago

I could be ok with embedding reference to scheduler within ndn-cxx and then adding ScopedEventId. I'm thinking about just reference, without any guarantee for scheduler lifetime (i.e., if scheduler is destroyed before EventId, this should cause segfault).

#8 Updated by Junxiao Shi almost 5 years ago

I could be ok with embedding reference to scheduler within ndn-cxx and then adding ScopedEventId. I'm thinking about just reference, without any guarantee for scheduler lifetime (i.e., if scheduler is destroyed before EventId, this should cause segfault).

I don't want to do that now because it's not needed.

It could be a separate Feature, after which nfd::scheduler::ScopedEventId could import from.

#9 Updated by Junxiao Shi over 4 years ago

  • Status changed from Code review to Closed

Also available in: Atom PDF