aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/subscription/confighandle.hpp
blob: 9ad27a5cb3fb57dd1e74419127ba68e48b19596f (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "confighandle.h"
#include <vespa/config/common/configvalue.hpp>

namespace config {

template <typename ConfigType>
ConfigHandle<ConfigType>::ConfigHandle(std::shared_ptr<ConfigSubscription> subscription)
    : _subscription(std::move(subscription))
{
}

template <typename ConfigType>
ConfigHandle<ConfigType>::~ConfigHandle() = default;

template <typename ConfigType>
std::unique_ptr<ConfigType>
ConfigHandle<ConfigType>::getConfig() const
{
    return _subscription->getConfig().template newInstance<ConfigType>();
}

template <typename ConfigType>
bool
ConfigHandle<ConfigType>::isChanged() const
{
    return _subscription->isChanged();
}

} // namespace config