ardupilot/libraries/AP_HAL/utility
Leandro Pereira e3b676ba89 AP_HAL: Add method to peek non-contiguous parts of a ByteBuffer
Modify ByteBuffer class to have a `peekiovec()` method, that takes in a
`struct IoVec` array (similar to `struct iovec` from POSIX), and a
number of bytes, and returns the number of elements from this array
that have been filled out.  It is either 0 (buffer is empty), 1
(there's enough contiguous bytes to read that amount) or 2 (ring buffer
is wrapping around).

This enables using scatter-gather I/O (i.e. writev()), removing calls
to memcpy().  That's one call when no wrap-around is happening, and
two calls if it is.

Also, rewrite `ByteBuffer::peekbytes()` to use `peekiovec()`, so that
some of the checks performed by the former are not replicated in the
latter.
2016-07-08 13:10:16 -03:00
..
tests AP_HAL: fix signed and unsigned comparison warning 2016-05-04 08:58:37 -03:00
BetterStream.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
OwnPtr.h AP_HAL: utility: Add OwnPtr implementation 2016-02-16 19:49:08 -02:00
Print.cpp AP_HAL: standardize inclusion of libaries headers 2015-08-18 17:12:51 +10:00
Print.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
RingBuffer.cpp AP_HAL: Add method to peek non-contiguous parts of a ByteBuffer 2016-07-08 13:10:16 -03:00
RingBuffer.h AP_HAL: Add method to peek non-contiguous parts of a ByteBuffer 2016-07-08 13:10:16 -03:00
Socket.cpp AP_HAL: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
Socket.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Stream.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
dsm.cpp AP_HAL: moved dsm implementation into AP_HAL/utility 2015-12-27 16:12:27 +11:00
dsm.h AP_HAL: moved dsm implementation into AP_HAL/utility 2015-12-27 16:12:27 +11:00
ftoa_engine.cpp AP_HAL: ftoa_engine: replace tabs with spaces 2015-12-27 15:58:12 -02:00
ftoa_engine.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
functor.h AP_HAL: functor: use std::remove_reference 2016-02-16 19:49:09 -02:00
getopt_cpp.cpp AP_HAL: allow getopt_cpp on QURT 2015-12-29 19:10:46 +11:00
getopt_cpp.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
print_vprintf.cpp Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
print_vprintf.h AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
sparse-endian.h AP_HAL: sparse-endian: conditionally include byteswap header 2016-03-23 17:50:38 -03:00
utoa_invert.cpp AP_HAL: support %lld and %llu in internal printf 2015-05-27 11:54:17 +10:00
xtoa_fast.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00