// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include namespace search::attribute { /** * Read view for the data stored in an extendable multi-value string * weighted set attribute vector (used by streaming visitor) that handles * optional removal of weight. * @tparam MultiValueType The multi-value type of the data to access. */ template class ExtendableStringWeightedSetMultiValueReadView : public attribute::IMultiValueReadView { using Offsets = std::vector>; const std::vector& _buffer; const Offsets & _offsets; const std::vector& _idx; const std::vector& _weights; mutable std::vector _copy; public: ExtendableStringWeightedSetMultiValueReadView(const std::vector& buffer, const Offsets & offsets, const std::vector& idx, const std::vector& weights); ~ExtendableStringWeightedSetMultiValueReadView() override; vespalib::ConstArrayRef get_values(uint32_t doc_id) const override; }; }