aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/retriever/configkeyset.h
blob: 670b15ed80ec412adea781f0e71cd6deb10a745c (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
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vespalib/stllike/string.h>
#include <vespa/config/common/configkey.h>
#include <set>

namespace config {

/**
 * A ConfigKeySet is a set of ConfigKey objects. Each ConfigKey represents a
 * config by its definition name, version, md5, namespace and config id.
 */
class ConfigKeySet : public std::set<ConfigKey>
{
public:
    /**
     * Add a new config type with a config id to this set.
     *
     * @param configId the configId of this key.
     * @return *this for chaining.
     */
    template <typename... ConfigTypes>
    ConfigKeySet & add(const vespalib::string & configId);

    /**
     * Add add another key set to this set.
     *
     * @param configKeySet The set to add.
     * @return *this for chaining.
     */
    ConfigKeySet & add(const ConfigKeySet & configKeySet);
private:
    template<typename ConfigType, typename... ConfigTypes>
    void addImpl(const vespalib::string & configId);
};

} // namespace config

#include "configkeyset.hpp"