Enhance and stabilize binary_data interface

Registered by SqUe

binary_data is the heart of liboonet, so we must take more care, although it is the best code inside liboonet. Some things must be revised and the interface must be stabilized.
 * scale_mem() It works... but we haven't investigate if it could do it better
 * operator[] It works... but it does a VERY expensive test for buffer over/under flow. We must follow std::vector specification operator[] does not do range check, at() does range check.
 * Implement binary_data to follow "ForwardContainer" concept. (Compatibility with stdlib)
 * Drop various constructors and leave only one from cmem_ref.
 * Cast to string() It is helpfull but there aren't only std::string in this world, so we must either provide ALL or nothing. [^1]
 * Investigate if we are taking full advantage of CoW.
 * Use the new mem_ref interface for reacting with external memory objects
 * Investigate if we can implement Concat On Read

[1] Still under discussion

Blueprint information

Status:
Started
Approver:
SqUe
Priority:
Essential
Drafter:
SqUe
Direction:
Approved
Assignee:
SqUe
Definition:
Approved
Series goal:
Accepted for 0.x
Implementation:
Good progress
Milestone target:
milestone icon 0.3
Started by
SqUe

Related branches

Sprints

Whiteboard

Proposed Stable Interface 1
-------------------------------------

binary_data
  binary_data(const binary_data &);
  binary_data & operator=(const binary_data &);

  binary_data operator+(const_mem_block &);
  binary_data operator+=(const_mem_block &);

  size_t find(const_mem_block &);
  binary_data sub_data(size_t start_offset, size_t desired_size);
  binary_data until(size_t desired_size);
  binary_data from(size_t offset);

  pointer c_array();
  const pointer c_array() const;
  size_t size();

  // Constants
  size_t npos;
  binary_data nothing;

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.