Actions
Feature #3100
closedAdd Block constructor to create sub-blocks reusing the underlying buffer
Start date:
Due date:
% Done:
100%
Estimated time:
Description
To avoid multiple copy operations during processing of NDNLP packets, a Block should allow creation of sub-blocks reusing the underlying buffer.
/** @brief Create a Block from existing block (reusing the underlying buffer), directly
* specifying boundaries of the block within the buffer
*
* This overload will automatically detect type and position of the value within the block
*/
Block(const Block& block,
const Buffer::const_iterator& begin, const Buffer::const_iterator& end,
bool verifyLength = true);
Updated by Junxiao Shi over 9 years ago
Does this in any way contradict with the copy-on-write semantics of Block
?
For example:
- create block1 with a full Interest
- create block2 that shares the buffer of block1, covering the Name portion of that Interest
- modify either block1 or block2 using
parse
theninsert|delete
thenencode
- call
parse
on the other block
Expected: the other block remain unchanged
Updated by Alex Afanasyev over 9 years ago
It does not conflict.
In fact, the same operation is used as part of internal "Block::parse()" method (not exactly the same way, but almost the same). This feature is merely allowing external usage of the function, with creation of blocks from arbitrary offsets inside the underlying wire buffer.
Updated by Junxiao Shi over 9 years ago
It does not conflict.
To prove this point, test case(s) similar to note-1 steps should be created as part of this issue, in the same commit.
Updated by Junxiao Shi over 9 years ago
- Status changed from Code review to Closed
- Start date deleted (
08/12/2015)
Actions