// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include #include #include namespace config { class ConfigInstance; class IConfigHolder; /** * Class for sending and receiving config request from a raw string. */ class ConfigSetSource : public Source { public: typedef std::map BuilderMap; typedef std::shared_ptr BuilderMapSP; ConfigSetSource(std::shared_ptr holder, const ConfigKey & key, BuilderMapSP builderMap); ConfigSetSource(const ConfigSetSource &) = delete; ConfigSetSource & operator =(const ConfigSetSource &) = delete; ~ConfigSetSource(); void getConfig() override; void reload(int64_t generation) override; void close() override; private: std::shared_ptr _holder; const ConfigKey _key; int64_t _generation; BuilderMapSP _builderMap; ConfigState _lastState; bool validRequest(const ConfigKey & key); }; }