aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.h
blob: c31c8b41c73ee3f2c890275ef6f67b8c23a15ab4 (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 2016 Yahoo Inc. 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