aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/http/simple_component_config_producer.h
blob: 51df73d9a5449ffdb9a263aaf9d43551f7793817 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "component_config_producer.h"
#include <map>
#include <mutex>

namespace vespalib {

class SimpleComponentConfigProducer : public ComponentConfigProducer
{
private:
    std::mutex _lock;
    std::map<vespalib::string, Config> _state;

public:
    SimpleComponentConfigProducer();
    ~SimpleComponentConfigProducer() override;
    void addConfig(const Config &config);
    void removeConfig(const vespalib::string &name);
    void getComponentConfig(Consumer &consumer) override;
};

} // namespace vespalib