summaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/configgen/map_inserter.h
blob: be8bfa84dc38c036f73c86e54db461a8b6f83c9e (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "value_converter.h"
#include <vespa/vespalib/data/slime/object_traverser.h>
#include <vespa/vespalib/stllike/string.h>

#include <map>

namespace config {

namespace internal {

template<typename T, typename Converter = config::internal::ValueConverter<T> >
class MapInserter : public ::vespalib::slime::ObjectTraverser {
public:
    MapInserter(std::map<vespalib::string, T> & map);
    void field(const ::vespalib::Memory & symbol, const ::vespalib::slime::Inspector & inspector) override;
private:
    std::map<vespalib::string, T> & _map;
};

} // namespace internal

} // namespace config

#include "map_inserter.hpp"