Task #2340
closedAllow iteration of CS content
100%
Description
CS should allow iteration over its entries.
Updated by Alex Afanasyev almost 11 years ago
- Related to Task #2339: Allow iteration over PIT entries added
Updated by Alex Afanasyev almost 11 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
Updated by Junxiao Shi almost 11 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.
Updated by Junxiao Shi almost 11 years ago
- Related to deleted (Task #2339: Allow iteration over PIT entries)
Updated by Alex Afanasyev almost 11 years ago
Junxiao Shi wrote:
cs::Entryis 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).
Updated by Junxiao Shi almost 11 years ago
My recommendation is:
- rename
cs::Entrytocs::SkipListEntry, which is strictly internal - declare a new
cs::Entrytype which includes fields that are universal to all ContentStore implementations; this type is public API - iterator is dereferenced to the new
cs::Entrytype, which is convertible fromcs::SkipListEntry
Exposing the current cs::Entry is bad because it would put unnecessary burden to the ongoing work of new ContentStore.
Updated by Junxiao Shi almost 11 years ago
- Status changed from Code review to Closed