aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/print/configreader.h
blob: 6b67cab107609ec3aff7a02270774648c63ac331 (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 "configformatter.h"

namespace config {

/**
 * Interface implemented by all classes capable of reading config of a specific
 * type.
 */
template <typename ConfigType>
class ConfigReader {
public:
    /**
     * Read a config using a provided formatter, and return the correct type.
     *
     * @param formatter Something implementing ConfigFormatter interface.
     * @return Instance of correct type.
     */
    virtual std::unique_ptr<ConfigType> read(const ConfigFormatter & formatter) = 0;
    virtual ~ConfigReader() { }
};

} // namespace config