MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / spanFromFixedQueue

Function spanFromFixedQueue

app/src/DSP.h:826–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824template<typename T>
825 requires std::copy_constructible<T> && std::is_copy_assignable_v<T>
826inline void spanFromFixedQueue(
827 const FixedQueue<T>& q, const T*& p0, std::size_t& n0, const T*& p1, std::size_t& n1)
828{
829 const T* base = q.raw();
830
831 const std::size_t n = q.size();
832 const std::size_t scap = q.storageCapacity();
833 const std::size_t i0 = q.frontIndex();
834 const std::size_t tail = std::min<std::size_t>(n, scap - i0);
835
836 p0 = base + i0;
837 n0 = tail;
838
839 p1 = base;
840 n1 = n - tail;
841}
842
843//--------------------------------------------------------------------------------------------------
844// Downsample helpers

Callers 3

downsampleMonotonicFunction · 0.85
downsampleTimeWindowFunction · 0.85
downsampleWindowAbsoluteFunction · 0.85

Calls 4

rawMethod · 0.80
storageCapacityMethod · 0.80
frontIndexMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected