aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/configgen/map_inserter.h
blob: e35ee8cb0acb0162ae55db813292f4f641625ecc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. 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::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;
};

}