summaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.h
blob: 55f2e572b9baeca097da760568343c9d3359f69a (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
42
43
44
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/juniper/IJuniperProperties.h>
#include <map>

namespace search::docsummary {

class JuniperProperties : public IJuniperProperties {
private:
    std::map<vespalib::string, vespalib::string> _properties;

    /**
     * Resets the property map to all default values. This is used for the empty constructor and also called before
     * retrieving configured properties.
     */
    void reset();


public:
    /**
     * Constructs a juniper property object with default values set.
     */
    JuniperProperties();
    /**
     * Constructs a juniper property object with default values set.
     */
    JuniperProperties(const vespa::config::search::summary::JuniperrcConfig &cfg);

    ~JuniperProperties() override;

    /**
     * Implements configure callback for config subscription.
     *
     * @param cfg The configuration object.
     */
    void configure(const vespa::config::search::summary::JuniperrcConfig &cfg);

    // Inherit doc from IJuniperProperties.
    const char *GetProperty(const char *name, const char *def) override;
};

}