aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/common/iconfigcontext.h
blob: 71be1dec715ca727e152893310e9ce4b94568070 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <memory>

namespace config {

class IConfigManager;

/**
 * A ConfigContext is a context object that can be used to consolidate
 * multiple ConfigSubscribers to use the same resources. It also gives the
 * ability to reload config for unit testing or if using file configs.
 */
class IConfigContext
{
public:
    /**
     * Get an instance of the config manager.
     *
     * @return reference to a manager instance.
     */
    virtual IConfigManager & getManagerInstance() = 0;

    /**
     * Reload config for source provided by this context.
     */
    virtual void reload() = 0;

    virtual ~IConfigContext() = default;
};

} // namespace