include/boost/capy/detail/slice_impl.hpp

99.1% Lines (112/113) 95.8% List of functions (158/165)
slice_impl.hpp
f(x) Functions (165)
Function Calls Lines Blocks
boost::capy::detail::slice_impl<boost::capy::const_buffer>::adjust_buffer(boost::capy::const_buffer const&, unsigned long, unsigned long) :66 7188x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::adjust_buffer(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :66 15840x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::adjust_buffer(boost::capy::const_buffer const&, unsigned long, unsigned long) :66 15840x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::adjust_buffer(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :66 1220x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::adjust_buffer(boost::capy::const_buffer const&, unsigned long, unsigned long) :66 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::adjust_buffer(boost::capy::const_buffer const&, unsigned long, unsigned long) :66 104x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::adjust_buffer(boost::capy::const_buffer const&, unsigned long, unsigned long) :66 48x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::adjust_buffer(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :66 0 0.0% 0.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::adjust_buffer(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :66 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::adjust_buffer(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :66 100x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::adjust_buffer(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :66 12x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::adjust_buffer(boost::capy::const_buffer const&, unsigned long, unsigned long) :66 858x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::adjust_buffer(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :66 858x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :112 16784x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :112 23936x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :112 23936x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :112 2727x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :112 4x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :112 160x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :112 56x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :112 4x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :112 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :112 189x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :112 20x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::const_iterator(__gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long) :112 968x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::const_iterator(__gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long) :112 968x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator const&) const :126 15464x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator const&) const :126 27808x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator const&) const :126 27808x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator const&) const :126 2118x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::const_iterator const&) const :126 4x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator const&) const :126 120x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::const_iterator const&) const :126 76x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::const_iterator const&) const :126 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::const_iterator const&) const :126 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator const&) const :126 129x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::const_iterator const&) const :126 19x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator const&) const :126 1342x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator==(boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator const&) const :126 1342x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator const&) const :131 15464x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator const&) const :131 27808x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator const&) const :131 27808x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator const&) const :131 2118x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::const_iterator const&) const :131 4x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator const&) const :131 120x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::const_iterator const&) const :131 76x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::const_iterator const&) const :131 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::const_iterator const&) const :131 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator const&) const :131 129x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::const_iterator const&) const :131 19x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator const&) const :131 1342x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator!=(boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator const&) const :131 1342x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator::operator*() const :136 7188x 100.0% 78.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::operator*() const :136 15840x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::operator*() const :136 15840x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator::operator*() const :136 1220x 100.0% 78.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::const_iterator::operator*() const :136 2x 100.0% 78.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator::operator*() const :136 104x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::const_iterator::operator*() const :136 48x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::const_iterator::operator*() const :136 0 0.0% 0.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::const_iterator::operator*() const :136 1x 100.0% 78.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator::operator*() const :136 100x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::const_iterator::operator*() const :136 12x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator*() const :136 858x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator*() const :136 858x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator::operator++() :146 7170x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::operator++() :146 10080x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::operator++() :146 10080x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator::operator++() :146 1216x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::const_iterator::operator++() :146 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator::operator++() :146 104x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::const_iterator::operator++() :146 48x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::const_iterator::operator++() :146 0 0.0% 0.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::const_iterator::operator++() :146 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator::operator++() :146 92x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::const_iterator::operator++() :146 12x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator++() :146 546x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator++() :146 546x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::const_iterator::operator++(int) :152 78x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::operator++(int) :152 2880x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::operator++(int) :152 2880x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::const_iterator::operator++(int) :152 272x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::const_iterator::operator++(int) :152 48x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::const_iterator::operator++(int) :152 42x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator++(int) :152 156x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator++(int) :152 156x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::operator--() :159 5760x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::operator--() :159 5760x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator--() :159 312x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator--() :159 312x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::const_iterator::operator--(int) :165 2880x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::const_iterator::operator--(int) :165 2880x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator--(int) :165 156x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::const_iterator::operator--(int) :165 156x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::data_view(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :175 5284x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::data_view(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :175 2176x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::data_view(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :175 2176x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::data_view(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :175 735x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::data_view(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :175 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::data_view(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :175 48x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::data_view(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long) :175 14x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::data_view(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :175 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::data_view(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :175 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::data_view(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :175 71x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::data_view(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long) :175 7x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::data_view(__gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long) :175 88x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::data_view(__gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long) :175 88x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::begin() const :187 8392x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::begin() const :187 11968x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::begin() const :187 11968x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::begin() const :187 1362x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::begin() const :187 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::begin() const :187 80x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::begin() const :187 28x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::begin() const :187 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::begin() const :187 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::begin() const :187 85x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::begin() const :187 7x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::begin() const :187 484x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::begin() const :187 484x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data_view::end() const :193 8392x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data_view::end() const :193 11968x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data_view::end() const :193 11968x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data_view::end() const :193 1365x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data_view::end() const :193 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data_view::end() const :193 80x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::data_view::end() const :193 28x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data_view::end() const :193 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data_view::end() const :193 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data_view::end() const :193 104x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data_view::end() const :193 13x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data_view::end() const :193 484x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data_view::end() const :193 484x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::slice_impl() :200 0 0.0% 0.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::slice_impl() :200 0 0.0% 0.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::slice_impl() :200 0 0.0% 0.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::slice_impl() :200 0 0.0% 0.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::slice_impl(boost::capy::mutable_buffer const&) :202 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::slice_impl(std::array<boost::capy::const_buffer, 1ul> const&) :202 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::slice_impl(std::array<boost::capy::mutable_buffer, 1ul> const&) :202 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::slice_impl(std::array<boost::capy::mutable_buffer, 2ul> const&) :202 6x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::slice_impl(boost::capy::const_buffer const&, unsigned long, unsigned long) :208 1662x 89.2% 92.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::slice_impl(boost::capy::detail::buffer_array<4ul, false> const&, unsigned long, unsigned long) :208 1088x 97.3% 96.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::slice_impl(boost::capy::detail::buffer_array<4ul, true> const&, unsigned long, unsigned long) :208 1088x 97.3% 96.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::slice_impl(boost::capy::mutable_buffer const&, unsigned long, unsigned long) :208 343x 89.2% 92.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::slice_impl(std::array<boost::capy::const_buffer, 1ul> const&, unsigned long, unsigned long) :208 1x 81.1% 84.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::slice_impl(std::array<boost::capy::const_buffer, 2ul> const&, unsigned long, unsigned long) :208 48x 94.6% 92.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 3ul> >::slice_impl(std::array<boost::capy::const_buffer, 3ul> const&, unsigned long, unsigned long) :208 14x 97.3% 96.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::slice_impl(std::array<boost::capy::mutable_buffer, 2ul> const&, unsigned long, unsigned long) :208 44x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::slice_impl(std::array<boost::capy::mutable_buffer, 3ul> const&, unsigned long, unsigned long) :208 1x 86.5% 84.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::slice_impl(std::span<boost::capy::const_buffer const, 18446744073709551615ul> const&, unsigned long, unsigned long) :208 44x 97.3% 97.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::slice_impl(std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> const&, unsigned long, unsigned long) :208 44x 97.3% 97.0% boost::capy::detail::slice_impl<boost::capy::const_buffer>::data() const :264 5270x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, false> >::data() const :264 2176x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::detail::buffer_array<4ul, true> >::data() const :264 2176x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::data() const :264 74x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 1ul> >::data() const :264 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::const_buffer, 2ul> >::data() const :264 48x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 0ul> >::data() const :264 2x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 1ul> >::data() const :264 1x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 2ul> >::data() const :264 71x 100.0% 100.0% boost::capy::detail::slice_impl<std::array<boost::capy::mutable_buffer, 3ul> >::data() const :264 7x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::data() const :264 88x 100.0% 100.0% boost::capy::detail::slice_impl<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::data() const :264 88x 100.0% 100.0% boost::capy::detail::slice_impl<boost::capy::mutable_buffer>::remove_prefix(unsigned long) :269 29x 80.0% 83.0%
Line TLA Hits Source Code
1 //
2 // Copyright (c) 2026 Michael Vandeberg
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/cppalliance/capy
8 //
9
10 /*
11 Implementation type for the public buffer_slice() free function.
12 Users see this only via auto + the Slice concept; the type is
13 documented as unspecified. Maintained alongside Slice in
14 include/boost/capy/concept/slice.hpp.
15 */
16
17 #ifndef BOOST_CAPY_DETAIL_SLICE_IMPL_HPP
18 #define BOOST_CAPY_DETAIL_SLICE_IMPL_HPP
19
20 #include <boost/capy/detail/config.hpp>
21 #include <boost/capy/buffers.hpp>
22
23 #include <cstddef>
24 #include <iterator>
25 #include <type_traits>
26
27 namespace boost {
28 namespace capy {
29 namespace detail {
30
31 template<class T>
32 struct slice_buffer_type_for;
33
34 template<MutableBufferSequence T>
35 struct slice_buffer_type_for<T>
36 {
37 using type = mutable_buffer;
38 };
39
40 template<ConstBufferSequence T>
41 requires (!MutableBufferSequence<T>)
42 struct slice_buffer_type_for<T>
43 {
44 using type = const_buffer;
45 };
46
47 template<class BufferSequence>
48 requires MutableBufferSequence<BufferSequence>
49 || ConstBufferSequence<BufferSequence>
50 class slice_impl
51 {
52 public:
53 using iterator_type =
54 decltype(capy::begin(std::declval<BufferSequence const&>()));
55 using end_iterator_type =
56 decltype(capy::end(std::declval<BufferSequence const&>()));
57 using buffer_type =
58 typename slice_buffer_type_for<BufferSequence>::type;
59
60 private:
61 iterator_type first_{};
62 end_iterator_type last_{};
63 std::size_t front_skip_ = 0;
64 std::size_t back_skip_ = 0;
65
66 42071x static buffer_type adjust_buffer(
67 buffer_type const& buf,
68 std::size_t front_n,
69 std::size_t back_n) noexcept
70 {
71 if constexpr (std::is_same_v<buffer_type, mutable_buffer>)
72 {
73 18031x return mutable_buffer(
74 18031x static_cast<char*>(buf.data()) + front_n,
75 36062x buf.size() - front_n - back_n);
76 }
77 else
78 {
79 24040x return const_buffer(
80 24040x static_cast<char const*>(buf.data()) + front_n,
81 48080x buf.size() - front_n - back_n);
82 }
83 }
84
85 public:
86 /// View returned by `slice_impl::data()`.
87 class data_view
88 {
89 iterator_type first_{};
90 end_iterator_type last_{};
91 std::size_t front_skip_ = 0;
92 std::size_t back_skip_ = 0;
93
94 public:
95 class const_iterator
96 {
97 iterator_type cur_{};
98 iterator_type anchor_first_{};
99 end_iterator_type anchor_last_{};
100 std::size_t front_skip_ = 0;
101 std::size_t back_skip_ = 0;
102
103 public:
104 using iterator_category = std::bidirectional_iterator_tag;
105 using value_type = buffer_type;
106 using difference_type = std::ptrdiff_t;
107 using pointer = value_type*;
108 using reference = value_type;
109
110 const_iterator() noexcept = default;
111
112 69754x const_iterator(
113 iterator_type cur,
114 iterator_type anchor_first,
115 end_iterator_type anchor_last,
116 std::size_t front_skip,
117 std::size_t back_skip) noexcept
118 69754x : cur_(cur)
119 69754x , anchor_first_(anchor_first)
120 69754x , anchor_last_(anchor_last)
121 69754x , front_skip_(front_skip)
122 69754x , back_skip_(back_skip)
123 {
124 69754x }
125
126 76234x bool operator==(const_iterator const& other) const noexcept
127 {
128 76234x return cur_ == other.cur_;
129 }
130
131 76234x bool operator!=(const_iterator const& other) const noexcept
132 {
133 76234x return !(*this == other);
134 }
135
136 42071x value_type operator*() const noexcept
137 {
138 42071x buffer_type buf = *cur_;
139 42071x auto front_n = (cur_ == anchor_first_) ? front_skip_ : 0;
140 42071x auto next = cur_;
141 42071x ++next;
142 42071x auto back_n = (next == anchor_last_) ? back_skip_ : 0;
143 42071x return adjust_buffer(buf, front_n, back_n);
144 }
145
146 29897x const_iterator& operator++() noexcept
147 {
148 29897x ++cur_;
149 29897x return *this;
150 }
151
152 6512x const_iterator operator++(int) noexcept
153 {
154 6512x const_iterator tmp = *this;
155 6512x ++*this;
156 6512x return tmp;
157 }
158
159 12144x const_iterator& operator--() noexcept
160 {
161 12144x --cur_;
162 12144x return *this;
163 }
164
165 6072x const_iterator operator--(int) noexcept
166 {
167 6072x const_iterator tmp = *this;
168 6072x --*this;
169 6072x return tmp;
170 }
171 };
172
173 data_view() noexcept = default;
174
175 10692x data_view(
176 iterator_type first,
177 end_iterator_type last,
178 std::size_t front_skip,
179 std::size_t back_skip) noexcept
180 10692x : first_(first)
181 10692x , last_(last)
182 10692x , front_skip_(front_skip)
183 10692x , back_skip_(back_skip)
184 {
185 10692x }
186
187 34863x const_iterator begin() const noexcept
188 {
189 return const_iterator(
190 34863x first_, first_, last_, front_skip_, back_skip_);
191 }
192
193 34891x const_iterator end() const noexcept
194 {
195 return const_iterator(
196 34891x last_, first_, last_, front_skip_, back_skip_);
197 }
198 };
199
200 slice_impl() noexcept = default;
201
202 10x explicit slice_impl(BufferSequence const& bs) noexcept
203 10x : first_(capy::begin(bs))
204 10x , last_(capy::end(bs))
205 {
206 10x }
207
208 4377x slice_impl(
209 BufferSequence const& bs,
210 std::size_t offset,
211 std::size_t length) noexcept
212 4377x {
213 4377x auto it_begin = capy::begin(bs);
214 4377x auto it_end = capy::end(bs);
215
216 4377x std::size_t total = 0;
217 10956x for (auto it = it_begin; it != it_end; ++it)
218 6579x total += (*it).size();
219
220 4377x if (offset > total)
221 1x offset = total;
222 4377x std::size_t const remaining = total - offset;
223 4377x if (length > remaining)
224 2293x length = remaining;
225
226 4377x first_ = it_begin;
227 4377x last_ = it_end;
228
229 4377x std::size_t skip = offset;
230 4756x while (first_ != last_)
231 {
232 4658x std::size_t const buf_size = (*first_).size();
233 4658x if (skip < buf_size)
234 {
235 4279x front_skip_ = skip;
236 4279x break;
237 }
238 379x skip -= buf_size;
239 379x ++first_;
240 }
241
242 4377x std::size_t left = length;
243 4377x auto cursor = first_;
244 4377x std::size_t cursor_front = front_skip_;
245 5734x while (cursor != last_ && left > 0)
246 {
247 5358x std::size_t const buf_size = (*cursor).size();
248 5358x std::size_t const avail = buf_size - cursor_front;
249 5358x if (left <= avail)
250 {
251 4001x back_skip_ = avail - left;
252 4001x ++cursor;
253 4001x last_ = cursor;
254 4001x return;
255 }
256 1357x left -= avail;
257 1357x ++cursor;
258 1357x cursor_front = 0;
259 }
260
261 376x last_ = cursor;
262 }
263
264 10692x data_view data() const noexcept
265 {
266 10692x return data_view(first_, last_, front_skip_, back_skip_);
267 }
268
269 746x void remove_prefix(std::size_t n) noexcept
270 {
271 1062x while (n > 0 && first_ != last_)
272 {
273 922x std::size_t const buf_total = (*first_).size();
274 922x std::size_t live = buf_total - front_skip_;
275 922x auto next = first_;
276 922x ++next;
277 922x bool const is_last = (next == last_);
278 922x if (is_last)
279 406x live -= back_skip_;
280
281 922x if (n < live)
282 {
283 467x front_skip_ += n;
284 471x return;
285 }
286
287 455x n -= live;
288 455x if (is_last)
289 {
290 139x first_ = last_;
291 139x front_skip_ = 0;
292 139x back_skip_ = 0;
293 139x return;
294 }
295 316x ++first_;
296 316x front_skip_ = 0;
297 }
298 }
299 };
300
301 } // namespace detail
302 } // namespace capy
303 } // namespace boost
304
305 #endif
306