aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/http/simple_component_config_producer.h
blob: 2f0cc0cf1fae85c1385f6e56a39a0f60bf7ac38e (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 Yahoo. 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