aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/configgen/map_inserter.hpp
blob: 9bd04c95b117fda34480bf741c8c51ba1256ea7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "map_inserter.h"

namespace config::internal {

template<typename T, typename Converter>
MapInserter<T, Converter>::MapInserter(std::map<vespalib::string, T> & map)
    : _map(map)
{}

template<typename T, typename Converter>
void
MapInserter<T, Converter>::field(const ::vespalib::Memory & symbol, const ::vespalib::slime::Inspector & inspector)
{
    Converter converter;
    _map[symbol.make_string()] = converter(inspector);
}

}