Project

General

Profile

Actions

Task #2340

closed

Allow iteration of CS content

Added by Alex Afanasyev almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Tables
Target version:
Start date:
01/03/2015
Due date:
% Done:

100%

Estimated time:

Description

CS should allow iteration over its entries.

Actions #1

Updated by Alex Afanasyev almost 10 years ago

  • Related to Task #2339: Allow iteration over PIT entries added
Actions #2

Updated by Alex Afanasyev almost 10 years ago

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

Updated by Junxiao Shi almost 10 years ago

  • Description updated (diff)

cs::Entry is internal to a specific ContentStore implementation.

It cannot be exposed via an iterator, because this would prevent any alternate ContentStore implementation from being adopted without breaking external code.

The iterator can only be dereferenced to ndn::Data.

Actions #4

Updated by Junxiao Shi almost 10 years ago

  • Related to deleted (Task #2339: Allow iteration over PIT entries)
Actions #5

Updated by Alex Afanasyev almost 10 years ago

Junxiao Shi wrote:

cs::Entry is internal to a specific ContentStore implementation.

It cannot be exposed via an iterator, because this would prevent any alternate ContentStore implementation from being adopted without breaking external code.

The iterator can only be dereferenced to ndn::Data.

I'm not sure about this. Returning just data is inconsistent with other tables and is not general enough. cs::Entry in addition to data packet has other meta information that could be general for all CS implementations (e.g., the fact that cs::Entry contains unsolicited data packet).

I would propose to keep the current implementation as is and in the future create a cs::Entry base class, which specific implementations of CS would use to create their own entries (similar to how it was done in ndnSIM).

Actions #6

Updated by Junxiao Shi almost 10 years ago

My recommendation is:

  1. rename cs::Entry to cs::SkipListEntry, which is strictly internal
  2. declare a new cs::Entry type which includes fields that are universal to all ContentStore implementations; this type is public API
  3. iterator is dereferenced to the new cs::Entry type, which is convertible from cs::SkipListEntry

Exposing the current cs::Entry is bad because it would put unnecessary burden to the ongoing work of new ContentStore.

Actions #7

Updated by Junxiao Shi almost 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF