Task #2340
closed
- Related to Task #2339: Allow iteration over PIT entries added
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
- 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
.
- Related to deleted (Task #2339: Allow iteration over PIT entries)
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).
My recommendation is:
- rename
cs::Entry
to cs::SkipListEntry
, which is strictly internal
- declare a new
cs::Entry
type which includes fields that are universal to all ContentStore implementations; this type is public API
- 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.
- Status changed from Code review to Closed
Also available in: Atom
PDF