blob: d1790cb75d26c04cfd41a205d3e91fec06f6174c (
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 "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
|