Skip to content

Updates to the buffer api. Fix for #38 & #39.

Jonathan Hanks requested to merge jonathan-hanks/nds2-client:buffer-api into master

Fix for #38 (closed) & #39 (closed).

  1. Add a type safe at(index) function that returns the sample at the given index, with the proper type.

  2. Remove the operator[] as it was only used internally and referenced bytes instead of samples.

Note this does not remove byte level access to the buffer, that can be done via cbegin(). This change is designed to keep a consistent view of the buffer as a collection of samples.

  1. Added a constructor overload that takes a std::vector, so that data can be moved into the buffer instead of copied.

Merge request reports