// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include namespace streaming { /* * This class wraps an IAttributeContext and records accesses to attribute * vectors. */ class AttributeAccessRecorder : public search::attribute::IAttributeContext { std::unique_ptr _ctx; mutable vespalib::hash_set _accessed_attributes; public: AttributeAccessRecorder(std::unique_ptr ctx); ~AttributeAccessRecorder() override; void asyncForAttribute(const vespalib::string& name, std::unique_ptr func) const override; const search::attribute::IAttributeVector* getAttribute(const string& name) const override; const search::attribute::IAttributeVector * getAttributeStableEnum(const string& name) const override; void getAttributeList(std::vector& list) const override; void releaseEnumGuards() override; std::vector get_accessed_attributes() const; }; }