aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.h
blob: 5783139c9d51f92b356e3aece4e0fdaa3f3b3e01 (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "component_config_producer.h"
#include <vespa/vespalib/util/sync.h>
#include <map>

namespace vespalib {

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

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

} // namespace vespalib