Commit Graph

6 Commits

Author SHA1 Message Date
bfc7f02d79 ArrayView: Support compile-time constant sizes
BUG=none

Review-Url: https://codereview.webrtc.org/2667383006
Cr-Commit-Position: refs/heads/master@{#16981}
2017-03-02 20:33:50 +00:00
a28780e994 Introduce ArrayView::subview function
to return portion of the original view

BUG=None

Review-Url: https://codereview.webrtc.org/2502383004
Cr-Commit-Position: refs/heads/master@{#15149}
2016-11-18 09:46:30 +00:00
d313403564 rtc::Buffer: Let SetData and AppendData accept anything with .data() and .size()
In addition to setting or appending from another Buffer, which was
already possible, this allows for e.g. std::vector and rtc::ArrayView
arguments.

Review-Url: https://codereview.webrtc.org/2293983002
Cr-Commit-Position: refs/heads/master@{#14073}
2016-09-05 14:46:24 +00:00
bd4317263a Restrict the 1-argument ArrayView constructor to types with .size() and .data()
Before this change, the argument still needed those methods, but not
having them resulted in a compilation error. Now, it results in this
constructor being removed from the overload set.

This currently makes no difference, but I'm about to publish a CL that
breaks without this.

Review-Url: https://codereview.webrtc.org/2312473002
Cr-Commit-Position: refs/heads/master@{#14068}
2016-09-05 11:20:58 +00:00
288886b2ec Pass audio to AudioEncoder::Encode() in an ArrayView
Instead of in separate pointer and size arguments.

Review URL: https://codereview.webrtc.org/1418423010

Cr-Commit-Position: refs/heads/master@{#10535}
2015-11-06 09:21:39 +00:00
e2a83eee73 Introduce rtc::ArrayView<T>, which keeps track of an array that it doesn't own
The main intended use case is as a function argument, replacing the
harder-to-read and harder-to-use separate pointer and size arguments.
It's easier to read because it's just one argument instead of two, and
with clearly defined semantics; it's easier to use because it has
iterators, and will automatically figure out the size of arrays.

BUG=webrtc:5028
R=andrew@webrtc.org, solenberg@webrtc.org

Review URL: https://codereview.webrtc.org/1408403002 .

Cr-Commit-Position: refs/heads/master@{#10415}
2015-10-26 18:51:42 +00:00