aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/raw/rawsource.h
blob: a6e1e806cbf50068ba4ca6021cc68dc0de6fc96d (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
27
28
29
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/config/common/source.h>
#include <vespa/config/common/types.h>
namespace config {

class IConfigHolder;

/**
 * Class for sending and receiving config request from a raw string.
 */
class RawSource : public Source {
public:
    RawSource(std::shared_ptr<IConfigHolder> holder, const vespalib::string & payload);
    RawSource(const RawSource &) = delete;
    RawSource & operator = (const RawSource &) = delete;
    ~RawSource() override;
    void getConfig() override;
    void reload(int64_t generation) override;
    void close() override;
private:
    std::shared_ptr<IConfigHolder> _holder;
    StringVector readConfig();
    const vespalib::string _payload;
};

}